Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 1.

Slides:



Advertisements
Similar presentations
Copyright ©2010 Oracle Corporation Made available under Creative Commons Attribution-Share Alike 3.0 Unported EclipseLink Runtime Architecture Data Source.
Advertisements

1 Copyright © 2005, Oracle. All rights reserved. Introduction.
11 Copyright © 2005, Oracle. All rights reserved. Creating the Business Tier: Enterprise JavaBeans.
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 1.
J2EE Architecture Overview
MVC in JavaEE 8 Manfred Riem Principal Member of Technical Staff September, 2014 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 1 JavaScript/HTML5 Rich Clients Using Java EE 7 Reza Rahman Java EE/GlassFish.
 Java EE 7 The new features of the upcoming Enterprise Edition.
A Java Architecture for the Internet of Things Noel Poore, Architect Pete St. Pierre, Product Manager Java Platform Group, Internet of Things September.
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 13 1.
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 1 Graphic Section Divider.
An architecture for webb applications, J2EE
Integrating SOA and the Application Development Framework Shaun O’Brien Principal Product Manager – Oracle JDeveloper / ADF.
 Java  Python  Bigtable(Bt) is a distributed storage system for managing structured data that is designed to scale to a very large size.  Query Language.
JBoss Seam: Contextual Components Jason Bechtel
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 2 Hidden Gems of APEX David Gale Software Engineer Oracle Application Express November,
The Safe Harbor The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated.
1.
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 1 Testing Java EE Applications using Arquillian Reza Rahman Java EE/GlassFish.
Introduction to EJB INFORMATICS ENGINEERING – UNIVERSITY OF BRAWIJAYA Eriq Muhammad Adams J
Emmanuel Cecchet et al.  Performance Scalability of J2EE application servers.  Test effect of: ◦ Application Implementation Methods ◦ Container Design.
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 1.
“This presentation is for informational purposes only and may not be incorporated into a contract or agreement.”
J AVA SE, EE, AND ME Compiled (with permission) from Sang Shin’s Introduction to Java EE Online Course Introduction to Java EE Online Course.
1 WebSocket & JSON Java APIs Hackday By Somay David
Java EE 7 Overview Hamed Hatami January 2014 from Iran JUG.
Chapter 10 EJB Concepts of EJB Three Components in Creating an EJB Starting/Stopping J2EE Server and Deployment Tool Installation and Configuration of.
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 1.
CSCI 6962: Server-side Design and Programming Course Introduction and Overview.
1 Lecture 22 George Koutsogiannakis Summer 2011 CS441 CURRENT TOPICS IN PROGRAMMING LANGUAGES.
1Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 8 Reporting from Contract.
EJB. Component Characteristics An enterprise Bean typically contains business logic that operates on the enterprise’s data. An enterprise Bean’s instances.
Ing. Ignacio Roqueta ARTech GeneXus and J2EE.
Oracle Application Express 3.0 Joel R. Kallman Software Development Manager.
Module 6 Message-Driven Beans. History Introduced in EJB 2.0 –Supports processing of asynchronous messages from a JMS provider Definition expanded in.
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 13 1.
Enterprise Java Bean Matt. 2 J2EE 3 J2EE Overview.
Enterprise JavaBeans. What is EJB? l An EJB is a specialized, non-visual JavaBean that runs on a server. l EJB technology supports application development.
Message-Driven Beans and EJB Security Lesson 4B / Slide 1 of 37 J2EE Server Components Objectives In this lesson, you will learn about: Identify features.
J2EE Structure & Definitions Catie Welsh CSE 432
Enterprise Java v120131Intro to JavaEE1 Java EE 5 TM Introduction.
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 1 Quick Tutorial – Part 2 Open Data Web Services for Oracle BPM August, 2013 Forms.
1Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 8 Contract Management.
J2EE Overview ver 1.0Page 1 © Wipro Technologies Talent Transformation J2EE Overview.
Source: Peter Eeles, Kelli Houston, and Wojtek Kozaczynsky, Building J2EE Applicationa with the Rational Unified Process, Addison Wesley, 2003 Prepared.
Ch 2 – Application Assembly and Deployment COSC 617 Jeff Schmitt September 14, 2006.
Overview and update Pete Raymond. » Purpose of this presentation » Background » JSR Requirements » Key concepts » Relationship to other standards/approaches.
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 1.
Workforce Scheduling Release 5.0 for Windows Implementation Overview OWS Development Team.
Assignment of JAVA id : BSSE-F10-M-10-JAVA1 Overview of J2EE/Session 2/Slide 1 of 38.
Jonathan Gallimore | Tomitribe Cluster your application with JCache and CDI.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Preface IIntroduction Objectives I-2 Course Overview I-3 1Oracle Application Development Framework Objectives 1-2 J2EE Platform 1-3 Benefits of the J2EE.
Session Beans Based on: Patel, Brose, Silverman, Mastering Enterprise JavaBeans 3.0.
Introduction to EJB. What is an EJB ?  An enterprise java bean is a server-side component that encapsulates the business logic of an application. By.
Java Programming: Advanced Topics 1 Enterprise JavaBeans Chapter 14.
Singleton Academy, Pune. Course syllabus Singleton Academy Pune – Course Syllabus1.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Think Async Masoud Kalali, Software Engineer, Embrace and.
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 1.
1.Education Overview JAVA EE 6 Technologies
Enterprise Java Beans. Contents  Understanding EJBs  Practice Section.
Oracle Java Cloud Service Oracle Develop July 2013.
Java Servlets By: Tejashri Udavant..
JMS.Next(): JMS 2.0 and Beyond
BluePrints Reimagined
Project Helidon Deep Dive
Java Messaging Service (JMS)
J2EE Lecture 13: JMS and WebSocket
Enterprise Java Beans.
Presentation transcript:

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 1

JavaEE.Next(): Java EE 7, 8, and Beyond Reza Rahman Java EE/GlassFish Evangelist

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 3 The following is intended to outline our general product direction. It is intended for information purposes only, 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 features or functionality described for Oracle’s products remains at the sole discretion of Oracle.

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 4 Program Agenda  Overview  A Taste of API Changes  Looking Ahead

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 5 Java EE Past, Present, & Future J2EE 1.3 CMP, Connector Architecture J2EE 1.3 CMP, Connector Architecture J2EE 1.4 Web Services Mgmt, Deployment, Async Connector J2EE 1.4 Web Services Mgmt, Deployment, Async Connector Java EE 5 Ease of Development, EJB 3.0, JPA, JSF, JAXB, JAX-WS, StAX, SAAJ Java EE 5 Ease of Development, EJB 3.0, JPA, JSF, JAXB, JAX-WS, StAX, SAAJ Java EE 6 Pruning, Extensibility Ease of Dev, CDI, JAX-RS Java EE 6 Pruning, Extensibility Ease of Dev, CDI, JAX-RS Web Profile Servlet 3.0, EJB 3.1 Lite Web Profile Servlet 3.0, EJB 3.1 Lite Java EE 7 JMS 2.0, Batch, Caching, TX Interceptor, WebSocket, JSON Java EE 7 JMS 2.0, Batch, Caching, TX Interceptor, WebSocket, JSON Web Profile JAX-RS 2.0 Web Profile JAX-RS 2.0 JAX-RPC, CMP/ BMP, JSR 88 J2EE 1.2 Servlet, JSP, EJB, JMS, RMI J2EE 1.2 Servlet, JSP, EJB, JMS, RMI

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 6 Java EE 7 – Candidate JSRs Connector 1.6 Managed Beans 1.0 EJB 3.2 Servlet 3.1 Portable Extension s Portable Extension s JSF 2.2 JAX-RS 2.0 Bean Validation 1.1 JMS 2.0 JPA 2.1 EL 3.0 JTA 1.2 JSP 2.2 Interceptors 1.1 CDI 1.1 Common Annotations 1.1 UpdatedMajor Release New Concurrency Utilities (JSR 236) Concurrency Utilities (JSR 236) Batch Applications (JSR 352) Java API for JSON (JSR 353) Java API for WebSocket (JSR 356) Java API for WebSocket (JSR 356)

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 7 JMS 2  API modernization using dependency injection  JCA adapter required  Delivery delay, async send, delivery count, MDB alignment  Fixes, clarifications

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 8 JMS 2 Old = "java:global/jms/demoConnectionFactory") ConnectionFactory = "java:global/jms/demoQueue") Queue demoQueue; public void sendMessage(String payload) { try { Connection connection = connectionFactory.createConnection(); try { Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); MessageProducer messageProducer = session.createProducer(demoQueue); TextMessage textMessage = session.createTextMessage(payload); messageProducer.send(textMessage); } finally { connection.close(); } } catch (JMSException ex) { Logger.getLogger(getClass().getName()).log(Level.SEVERE, null, ex); }

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 9 JMS 2 Simplified private JMSContext = "jms/inboundQueue") private Queue inboundQueue; public void sendMessage (String payload) { context.createProducer().send(inboundQueue, payload); }

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 10 JMS 2/Java EE 7 JMS Resource name="java:global/jms/demoConnectionFactory", className= "javax.jms.ConnectionFactory", description="ConnectionFactory to use in name = "java:global/jms/demoQueue", description = "Queue to use in demonstration", className = "javax.jms.Queue", destinationName="demoQueue")

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 11 JMS 2/EJB 3.2 More Standard = propertyName = "destinationType", propertyValue = propertyName = "destinationLookup", propertyValue = propertyName = "connectionFactoryLookup", propertyValue = "jms/MyConnectionFactory")}) public class OrderListener implements MessageListener {... public void onMessage(Message message) {... }... }

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 12 Java API for WebSocket  Higher level API for WebSocket  Both client and server-side (Java SE and Java EE)  Both declarative and programmatic

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 13 Java API for WebSocket Connection public class ChatServer { Set peers public void onOpen(Session peer) { peers.add(session); public void onClose(Session session) { peers.remove(session); }...

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 14 Java API for WebSocket WebSocket public void message(String message, Session client) throws IOException { for (Session session : peers) { if (!session.equals(client)) { session.getRemote().sendObject(message); } } }

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 15 Java API for JSON Processing  API to parse, generate, transform, query JSON  Object Model and Streaming API -- similar to DOM and StAX  Binding JSON to Java objects forthcoming

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 16 Java API for JSON Processing Writing JSON (Object Model API) "phoneNumber": [ { "type": "home", "number": ” ” }, { "type": ”work", "number": ” ” } ] JsonObject jsonObject = new JsonBuilder().beginArray("phoneNumber").beginObject().add("type", "home").add("number", " ").endObject().beginObject().add("type", ”work").add("number", " ").endObject().endArray().build();

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 17 Java API for JSON Processing Reading JSON (Streaming API) { "firstName": "John", "lastName": "Smith", "age": 25, "phoneNumber": [ { "type": "home", "number": " " }, { "type": "fax", "number": " " } ] } Iterator it = parser.iterator(); Event event = it.next(); // START_OBJECT event = it.next(); // KEY_NAME event = it.next(); // VALUE_STRING String name = parser.getString(); // "John”

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 18 JAX-RS 2  Client API  Message Filters & Entity Interceptors  Asynchronous Processing – Server & Client  Hypermedia Support  Content Negotiation  Common Configuration

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 19 JAX-RS 2 Client API // Get instance of Client Client client = ClientFactory.newClient(); // Get customer name for the shipped products String name = client.target(“../orders/{orderId}/customer”).pathParam(”orderId", ”10”).queryParam(”shipped", ”true”).request().get(String.class);

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 20 JAX-RS 2 Logging Filter public class RequestLoggingFilter implements ContainerRequestFilter public void filter(ContainerRequestContext requestContext) { log(requestContext); // Non-wrapping => returns without invoking next filter }... }

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 21 JPA 2.1  Schema generation  Stored procedures  Unsynchronized persistence contexts  Entity converters  Fixes and enhancements

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 22 JPA 2.1  What: Generation of database artifacts – Tables, indexes, constraints, generators, …  Scenarios: Prototyping, database provisioning (e.g. in cloud), production  To: Database, DDL, Both  From: O/R mapping metadata, SQL DDL scripts  When: Prior to app deployment Schema Generation

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 23 JPA 2.1  javax.persistence.schema-generation-action – “none”, “create”, “drop-and-create”, “drop”  javax.persistence.schema-generation-target – “database”, “scripts”, “database-and-scripts”  javax.persistence.ddl-create-script-target/source  javax.persistence.ddl-drop-script-target/source  javax.persistence.sql-load-script-source Schema Generation Properties

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 24 JPA 2.1 Schema @Entity public class Employee private Integer id; private String private Department dept; … }

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 25 JPA 2.1 procedureName="Top10Gifts") public class Product { StoredProcedreQuery query = EntityManager.createNamedStoredProcedureQuery( "topGiftsStoredProcedure"); query.registerStoredProcedureParameter(1, String.class, ParameterMode.INOUT); query.setParameter(1, "top10"); query.registerStoredProcedureParameter(2, Integer.class, ParameterMode.IN); query.setParameter(2, 100);... query.execute(); String response = query.getOutputParameterValue(1);

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 26 JPA 2.1 Unsynchronized Persistence public class ShoppingCart synchronization=UNSYNCHRONIZED) EntityManager em; Customer customer; Order order; public void startToShop(Integer custId) { customer = em.find(Customer.class, custId); order = new Order(); } public Collection findBooksByAuthor(String author) {... } public Collection findBooksBySubject(String subject) {... }

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 27 JPA 2.1 Unsynchronized Persistence Context public void addToCart(Book book) { Item item = new Item(book); order.addItem(item); } public Collection viewCart() {... } // Purchase the books public void confirmOrder() { em.joinTransaction(); customer.addOrder(order); }

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 28 JTA 1.2  Declarative transactions outside EJB  Transaction scope

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 29 JTA Transactional { TxType value() default TxType.REQUIRED; Class[] rollbackOn() default {}; Class[] dontRollbackOn() default {}; dontRollbackOn={SQLWarning.class}) public class UserService {...}

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 30 JSF 2.2  HTML5 Support for CDI  Managed beans deprecated/CDI alignment  File upload component  View actions  Multi-templating  Security  Fixes and enhancements

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 31 JSF 2.2 Pass-Through HTML 5 Components......

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 32 JSF 2.2 public class FlowABean implements Serializable { public String getName() { return "FlowABean"; } public String getReturnValue() { return "/return1"; public Flow getFlow(FlowBuilder builder) { builder.startNode("router1"); builder.flowReturn("success").fromOutcome("/complete"); builder.flowReturn("errorOccurred").fromOutcome("error"); builder.switchNode("router1").navigationCase().condition("#{facesFlowScope.customerId == null}").fromOutcome("create-customer").defaultOutcome("view-customer"); builder.viewNode("create-customer"); builder.viewNode("maintain-customer-record"); builder.methodCall("upgrade-customer").method("#{maintainCustomerBean.upgradeCustomer}").defaultOutcome("view-customer"); builder.initializer("#{maintainCustomerBean.initializeFlow}"); builder.finalizer("#{maintainCustomerBean.cleanUpFlow}"); return builder.getFlow(); }

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 33 JSF 2.2 File public class FileUploadBean { private Part uploadedFile; // getter/setter public String getFileText() { String text = ""; if (null != uploadedFile) { try { InputStream is = uploadedFile.getInputStream(); text = new Scanner( is ).useDelimiter("\\A").next(); } catch (IOException ex) {} } return text; }

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 34 Batch Applications for the Java Platform  API for robust batch processing targeted to Java EE

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 35 Batch Applications for the Java Platform Step Example <chunk reader=”AccountReader” processor=”AccountProcessor” writer=” Writer” chunk-size=”10” public Account readAccount() { // read account using JPA public Account processAccount(Account account) { // calculate balance public void send (List accounts) { // use JavaMail to send }

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 36 Bean Validation 1.1  Method constraints  Bean Validation artifacts injectable  Fixes, clarifications and enhancements

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 37 Bean Validation 1.1 Method Level Constraints public void Integer String customer) {... public Date getAppointment() {... }

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 38 Concurrency Utilities for Java EE  Provides simple, safe API for concurrency in Java EE  Builds on Java SE concurrency – java.util.concurrent.ExecutorService  Relatively low-level API  Important enabler for Java EE ecosystem

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 39 Concurrency Utilities for Java EE Managed Execution

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 40 Concurrency Utilities for Java EE Managed Task Executor public class TestServlet extends HTTPServlet ManagedExecutorService executor; Future future = executor.submit(new MyTask()); class MyTask implements Runnable { public void run() {... // Task logic } } }

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 41 Others  Servlet 3.1: Non-blocking I/O, upgrade to WebSocket, security…  CDI 1.1: Ordering of interceptors, Servlet  EL 3.0: Lambda expressions, Collection, operators, standalone API…  EJB 3.2: Truncating CMP/BMP…

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 42 Java EE 8  JSON-B  JCache  More CDI/EJB alignment  Cloud, PaaS, multitenancy/SaaS  JMS.next()?  JAX-RS.next()?  Modularity?  NoSQL?  Action-oriented Web framework/HTML 5?  Configuration API?

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 43 Try it Out! 4.0 download.java.net/glassfish/4.0/promoted/

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 44 Resources  Java EE 7 Transparent Expert Groups – javaee-spec.java.net  Java EE 7 Reference Implementation – glassfish.org  The Aquarium – blogs.oracle.com/theaquarium  Java EE 7 Survey –

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Insert Information Protection Policy Classification from Slide 12 45

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.Public 46