第2页
2016-4-21
第3页
JDK 9, 变化与未来
Xuelei Fan
第4页
Java 20-Year
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.
第5页
Topics
• JDK 9 • OpenJDK Community
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.
第6页
2016/05/26 2016/08/11 2016/09/01 2016/10/20 2016/12/01 2017/01/26 2017/03/23
JDK 9 Schedule
Feature Complete All Tests Run Rampdown Start Zero Bug Bounce Rampdown Phase 2 Final Release Candidate General Availability
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.
第7页
JDK 9
19 Groups
703 Members
80 JEPs
JDK 9
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.
第8页
JEP 223: New Version-String Scheme
• Motivation
– Which release contains all of the most recent security fixes: JDK 7 Update 55, or JDK 7 Update 60?
– What's the difference between releases named "JDK 7 Update 60", "1.7.0_60", and "JDK 7u60"?
• Purpose
– Revise the JDK's version-string scheme so that it is easier to distinguish major, minor, and securityupdate releases.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.
第9页
JEP 223: New Version-String Scheme
• Version numbers
– $MAJOR.$MINOR.$SECURITY
•9 • 9.0.2 • 9.1.2
• Version strings
– $VNUM(-$PRE)?(\+$BUILD)?(-$OPT)?
• 9+100 • 9.0.2+12 • 9.1.2+62
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.
第10页
JEP 222: The Java Shell (Read-EvalPrint Loop)
• Motivation
– Immediate feedback when learning Java – Exploration of coding options for developers
prototyping code or investigating a new API. – learning and exploration is streamlined
• Purpose
– Provide an interactive tool to evaluate declarations, statements, and expressions of the Java programming language, together with an API so that other applications can leverage this functionality.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.
第11页
JEP 222: The Java Shell
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.
第12页
JEP 110: HTTP/2 Client
• Motivation, problems of HttpURLConnection
– The API predates HTTP/1.1 and is too abstract.
–
The base URLConnection protocols in mind, nearly
API was designed with multiple all of which are now defunct (ftp,
gopher, etc.).
–
It works in blocking request/response).
mode
only
(i.e.,
one
thread
per
– It is very hard to use and maintain.
• Purpose
–
Define a new HTTP client API that implements WebSocket, and can replace the legacy
HTTP/2
and
HttpURLConnection API.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.
第13页
JEP 110: HTTP/2 Client
• Supports HTTP/2 • Support HTTPS/TLS • Support both synchronous and asynchronous
modes • Easy to set up the WebSocket handshake.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.
第14页
JEP 264 Platform Logging API and Service
• Motivation
– Compared to the java.util.logging API, most modern logging frameworks (e.g., Log4J 2.0, Logback) are separated into a facade and an implementation. An application that logs through such an external framework should create loggers and perform logging through the facade provided, or supported, by that framework.
– The proposed service enables applications to configure the JDK to use the same logging framework as the application.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.
第15页
JEP 264 Platform Logging API and Service
• Purpose
– Define a minimal logging API which platform classes can use to log messages, together with a service interface for consumers of those messages.
– A library or application can provide an implementation of this service in order to route platform log messages to the logging framework of its choice.
• System.Logger getLogger(String name)
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.
第16页
JEP 266(part): Reactive Streams
• Motivation
– Interfaces supporting the Reactive Streams publish-subscribe framework, nested within the new class Flow, along with a utility class SubmissionPublisher that developers can use to create custom components.
• Purpose
– An interoperable publish-subscribe framework
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.
第17页
JEP 266(part): Reactive Streams
package java.util.concurrent; public final class Flow {
public static interface Publisher<T>; public static interface Subscriber<T>; public static interface Subscription; public static interface Processor<T,R>
extends Subscriber<T>, Publisher<R>; }
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.
第18页
JEP 219 Datagram Transport Layer Security
• Motivation
–
Satisfy secure-transport requirements for the increasing number of datagram-compatible applications.
–
In many cases, the most desirable way to secure client/server applications would be to use TLS; However,
the requirement for datagram semantics automatically
prohibits use of TLS. Thus, a datagram-compatible variant
of TLS is very desirable.
– DTLS over DCCP/SCTP/SRTP, CoAP, WebRTC
• Purpose
–
Define APIs for Datagram Transport version 1.0 (RFC 4347) and 1.2
Layer
Security
(DTLS)
• Reuse SSLEngine
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.
第19页
Java Platform Module System
• The primary goals
–
Make the Java scalable down
SE to
Platform, and the JDK, more small computing devices;
easily
–
Improve Platform
the security and maintainability of Java SE Implementations in general, and the JDK in
particular;
– Enable improved application performance; and
– Make it easier for developers to construct and maintain libraries and large applications, for both the Java SE and EE Platforms.
• JSR 376 and OpenJDK Project Jigsaw
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.
第20页
Module declarations
• module-info.java
module com.foo.bar { requires com.baz.qux; exports com.foo.bar.alpha; exports com.foo.bar.beta;
}
• module code
module-info.java com/foo/bar/alpha/AlphaFactory.java com/foo/bar/alpha/Alpha.java ...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.
第21页
Module Resolution
module com.foo.app {
requires com.foo.bar; requires java.sql;
} module java.sql {
requires java.logging; requires java.xml; exports java.sql; exports javax.sql; exports javax.transaction.xa; }
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.
第22页
Module Resolution
module com.foo.app {
requires com.foo.bar; requires java.sql;
} module java.sql {
requires public java.logging; requires public java.xml; exports java.sql; exports javax.sql; exports javax.transaction.xa; }
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.
第23页
‘public’ != ‘accessible’
• Accessibility 1995 - 2015
– public – protected – <package> – private
• Accessibility 2015 –
– public to everyone – public but only to specific modules – public only within a module – Protected* – <package>* – Private*
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.
第24页
More …
• Performance improvement
– Hotspot – Core libs
• Security improvement • Unicode 7.0/8.0 • Fine control and management
– Java-Level JVM Compiler Interface – Stack-Walking API – Process API Updates – OCSP Stapling for TLS
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.
第25页
Prepare for JDK 9
• Testing Early Access builds • Provide feedback • Report bugs • Contribute code
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.
第26页
OpenJDK Community
We need your help and you can benefit from the community.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.
第27页
OpenJDK Roles
Participant
Contributor
OpenJDK Member
OpenJDK Lead
• Subscribed to OpenJDK mailing lists
• Signed the Oracle Contributor Agreement (OCA)
• Has demonstrated a history of significant contributions
• Directs the major efforts of the Community
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.
第28页
Project Roles
Author
Committer
Reviewer
Project Lead
•A Contributor who has been granted the right to create change-sets.
•An Author who has been granted direct push access to the Project’s code repositories.
•An experienced Committer who has the authority to approve changesets destined for code repositories.
•A Committer to that Project who is responsible for directing and coordinating the Project’s activities.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.
第29页
How to contribute
Become a Contributor
Find something interesting to work on
Discuss your intended change
Submit a patch
Work with your sponsor
Know what to expect
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.
第30页
More Information
• OpenJDK Bug Database
https://bugs.openjdk.java.net/
• OpenJDK Community Bylaws
http://openjdk.java.net/bylaws
• How to contribute:
http://openjdk.java.net/contribute/
• The OpenJDK Developers' Guide:
http://openjdk.java.net/guide/
• JEP Index:
http://openjdk.java.net/jeps
• JDK 9 Project:
http://openjdk.java.net/projects/jdk9
• OpenJDK Quality:
http://openjdk.java.net/groups/quality/
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.
第31页
Safe Harbor Statement
The preceding is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.