Thursday, September 04, 2014

Java 7/JEE 6 features

  • Swing
  • IO and New IO
    • The java.nio.file package and its related package, java.nio.file.attribute, provide comprehensive support for file I/O and for accessing the file system. A zip file system provider is also available in JDK 7. The following resources provide more information:
    • File I/O (featuring NIO 2.0) in the Java Tutorials; NIO stands for non-blocking I/O
    • Developing a Custom File System Provider
    • Zip File System Provider
  • Networking
    • The URLClassLoader.close method has been added. This method effectively eliminates the problem of how to support updated implementations of the classes and resources loaded from a particular codebase, and in particular from JAR files
  • Security
  • Concurrency Utilities
  • Rich Internet Applications (RIA)/Deployment
  • Requesting and Customizing Applet Decoration in Dragg able Applets
  • Embedding JNLP File in Applet Tag
  • Deploying without Codebase
  • Handling Applet Initialization Status with Event Handlers
  • Java 2D
  • Java XML - JAXP, JAXB, and JAX-WS
  • Internationalization
  • java.lang Package -Multithreaded Custom Class Loaders in Java SE 7
  • JDBC 4.1 introduces the following features:
    • The ability to use a try-with-resources statement to automatically close resources of type Connection, ResultSet, and Statement
    • RowSet 1.1: The introduction of the RowSetFactory interface and the RowSetProvider class, which enable you to create all types of row sets supported by your JDBC driver.
  • Binary Literals - In Java SE 7, the integral types (byte, short, int, and long) can also be expressed using the binary number system. To specify a binary literal, add the prefix 0b or 0B to the number.
  • Underscores in Numeric Literals - Any number of underscore characters (_) can appear anywhere between digits in a numerical literal. This feature enables you, for example, to separate groups of digits in numeric literals, which can improve the readability of your code.
  • Strings in switch Statements - You can use the String class in the expression of a switch statement.
  • Type Inference for Generic Instance Creation - You can replace the type arguments required to invoke the constructor of a generic class with an empty set of type parameters (<>) as long as the compiler can infer the type arguments from the context. This pair of angle brackets is informally called the diamond.
  • Improved Compiler Warnings and Errors When Using Non-Reifiable Formal Parameters with Varargs Methods - The Java SE 7 complier generates a warning at the declaration site of a varargs method or constructor with a non-reifiable varargs formal parameter. Java SE 7 introduces the compiler option -Xlint:varargs and the annotations @SafeVarargs and @SuppressWarnings({"unchecked", "varargs"}) to supress these warnings.
  • The try-with-resources Statement - The try-with-resources statement is a try statement that declares one or more resources. A resource is an object that must be closed after the program is finished with it. The try-with-resources statement ensures that each resource is closed at the end of the statement. Any object that implements the new java.lang.AutoCloseable interface or the java.io.Closeable interface can be used as a resource. The classes java.io.InputStream, OutputStream, Reader, Writer, java.sql.Connection, Statement, and ResultSet have been retrofitted to implement the AutoCloseable interface and can all be used as resources in a try-with-resources statement.
  • Catching Multiple Exception Types and Rethrowing Exceptions with Improved Type Checking - A single catch block can handle more than one type of exception. In addition, the compiler performs more precise analysis of rethrown exceptions than earlier releases of Java SE. This enables you to specify more specific exception types in the throws clause of a method declaration.

Deprecated features in Java 7

Deprecated features in Java EE 6

  • Java API for RESTful Web Services (JAX-RS) JSR 311
  • Contexts and Dependency Injection for the Java EE Platform (CDI) JSR 299
  •  JSR 330: Dependency Injection for Java
  • Bean Validation  JSR 303
  • Enhanced Web Tier Capabilities
    •  web fragments and shared framework pluggability
    •  Servlet 3.0, JSR 315 -  asynchronous processing and support for annotations.
    • JSF 2.0, JSR 314 (facelets)
    • Support for Ajax in JSF 2.0
  •  JSR 318: Enterprise JavaBeans 3.1
    • No-interface view
    • Singletons.
    • Asynchronous session bean invocation.
    • Simplified Packaging
    • EJB Lite
    • embeddable API and container for use in the Java SE environment
    • , JSR 317: Java Persistence 2.0.
  • Profiles and Pruning
Spring Vs JEE 6

CDI Info

Components bound to lifecycle contexts
Webtier to enterprise tier wiring
CDI brings transactional support to web tier
CDI introduces the concept of managed beans
Annotations to define scope, qualifier, transactions, security, pooling
@inject, @default, @alternative, @named

@TransactionalAttribute, @RolesAllowed, @sessionScoped, @Qualifier


Interceptors