Java 9: Building Robust Modular Applications
Dr. Edward Lavieri, Peter Verhas, Jason Lee
- 910 pages
- English
- ePUB (mobile friendly)
- Available on iOS & Android
Java 9: Building Robust Modular Applications
Dr. Edward Lavieri, Peter Verhas, Jason Lee
About This Book
Mastering advanced features of Java and implement them to build amazing projects
Key Features
- Take advantage of Java's new modularity features to write real-world applications that solve a variety of problems
- Explore the major concepts introduced with Java 9, including modular programming, HTTP 2.0, API changes, and more
- Get to grips with tools, techniques and best practices to enhance application development
Book Description
Java 9 and its new features add to the richness of the language; Java is one of the languages most used by developers to build robust software applications. Java 9 comes with a special emphasis on modularity with its integration with Jigsaw. This course is your one-stop guide to mastering the language.
You'll be provided with an overview and explanation of the new features introduced in Java 9 and the importance of the new APIs and enhancements. Some new features of Java 9 are ground-breaking; if you are an experienced programmer, you will be able to make your enterprise applications leaner by learning these new features. You'll be provided with practical guidance in applying your newly acquired knowledge of Java 9 and further information on future developments of the Java platform. This course will improve your productivity, making your applications faster. Next, you'll go on to implement everything you've learned by building 10 cool projects. You will learn to build an email filter that separates spam messages from all your inboxes, a social media aggregator app that will help you efficiently track various feeds, and a microservice for a client/server note application, to name just a few.
By the end of this course, you will be well acquainted with Java 9 features and able to build your own applications and projects.
This Learning Path contains the best content from the following two recently published Packt products:
ā¢Mastering Java 9
ā¢Java 9 Programming Blueprints
What you will learn
- Package Java applications as modules using the Java Platform Module System
- Implement process management in Java using the all-new process handling API
- Integrate your applications with third-party services in the cloud
- Interact with mail servers, using JavaMail to build an application that filters spam messages
- Use JavaFX to build rich GUI-based applications, which are an essential element of application development
- Leverage the possibilities provided by the newly introduced Java shell
- Test your application's effectiveness with the JVM harness
- See how Java 9 provides support for the HTTP 2.0 standard
Who this book is for
This learning path is for Java developers who are looking to move a level up and learn how to build robust applications in the latest version of Java.
Frequently asked questions
Information
New Tools and Tool Enhancements
- The new HTTP client
- Javadoc and the Doclet API
- mJRE changes
- JavaScript parser
- Multi-release JAR files
- The Java-level JVM compiler interface
- TIFF support
- Platform logging
- XML Catalogs
- Collections
- Platform-specific desktop features
- Enhanced method handling
- Enhanced deprecation
The new HTTP client [JEP-110]
The HTTP client before Java 9
- chunkLength
- fixedContentLength
- fixedContentLengthLong
- HTTP_ACCEPTED
- HTTP_BAD_GATEWAY
- HTTP_BAD_METHOD
- HTTP_BAD_REQUEST
- HTTP_CLIENT_TIMEOUT
- HTTP_CONFLICT
- HTTP_CREATED
- HTTP_ENTITY_TOO_LARGE
- HTTP_FORBIDDEN
- HTTP_GONE
- HTTP_INTERNAL_ERROR
- HTTP_LENGTH_REQUIRED
- HTTP_MOVED_PERM
- HTTP_MOVED_TEMP
- HTTP_MULT_CHOICE
- HTTP_NO_CONTENT
- HTTP_NOT_ACCEPTABLE
- HTTP_NOT_AUTHORITATIVE
- HTTP_NOT_FOUND
- HTTP_NOT_IMPLEMENTED
- HTTP_NOT_MODIFIED
- HTTP_OK
- HTTP_PARTIAL
- HTTP_PAYMENT_REQUIRED
- HTTP_PRECON_FAILED
- HTTP_PROXY_AUTH
- HTTP_REQ_TOO_LONG
- HTTP_RESET
- HTTP_SEE_OTHER
- HTTP_SERVER_ERROR
- HTTP_UNAUTHORIZED
- HTTP_UNAVAIABLE
- HTTP_UNSUPPORTED_TYPE
- HTTP_USE_PROXY
- HTTP_VERSION
- instanceFollowRedirects
- method
- responseCode
- responseMessage
- disconnect()
- getErrorStream()
- getFollowRedirects()
- getHeaderField(int n)
- getHeaderFieldDate(String name, long Default)
- getHeaderFieldKey(int n)
- getInstanceFollowRedirects()
- getPermission()
- getRequestMethod()
- getResponseCode()
- getResponseMessage()
- setChunkedStreamingMode(int chunklen)
- setFixedLengthStreamingMode(int contentLength)
- setFixedlengthStreamingMode(long contentLength)
- setFollowRedirects(boolean set)
- setInstanceFollowRedircts(boolean followRedirects)
- setRequestMethod(String method)
- usingProxy()
- The base URLConnection API had, defunct protocols such as Gopher and FTP increasingly over the years
- The HttpURLConnection API predated HTTP 1.1 and was overly abstract, making it less usable
- The HTTP client was woefully under documented, making the API frustrating and difficult to use
- The client only functioned on one thread at a time
- The API was extremely difficult to maintain due to the above points about it predating HTTP 1.1 and it lacking sufficient documentation
Java 9's new HTTP client
- Ease of use:
- The API was designed to provide up to 90 percent of HTTP-related application requirements.
- The new API is usable, without unnecessary complexity, for the most common use cases.
- A simplistic blocking mode is included.
- The API supports modern Java language features. Lambda expressions, a major new introduction released with Java 8, are an example.
- Core capabilities:
- Supports HTTPS/TLS
- Supports HTTP/2
- Provides visibility on all details related to HTTP protocol requests and responses
- Supports standard/common authentication mechanisms
- Provides headers received event notifications
- Provides response body received event notifications
- Provides error event notifications
- Additional capabilities:
- The new API can be used for WebSocket handshakes
- It performs security checks in concert with the current networking API
- Performance:
- For HTTP/1.1:
- The new API must perform at least as efficiently as the previous API.
- Memory consumption must not exceed that of Apache Ht...
- For HTTP/1.1: