Java one brazil_keynote_dochez

1,365 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,365
On SlideShare
0
From Embeds
0
Number of Embeds
197
Actions
Shares
0
Downloads
23
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Java one brazil_keynote_dochez

  1. 1. 1
  2. 2. <Insert Picture Here>Future of Java EEJerome DochezGlassfish Architect
  3. 3. The following is intended to outline our general product direction. It is intended for information purposes, 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 featuresor functionality described for Oracles products remains at the sole discretion of Oracle. 3
  4. 4. Java EE and… the Cloud?• Containers are back in vogue! 4
  5. 5. Java EE and… the Cloud?• We have containers...• We have services… injectable services…• We scale to large clusters…• We have a security model… 5
  6. 6. Java EE for the Cloud• Tighter requirements for resource and state management• Better isolation between applications• Potential standard APIs for NRDBMS, caching, other• Common management and monitoring interfaces• Evolution, not revolution 6
  7. 7. Better Packaging for the Cloud• Apps are versioned• Multiple versions can coexist• Must deal with data versioning, upgrades, etc.• Need ability to specify QoS properties• Apps both expose and connect to services 7
  8. 8. Cloud Platform Application Java Persistence Queueing …Service Service Service State Management Virtualization Layer 8
  9. 9. Cloud Platform ApplicationCode Code Code QoS Schema Migration Security …Module Module Module Information Java Persistence Queueing … Service Service Service State Management Virtualization Layer 9
  10. 10. Cloud PlatformApplication Application Application Java Persistence Queueing … Service Service Service State Management Virtualization Layer 10
  11. 11. Cloud PlatformApplication Application Application Application Application Java Persistence Queueing … Service Service Service State Management Virtualization Layer 11
  12. 12. Cloud Platform Managed EnvironmentApplication Application Application Application Application Java Persistence Queueing … Service Service Service State Management Virtualization Layer 12
  13. 13. Demo Application JSF EJB/Browser CDI JPA Database EJB Timer REST JPA Client Jersey Client API
  14. 14. Modularity• Build on Java SE work• Applications made of modules• Dependencies are explicit• Versioning is built-in• Classloaders straightened out 14
  15. 15. Modular Applications demo.app demo-web-1.0.3 15
  16. 16. Modular Applications demo.app twitter-client-2.3.0 demo-web-1.0.3 demo-persist-1.4.0 16
  17. 17. Modular Applications demo.app twitter-client-2.4.0 demo-web-1.0.3 demo-persist-1.4.0 requires requires requires javaee-web-7.0 jpa-2.1 jax-rs-2.0 17
  18. 18. Modular Applications demo.app twitter-client-2.3.0 demo-web-1.0.3 demo-persist-1.4.0 requires requires requires javaee-web-7.0 jpa-2.1 jax-rs-2.0 18
  19. 19. Modular Applications demo.app twitter-client-2.3.0 demo-web-1.0.3 demo-persist-1.4.0 requires requires javaee-web-7.0 jpa-2.1 jax-rs-2.0 implements gf-appserver-4.0.1 … … … … 19
  20. 20. Modular Applications demo.app twitter-client-2.3.0 demo-web-1.0.3 demo-persist-1.4.0 javaee-web-7.0 jpa-2.1 jax-rs-2.0 implements implements gf-appserver-4.0.1 implements eclipselink-2 … … … … jersey-2.0 20
  21. 21. Modular Applications demo.app twitter-client-2.4.0 jax-rs-2.1 demo-web-1.0.4 demo-persist-1.4.0 jersey-2.1.1 javaee-web-7.0 jpa-2.1 gf-appserver-4.0.1 eclipselink-2 … … … … 21
  22. 22. Modular Applications demo.app twitter-client-2.4.0 jax-rs-2.1 demo-web-1.0.4 demo-persist-1.4.0 jersey-2.1.1 javaee-web-7.0 jpa-2.1 jax-rs-2.1 gf-appserver-4.1.5 eclipselink-2 … … … … jersey-2.1.5 22
  23. 23. JSF 2.1: short term• Transient State Saving• UIData Transient state saving• XML view cleanup• Facelets Cache API• “XML free” in specification 23
  24. 24. JSF 2.2• HTML5 – semantic tags – support of browser feature detection – HTML5 for components – Audio and video – Standardize popular API (Trinidad’s page resolver, ADF ApplicationContectManager) – JSR-276, tools support – Enhancements to existing features • mobile renderkits • composite components 24
  25. 25. JMS• Resolve ambiguities and uncertainties in the APIS – Remove complexities in the existing API – Incomplete and optional integration in Java EE env.• Standardize common vendor extensions/ features• Integration with other specs and non-Java languages• Expand JMS spec with new developments in messaging 25
  26. 26. Web Tier• Web socket support• Standard JSON API• HTML5 support• NIO.2-based web container 26
  27. 27. Web Socket Sample(with Grizzly WebSocket API)public class ChatApplication extends WebSocketApplication<ChatWebSocket> {protected ChatWebSocket createWebSocket(Connection c, ServerWebSocketMeta m) { return new ChatWebSocket(c, m, this); } public void onMessage(ChatWebSocket s, DataFrame frame) { String msg = frame.getAsText(); s.sendJson(s.getUser(), msg); } public void onClose(ChatWebSocket s) { s.sendJson(“system”, s.getUser() + “ left the chat”); }} 27
  28. 28. Async Web Sample (Atmosphere)Java EE 8 @Path("/{topic}") @Produces("text/plain;charset=ISO-8859-1") public class PubSub { private @PathParam("topic") Broadcaster topic; @GET @Suspend public Broadcastable subscribe() { return new Broadcastable("",topic); } @POST @Broadcast @Consumes(MediaType.APPLICATION_FORM_URLENCODED) public Broadcastable publish( @FormParam("message") String message) { return new Broadcastable(message,topic); } 28
  29. 29. Java Persistence 2.1• Build on functionality added in JPA 2.0• Features largely driven by community input• Infilling for – Improved standardization – Improved flexibility 2
  30. 30. Java Persistence 2.1 Candidate FeaturesO/R Mapping and Modeling• Converters / custom types• “Fetch” plans / profiles• Additional mapping metadata• User-defined naming strategies• More flexibility in use of generated values• Immutable attributes; readonly entities• More flexible XML descriptors 3
  31. 31. Java Persistence 2.1 Candidate FeaturesAPI Enhancements• Additional event listeners and callbacks• Improved control of persistence context synchronization• Support for dynamic definition of persistence unit• Extension of Metamodel API to ORM• Methods for dirty detection• Additional unwrap methods 4
  32. 32. Java Persistence 2.1 Candidate FeaturesEnhancements to Query Functionality• Support for stored procedures• Additional built-in functions• Database and vendor function invocation support• Downcasting• Outer joins with ON conditions• Update and delete criteria queries• Mapping between JPQL and criteria queries• Improved result type mapping for native queries 5
  33. 33. JPA 2.1 Rollout• Targeted as part of Java EE 7 + standalone• Plan to file JSR this year – Expert Group formation in January 2011• Timelines for Java EE 7 may impact contents of JPA 2.1 – Expert Group will need to prioritize – Community input a very important factor here jsr-317-feedback@sun.com 6
  34. 34. JAX-RS status• JAX-RS 1.0: 18th October 2008• JAX-RS 1.1: 23rd November 2009 – Aligned with Java EE 6, but not in the Web profile!• JAX-RS 2.0: Future<?> – Draft JSR 12th November 2010 – Like to submit to JCP in December – http://bit.ly/bkXtay• Implementations – Apache CXF, Apache Wink, eXo, Jersey, RESTEasy, Restlet, Triaxrs 1 34
  35. 35. The Future<?>• JAX-RS 1.0 is 2 years old• JAX-RS implementations have innovated in that 2 year period... and other frameworks – Play, SiteBricks, Scalate, Spring, VRaptor• JAX-RS 2.0 should take innovations that work well and standardize – Premature standardization is a root of evil 2 35
  36. 36. List<Future<?>>• Client API – Low level builder pattern – High level response matching• Model View Controller – Using JSPs and Scalate• Asynchronous interactions – Using Atmosphere for HTTP streaming 3 36
  37. 37. List<Future<?>>• Hypermedia• Improved @Inject integration• Parameter validation – Using Bean Validation API (JSR-303)• Improve ease of use – DRY – Convention over configuration 4 37
  38. 38. Improved @Inject integration• JAX-RS was specified before JSR 330 was started• Use @Inject for all injection targets – Some progress made with CDI integration• Enable injection targets for methods that JAX- RS runtime invokes – resource methods, sub-resource methods and sub- resource locators 5 38
  39. 39. Standard injection declarationspublic class Foo { @Context UriInfo ui; @Context public setRequest(Request r) { … } public Foo(@QueryParam("x") int x) { … }} 6 39
  40. 40. Replace @Context with @Injectpublic class Foo { @Inject UriInfo ui; @Inject public setRequest(Request r) { … } @Inject public Foo(@QueryParam("x") int x) { … } @Inject SomeOtherDependency o;} 7 40
  41. 41. Replace @Context with @Injectpublic class Foo { @Inject UriInfo ui; @Inject public setRequest(Request r) { … } @Inject public Foo(@QueryParam int x) { … } @Inject SomeOtherDependency o;} 8 41
  42. 42. Supported now with CDI@RequestScopedpublic class Foo { @Inject UriInfo ui; @Inject public setRequest(Request r) { … } public Foo() {} @Inject public Foo(@QueryParam("x") int x) { … } @Inject SomeOtherDependency o;} 9 42
  43. 43. Targets for invoked methodspublic class Foo { @Inject SomeOtherDependency o; @GET public String post( String s, // Request entity is not annotated @Context UriInfo ui, @? SomeOtherDependency o) { ... }} 1 0 43
  44. 44. Targets for invoked methodspublic class Foo { @Inject SomeOtherDependency o; @GET public String post( String s, // Request entity is not annotated @Context UriInfo ui, @? SomeOtherDependency o) { ... }} 1 1 44
  45. 45. Annotate non-entity parameters?public class Foo { @Inject SomeOtherDependency o; @GET public String post( String s, @InjectParam UriInfo ui, @InjectParam SomeOtherDependency o) { ... }} 1 2 45
  46. 46. Annotate entity parameter?public class Foo { @Inject SomeOtherDependency o; @GET public String post( @Entity String s, UriInfo ui, SomeOtherDependency o) { ... }} 1 3 46
  47. 47. Future<Future<?>>• Asynchronous interactions with the Atmosphere framework – Long polling, HTTP streaming and WebSocket – Leverages JAX-RS and Jersey for a high-level programming model 1 4 47
  48. 48. Pub/Sub example@Path("/{topic}") @Produces("text/plain") public class PubSub { private @PathParam("topic") Broadcaster topic; @Suspend @GET public Broadcastable subscribe() { return new Broadcastable(topic); } @Broadcast @POST @Consumes(MediaType.APPLICATION_FORM_URLENCODED) public Broadcastable publish( @FormParam("message") String message) { return new Broadcastable(message, topic); } } 1 5 48
  49. 49. Questions?• Send feedback• JSR 311 – dev@jsr311.dev.java.net – http://jsr311.dev.java.net/ – Note: project will transition from CollabNet to Kenai infrastructure at the end of the month• Jersey – users@jersey.java.net – http://jersey.java.net/ 1 6 49

×