Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Java EE 7 - Overview and Status


Published on

Vortrag von Peter Doschkinow vor der Java Usergroup Berlin-Brandenburg am 20. November 2012.

Published in: Technology
  • Be the first to comment

Java EE 7 - Overview and Status

  1. 1. Java EE 7Overview and StatusPeter DoschkinowSenior Java Architect
  2. 2. The following is intended to outline our general product direction. It is intendedfor information purposes only, and may not be incorporated into any contract.It is not a commitment to deliver any material, code, or functionality, and shouldnot be relied upon in making purchasing decisions. The development, release,and timing of any features or functionality described for Oracle’s productsremains at the sole discretion of Oracle.
  3. 3. Agenda Java EE 7 Revised Scope HTML5 Technologies Productivity Improvements Status and Roadmap
  4. 4. Java EE Past, Present, & Future Productivity & HTML5 Java EE 7 Lightweight JMS 2.0, Ease of Batch, Java EE 6 Development Caching, TX Interceptor, Web Java EE 5 Pruning, WebSocket, Extensibility JSON Services Ease of Dev, JAX-RPC, Robustness J2EE 1.4 CDI, JAX-RS Enterprise Ease of CMP/ BMP, JSR 88Java Platform J2EE 1.3 Web Development, Services Annotations, Web J2EE 1.2 Mgmt, EJB 3.0, JPA, Web Profile CMP, Deployment, JSF, JAXB, Profile Servlet, JSP, Connector Async JAX-WS, Servlet 3.0, JAX-RS 2.0 EJB, JMS, Architecture Connector StAX, SAAJ EJB 3.1 Lite RMI/IIOP Dec 1999 Sep 2001 Nov 2003 May 2006 Dec 2009 Q2 2013 10 specs 13 specs 20 specs 23 specs 28 specs 32+ specs
  5. 5. Java EE 7 Revised Scope PaaS theme postponed for Java EE 8 HTML5 Support – WebSocket, JSON – HTML5 forms and markup Higher Productivity – Less Boilerplate – Richer Functionality – More Defaults
  6. 6. Java EE 7 – Candidate JSRs
  7. 7. PaaS Theme Postponed for Java EE 8 Reasons – Not enough experience in tenants management, provisioning, deployment and elasticity implementation in Cloud environments – Not enough consensus and substance as of August 2012  Only roles, some service metadata and tenant-id location in JNDI specified CAMP initiative to by standardized by OASIS – Language-neutral standard self-service interface for PaaS environments – Supported by Oracle, Red Hat, CloudBees, Rackspace, Software AG, …
  8. 8. Java EE 7 Community FeedbackJava EE is already 90% cloud ready due to its focus on Java EE 7 Cloud features likely to beclear packaging, deployment and portability ...When it delayed until 2015 – your view?comes to the last 10% of unmet cloud needs, we areclearly in a time of experimentation, not yet a time of Right call. Cloud standardization is a badstandardization... Vendors innovate, collectively we move with the market changing so muchstandardize. We are not done innovating in this space. David Blevins, Apache TomEE, Geronimo 52%…it is a brave and honest decision of the EG to Speaking as a Java EE implementer, we (Red Hat)realign Java EE 7 to the community needs and are very much in support of this. Weve longmake a second try on Cloud and PaaS with the advocated that we, the Java EE community are notJava EE 8 Platform release scheduled for the ready to standardize cloud yet, and feel this isspring of 2015… proven by OpenShift, our Java EE cloud offering, which is working well with Java EE 6. Markus Eisele, Java EE Consultant Pete Muir, Redhat
  9. 9. WebSocket TCP based, bi-directional, full-duplex messaging Originally proposed as part of HTML5 IETF-defined Protocol: RFC 6455 – Handshake, data transfer W3C defined JavaScript API – Candidate Recommendation Supported by most browser already
  10. 10. WebSocket Handshake and CommunicationHandshake request Handshake responseGET /chat HTTP/1.1 HTTP/1.1 101 Switching ProtocolsHost: Upgrade: websocketUpgrade: websocket Connection: UpgradeConnection: Upgrade Sec-WebSocket-Accept: s3pRbK+xOo=Sec-WebSocket-Key: gBsZSBub25jZQ== Sec-WebSocket-Protocol: chatOrigin: http://example.comSec-WebSocket-Protocol: chat, superchatSec-WebSocket-Version: 13
  11. 11. WebSocket Handshake and Communication Request Response Connected open Client open Server message message error message message message close Disconnected
  12. 12. Java API for WebSocket (JSR 356) Standard API for creating WebSocket Applications Specification – Early Draft Review – Part of Java EE 7  Under discussion: Client API in Java SE Reference implementation – – Bundled in latest GlassFish 4.0 builds
  13. 13. Java API for WebSocket Features Create WebSocket Endpoints – Annotation-driven (@WebSocketEndpoint) – Interface-driven (Endpoint) SPI for extensions and data frames Integration with Java EE Web container Client and server APIs
  14. 14. WebSocketServer Side Object Model
  15. 15. WebSocket Chat Sample@WebSocketEndpoint(path="/chat")public class ChatBean { Set<Session> peers = Collections.synchronizedSet(…); @WebSocketOpen public void onOpen(Session peer) { peers.add(peer); } @WebSocketClose public void onClose(Session peer) { peers.remove(peer); } ... @WebSocketMessage public void message(String message, Session client) { for (Session peer : peers) { peer.getRemote().sendObject(message); } }}
  16. 16. WebSocket Drawing Demo Cooperative painting with HTML5 Used technologies – WebSocket, Server-Side Events, JSON, JavaScript (Angular.js) To participate – Connect to Peter7Links –
  17. 17. Java API for JSON ProcessingJSON 1.0 API to parse, generate, transform, query, etc. JSON Object Model and Streaming API – Similar to DOM and StAX Binding JSON to Java objects forthcoming
  18. 18. Java API for JSON Processing Build a JSON Object JsonObject jsonObject = new JsonBuilder()"phoneNumber": [ .beginArray("phoneNumber") { .beginObject() "type": "home", .add("type", "home") "number": ”408-123-4567” .add("number", "408-123-4567") }, .endObject() { .beginObject() "type": ”work", .add("type", ”work") "number": ”408-987-6543” .add("number", "408-987-6543") } .endObject() ] .endArray() .build();
  19. 19. Java API for RESTful Web ServicesJAX-RS 2.0 Client API Filter and interceptor framework Asynchronous processing – server and client Hypermedia support Integration with Bean Validation
  20. 20. Java API for RESTful Web ServicesClient API// get ClientClient client = ClientFactory.newClient();// get balance for a specific card with a PINString balance ="/atm/{cardId}/balance") .pathParam("cardId", "123456") .queryParam("pin", "3711") .request("text/plain") .get(String.class);
  21. 21. Java Message Service 2.0Simplify the existing API Reduce boilerplate code API modernization using dependency injection JCA adapter for Java EE container required Connection, Session, and other objects are AutoCloseable
  22. 22. Java Message Service 2.0Sending a Message using JMS 1.1@Resource(lookup = "myConnectionFactory”)ConnectionFactory connectionFactory; Application Server@Resource(lookup = "myQueue”) Specific ResourcesQueue myQueue;public void sendMessage (String payload) { Connection connection = null; try { connection = connectionFactory.createConnection(); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); Boilerplate Code MessageProducer messageProducer = session.createProducer(myQueue); TextMessage textMessage = session.createTextMessage(payload); messageProducer.send(textMessage); } catch (JMSException ex) { //. . . } finally { if (connection != null) { try { connection.close(); Exception Handling } catch (JMSException ex) { //. . . } } }}
  23. 23. Java Message Service 2.0Sending a Message using JMS 2.0 Simplified API Default resource definition@Inject OrJMSContext context; @JmsConnectionFactory@Resource(mappedName=”myQueue")Queue myQueue;public void sendMessage(String payload) { context.createProducer().send(myQueue, payload); 18 lines 1 line}
  24. 24. Batch Applications for the Java Platform 1.0 API for robust batch processing targeted to Java EE
  25. 25. Batch Applications for the Java Platform 1.0<step id=”sendStatements”> @ReadItem <chunk reader=”AccountReader” public Account readAccount() { writer=”EmailWriter” // read account using JPA processor=”AccountProcessor” } chunk-size=”10” /></step> @ProcessItem public Account processAccount(Account account) { // calculate balance }@WriteItemspublic void sendEmail(List<Account> accounts) { // use JavaMail to send email}
  26. 26. Java Temporary Caching APIJCache 1.0 API and semantics for temporary, in-memory caching of Java objects Basic API: CacheManager cacheManager = CacheManagerFactory.getCacheManager(); Cache<String, Object> cache = cacheManager.getCache(“testCache”); ... cache.put(key1, value1); ... Object value2 = cache.get(key2); ... cache.remove(key3);
  27. 27. Java Temporary Caching APICaching Annotations public class CustomerDao { @CachePut(cacheName=“customers”) public void addCustomer(@CacheKeyParam int cid, @CacheValue Customer customer) { ... } }
  28. 28. Many other Improvements JPA 2.1: Schema generation, unsynchronized PC, converters, … EJB 3.2: Optional CMP/BMP, Ease-of-use, Refactoring, … JSF 2.2: Faces Flows, HTML5 markup support Servlet 3.1: Non-blocking IO, Upgrade to WebSocket, … EL 3.0: Lambda expressions, Collection, Operators, … JTA 1.2: Transactional interceptors CDI 1.1: Ordering of interceptors, Servlet events, …
  29. 29. Java EE 7 – Specification Status ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ Early Draft available
  30. 30. Java EE 7 – Implementation Status 4.0
  31. 31. Java EE 7 Community 1 HUGE COMMUNITY Java EE 7 14 active 19 spec 32 JSRs leads companies 201 experts 23 active projects, active Java EE 7 and transparent mailing lists GlassFish 2 Releases shipped 62 promoted builds
  32. 32. Java EE 7 Opinion Survey Which of the new API to include in Java EE 7 Full / Web Profile CDI support – Enabled by default for all jar files? – Should all Java EE API stick to CDI @Inject instead of using their own injection mechanisms? – Expanding the use of @Stereotype to non-CDI annotaions? – Using interceptors on all Java EE components?
  33. 33. Java EE 8 and BeyondStandards-based cloud programming model Deliver cloud architecture NoSQL Storage Multi tenancy for SaaS applications JSON-B Multitenancy Java EE 7 Incremental delivery of JSRs State Cloud Management Modularity based on Jigsaw PaaS Thin Server Enablement Architecture
  34. 34. Project Avatar Applications based on Thin Server Architecture Incubator for HTML5/JavaScript clients with Java EE – Learn by experimenting – Identify targets for standardization, e.g. WebSocket (now), Server-Sent Event (Future) End-to-end framework: Client and Server – A-la-carte, not all or nothing Tooling: Project Easel
  35. 35. Call to Action Java EE & GlassFish @ JavaOne 2012 – Java EE 7 transparent Expert Group – Java EE 7 Reference Implementation – The Aquarium –