Jdk 7 reference card

Solo disponible en BuenasTareas
  • Páginas : 9 (2062 palabras )
  • Descarga(s) : 0
  • Publicado : 25 de mayo de 2011
Leer documento completo
Vista previa del texto
JDK 7 Reference Card
NEWLY INCLUDED JSRs
JSR 203: More New I/O APIs for the Java Platform (“NIO.2”)
File System Access Starting with JDK 7, all files should be referenced through the new java.nio.file package, instead of the now deprecated java.io.File. JDK 7 will now use the java.nio.file.Path class to manipulate a file in any file system (FileSystem). This FileSystem can use any FileStorage.Before Java 7, you did this: File file = new File(“some_file”); With Java 7, you can do this: Path path = Paths.get(“some_file”); Now, the File class has a new method toPath() that allows you to transform File to Path: Path path = new File(“some_file”).toPath(); SocketChannel Binding and Configuration The network-oriented channel is updated! Now you can bind channel’s socket and manipulate socketoptions directly. JDK 7 provides platform-/implementation-specific socket options beyond those required by the specification. • JDK 7 includes a new ByteChannel, the SeekableByteChannel, which maintains a current position. • NetworkChannel is the new super interface for the network-oriented channels. You easily bind the channel socket, and set and query for socket options. • TheMulticastChannel interface enables you to create Internet Protocol Multicasting. The multicast implementations are directly bound to the native multicast facility. Run tens of thousands of streams in separate threads with true asynchronous I/O! JDK 7 provides asynchronous operations for both sockets and files. Some of the coolest JDK 7 channels are: • AsynchronousFileChannel: An asynchronous channel for readingand writing from and to a file. • AsynchronousSocketChannel: A simple asynchronous channel to a socket. The methods are asynchronous and support timeouts. • AsynchronousServerSocketChannel: An asynchronous channel to a ServerSocket. • AsynchronousDatagramChannel: A channel to datagram-oriented socket.

CHANGED JSRs (in Maintenance Reviews)
JSR 199: Java Compiler API
JSR 199 was added inJDK 6 and provides the ability to invoke a Java compiler via an API. Beyond the javac command-line tool, JSR 199 provides Java compiler-to-programmatic interaction as well. The Java compiler API serves three main goals: • Invocation of a compiler or other tools • Programmatic access to structured diagnostic messages • Ability to customize file input and output

JSR 206: Java API for XMLProcessing (JAXP)
JSR 206 is known as Java API for XML Processing (JAXP), an implementation-independent portable API for processing XML with Java. The main JAXP 1.3 features include: • DOM Level 3 core • A built-in validation processor for XML Schema • A thorough implementation of XML Schema data types in javax.xml.datatype • XSLTC, the fast compiling transformer, which is now the default engine forXSLT processing • An implementation of XInclude, which makes it possible to build a document using text or XML stored in reusable segments elsewhere JDK 7 will contain JAXP 1.3, which is the latest release of JAXP.

JSR 222: Java Architecture for XML Binding (JAXB)
JSR 222 is known as Java Architecture for XML Binding (JAXB). The goal of JAXB is to allow Java developers to map Java classesto XML representations. The main features of JAXB 2 include: • Support for all W3C XML Schema features (JAXB 1.0 did not specify bindings for some of the W3C XML Schema features.) • Support for binding Java to XML, with the addition of the javax.xml.bind.annotation package to control this binding. • A significant reduction in the number of generated schema-derived classes • Additionalvalidation capabilities through the JAXP 1.3 validation APIs JDK 7 will contain JAXB 2.2, which is the latest release of JAXB.

Scalable Asynchronous I/O

JSR 224: Java API for XML-Based Web Services (JAX-WS)
JSR 224 is known as the Java API for XML-based Web Services (JAX-WS), a programming model based on a standard annotation model for developing Web services applications and clients. The main...
tracking img