Zz Java7 新特性集合(官方英文版)
??
?????
What's New in Documentation
Documentation is regularly updated to provide developers with in-depth information about new features in the Java platform. Some recent updates include:
?
1.Swing
The following topics are covered:
JLayerClass
NimbusLook & Feel
Heavyweightand Lightweight Components
Shapedand Translucent Windows
Hue-Saturation-Luminance(HSL) Color Selection in JColorChooser Class
?? Image 1???NimbusLook & Feel
???Image 2 TranslucentWindow
????Image 3 GradientWindow
?Image 4 ShapedWindow?
2. Networking Enhancements in Java SE 7
The?URLClassLoader.closemethod has been added. This method effectively eliminates the problem of how tosupport updated implementations of the classes and resources loaded from aparticular codebase, and in particular from JAR files. See?Closing a URLClassLoader?for moreinformation.
The SocketsDirect Protocol (SDP) provides access to high performance network connections;see?Understanding the Sockets Direct Protocolin The Java Tutorial.
3.CollectionsFramework Enhancements in Java SE 7
The interface?TransferQueue?has been added. It is a refinement of the?BlockingQueue?interface in which producers can wait forconsumers to receive elements. One implementation of the new interface is alsoincluded in this release,?LinkedTransferQueue.
4. Client JRE Capabilities - Quick Reference
The window ofa dragged applet can be decorated with a default or custom title; see?Requesting and Customizing Applet Decoration inDraggable Applets.
The followingenhancements have been made to the syntax of JNLP files; see?JNLP File Syntax:
The os attribute in the information and resources elementscan now contain specific versions of Windows, such as Windows Vista or Windows7.
Applicationscan use the install attribute in the shortcut element to specify their their desireto be installed. Installed applications are not removed when the Java Web Startcache is cleared, but can be explicitly removed using the Java Control Panel.
Java Web Startapplications can be deployed without specifying the codebase attribute; see?Deploying Without Codebase
A JNLP filecan be embedded into an HTML page; see?Embedding JNLP File in Applet Tag.
You can checkthe status variable of the applet while it is loading to determine if theapplet is ready to handle requests from JavaScript code; see?Handling Initialization Status With Event Handlers.
You now havecontrol of the window decoration style and title of an applet launched from ashortcut or dragged out of the browser; see?Requesting and Customizing Applet Decorationin?Developing Draggable Applets.?
5. Java XML Technology Enhancements
This release contains?Java API for XMLProcessing?(JAXP) 1.4.5, supports?Java Architecture for XML Binding(JAXB) 2.2.3, and supports?Java API for XML Web Services?(JAX-WS)2.2.4.
6.?java.lang Package
Potentialdeadlocks were eliminated for multithreaded, non-hierarchically delegatingcustom class loaders; see?Multithreaded Custom Class Loaders in Java SE 7.
7.Java Virtual Machine
Java Virtual Machine Support forNon-Java Languages: Java SE 7introduces a new JVM instruction that simplifies the implementation ofdynamically typed programming languages on the JVM.
Garbage-First Collector?is a server-style garbage collector that replacesthe Concurrent Mark-Sweep Collector (CMS).
Java HotSpot Virtual MachinePerformance Enhancements
8.?Java I/O
The?java.nio.file?package and its related package,?java.nio.file.attribute, provide comprehensive support forfile I/O and for accessing the file system; see?File I/O (featuring NIO.2). NIO stands for non-blocking I/O.
The directory <Java home>/sample/nio/chatserver/ contains samplesthat demonstrate the new APIs contained in the java.nio.file package.
The directory <Java home>/demo/nio/zipfs/ contains samples thatdemonstrate the NIO.2 NFS (Network File System) file system.
9.?Security
A new nativeprovider has been added that provides several ECC-based algorithms(ECDSA/ECDH); see?Sun PKCS#11 Provider's Supported Algorithmsin?Java PKCS#11 Reference Guide.
Weakcryptographic algorithms can now be disabled; see?Appendix D: Disabling Cryptographic Algorithmsin?Java PKI Programmer's Guide?andDisabled Cryptographic Algorithms?in?Java Secure Socket Extension (JSSE) Reference Guide.
Variousenhancements related to SSL/TLS have been added to?Java Secure Socket Extension.
10.?Concurrency
Thefork/join framework, which is based on the?ForkJoinPoolclass, is an implementation of the?Executorinterface. It is designed to efficiently run a large number of tasks using apool of worker threads. A work-stealing technique is used to keep all theworker threads busy, to take full advantage of multiple processors. SeeFork/Joinin The Java Tutorials.
Thedirectory <Java home>/sample/forkjoin/ contains samples that demonstratethe fork/join framework.
The?ThreadLocalRandomclass eliminates contention among threads using pseudo-random numbers; see?ConcurrentRandom Numbers.
The?Phaserclass is a new synchronization barrier, similar to?CyclicBarrier。
11.?Java 2D
A new XRender-based Java 2D rendering pipeline is supported for modernX11-based desktops, offering improved graphics performance; see the xrenderflag in?System Properties for Java 2D Technology.
The JDK now enumerates and displays installed OpenType/CFF fontsthrough methods such as?GraphicsEnvironment.getAvailableFontFamilyNames; these fontsare also recognized by the?Font.createFont?method. See?Selecting a Font.
The?TextLayout?class supports Tibetan script.
libfontconfig, a font configuration API, is used to select fonts to usefor the logical fonts for some implementations of Linux; see?Fontconfig.
12.?Internationalization
Unicode 6.0.0?is supported; see?Unicode?in The Java Tutorials.
The directory <Java home>/demo/jfc/Font2DTest/ contains samplesthat demonstrate Java support for Unicode 6.0.
Java SE 7 can accommodate new currencies that are identified by their?ISO 4217?codes; see the?Currency?class.
13.?Java Programming Language
The followingenhancements have been added to the Java language:
Binary Literals
Underscores in Numeric Literals
Strings in switch Statements
Type Inference for GenericInstance Creation
Improved Compiler Warnings andErrors When Using Non-Reifiable Formal Parameters with Varargs Methods
The try-with-resources Statement
Catching Multiple Exception Typesand Rethrowing Exceptions with Improved Type Checking
14.?JDBC 4.1
JDBC 4.1introduces the following features:
The ability touse a?try-with-resources?statement toautomatically close resources of type?Connection,?ResultSet, and?Statement; see?Closing Connections?in?Processing SQL Statements.
RowSet 1.1:The introduction of the?RowSetFactoryinterface and the?RowSetProviderclass, which enable you to create all types of row sets supported by your JDBCdriver; see?Using the RowSetFactory Interface?in?Using JdbcRowSet Objects.