Wednesday 25 November 2015

JavaOne 2015: Java EE 8 Work in Progress

The second session of day 2 was a walk through of the JavaEE 8 specification with Linda DeMichiel, the specification lead from Oracle. JavaEE 8 is ultimately driven by community feedback. It will be comprised of 3 primary themes including HTML5 and Web, Ease of Development and CDI Alignment and Infrastructure for the Cloud.

HTML and Web Tier Enhancements:
  • JSON-B 1.0
    • Marshall and Unmarshal Java object to and from JSON
    • Draw from the best of all current binding implementations
    • Default mapping of classes to JSON
    • Selectable provider implementation
  • JSON-P 1.1
    • Tracking new pointer standards; IETF RFC 6901
    • Add editing operations
      • add, replace, remove, move, copy, test
    • Helper classes to utilize SE8 streams
    • JSON Query with Lambdas
  • Server Sent Events
    • Part of HTML5
    • Server to client streaming of text
    • Long lives HTTP sessions
    • Supported through JAX-RS enhancements
      • New media type and event in server API
      • New handlers in client API
  • MVC 1.0
    • Action based mvc architecture
    • Gluing together key EE technologies
    • Model
      • CDI, Bean Validation, JPA
    • View
      • Facelets, JSF
    • Controller
      • JAX-RS
  • HTTP/2
    • Addressing the limitation of HTTP/1.x
    • Reduce latency
    • Address head of line blocking issues
    • Support true parallelism
    • Request/Response multiplexing over 1 connection
    • Binary framing
    • Stream prioritization
    • Server Push
    • Header compression
  • Servlet 4.0
    • Incorporating HTTP/2 features into Servlet spec
      • Multiplexing, stream prioritization, server push, binary framing
Ease of Development and CDI Alignment
  • CDI security interceptors
    • @isAuthorized
      • hasRoles, hasAttributes, ruleSourceName, dynamic qualifiers
  • JMS 2.1
    • Flexible MDBs
      • User defined callbacks (removing the onMessage limitation)
      • JMS specific annotations
      • Flexible method signatures (direct access to concrete types)
    • Improved asynchronous consumption
    • CDI alternative to MDBs
  • Pruning
    • Has a multi-phased approach
      • Current EE-Spec expert group defines a technology as proposed optional and awaits feedback
      • EE-Spec EG + 1 may define a technology as optional based on given feedback
        • Optional means vendors have a choice of maintaining the technology of removing the specification
    • EE8 Proposed Optional
      • CORBA and IIOP
      • EJB 2.x remote and local views
Infrastructure for the Cloud
  • Management 2.0
    • Updating JSR77
    • REST APIs for management and deployment
    • Defined by CRUD operations
    • Server sent events
  • Security 1.0
    • Password Aliasing
    • User Management
    • Role Management
    • Authentication
    • Authorization


In total Java EE8 is targeting 11 major JSRs of which 3 are new and dozens of maintaincen JSRs on key JavaEE components like JPA, Batch, Bean Validation, Web Sockets and JCA.

Tuesday 24 November 2015

JavaOne 2015: Project Jigsaw: Under the Hood

Winding down day 2, we really pick up the intensity. The under the hood session on Jigsaw was one of the top sessions in terms of technical depth and knowledge sharing. If you're interested in the nuts and bolts of how modules will function in JDK9, this is a definite one to watch.

Here is a brief overview of the session.
  • Module Based Classloader
  • Strong encapsulation
  • Explicit readability
  • Modules must explicitly export and import the packages and classes to maintain readability
  • A public class no longer implies accessibility across barriers
  • Readability defined accessibility
src/com.example.package/module-info.java
    module com.eample.package {
          exports com.example.package.data
          exports com.example.package.services
    }
  • Independent of classloading and enforceable at compile time, in JVM and through reflection
  • Three types of modules to achieve smooth migration and backward compatibility
    • Explicit
      • Explicitly created JDK9 module
      • Well defined export / import for read edges
    • Automatic
      • Implicit module
      • Exports all
      • Reads from JDK and unnamed module
      • Modules named after JARs
    • Unnamed
      • Akin to the classpath
      • May read any exported prckage or class
      • Exports all
      • Reads none
      • Holds JARs only
  • No classloader changes, modules are associated to the base 3 classloaders
  • Classloaders always respect the module graph
  • Layers - Control the relationship of classloaders to modules
    • Creates a hierarchical module graph
    • Guarantees no cycles
  • Only 1 module may export a package (no split packaging)
  • Loader may only have 1 class of the same name