SlideShare a Scribd company logo
Main sponsor




Java	
  EE	
  7	
  and	
  HTML5:	
  Developing	
  for	
  the	
  Cloud	
  
Arun	
  Gupta,	
  Java	
  EE	
  &	
  GlassFish	
  Guy	
  
blogs.oracle.com/arungupta,	
  @arungupta	
  
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.


2   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Java EE 6 Platform
                                                                           December 10, 2009


3   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Java EE 6 – Key Statistics

    •  40+ Million Java EE 6 Component Downloads
    •  #1 Choice for Enterprise Developers
    •  #1 Application Development Platform
    •  Fastest implementation of a Java EE release




4   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Top Ten Features in Java EE 6
    1.  EJB packaging in a WAR
    2.  Servlet and CDI extension points
    3.  Optional web.xml!
    4.  Type-safe dependency injection
    5.  CDI Events
    6.  JSF standardizing on Facelets
    7.  EJBContainer API
    8.  @Schedule!
    9.  EJB No Interface View
    10. Web Profile
5   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Today’s Cloud Offerings are all Proprietary


    Infrastructure as                                                      Platform as   Software as
        a Service                                                           a Service     a Service




6   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Java EE 7




7   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Java EE 7 and 8 – Focus Areas

                 Cloud                                                              Modularity                   HTML5
•  Provisioning                                                                •  Building on Jigsaw      •  Emerging Web
                                                                                                             Standards require a
•  Elastic & Autonomic                                                         •  Focus on OSGi interop      programming model
   Scalability
                                                                               •  Supporting Profiles &   •  JSON, WebSockets,
•  Multi-Tenancy                                                                  Modular Applications       off-line, APIs & DOM




    8   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Java EE 7 Focus: Platform as a Service

    •  Next logical step for Java EE
          –  J2EE à Java EE 6 : The Java EE Platform provides services
          –  Java EE 7 : The Java EE Platform IS a service

    •  PaaS support entails evolutionary change

    •  Basic form of SaaS

    •  Provide way for customers and users to leverage public,
       private, and hybrid clouds
9   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Roles

             Developer
                                                                                                                 PaaS Provider

     PaaS
 Customer/                                                       JVM JVM JVM        JVM JVM JVM   JVM JVM JVM
    Tenant                                                                Machine     Machine       Machine            PaaS Product
                                                                                                                       Provider

                                                                 JVM JVM JVM        JVM JVM JVM   JVM JVM JVM
Deployer
                                                                          Machine     Machine       Machine           PaaS Account
                                                                      Tenant 1       Tenant 2      Tenant 3           Manager
 Application
  Submitter
                                                                                                                PaaS
                                                                                                                Administrator
                           Application
                         Administrator

  10   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Existing Java EE model
                                                                                                               Database
                                                                             1   Provision and Initialize       Service
     •  Configure Java EE resources –
        JDBC, JMS etc                                                                                           LDAP
                                                                             2                                 Service
     •  Deploy Application EAR                                                     Provision and Initialize




                                                                                                              Messaging
                                                                             3    Provision and Initialize
                                                                                                               Service

                                                                                                              Application
                                                                             4    Provision and Initialize
                                                                                                               Container



                                                                             5   Deploy Application (EAR/
                                                                                      GAR/SAR …)




11    Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Java EE 7 Model: Auto-Provision Services
     from Application Dependencies
                                                                                                              Cloud Administration
•  Provision and deploy application                                          1   Provision and Initialize
                                                                                                                    Service
resources (e.g. LDAP stripe, data
source instantiation and                                                                                          Database
                                                                             2                                     Service
connection …)                                                                      Provision and Initialize




•  Extensible Deployment Models                                                                                    LDAP
   Supporting Multiple Frameworks                                            3    Provision and Initialize        Service
     •  Spring, Seam, Play …
                                                                                                                 Messaging
                                                                             4    Provision and Initialize
                                                                                                                  Service

                                                                                                                Application
                                                                             5   Deploy Application (EAR/
                                                                                      GAR/SAR …)
                                                                                                                 Container


12    Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Services

     •  Cloud apps consume services
           –  Persistence, queueing, mail, caching, …
     •  Service metadata facilitates ease of use when deploying
        into the cloud
           @DataSourceDefinition(!
               name=“java:app/jdbc/myDB”,!
                        className=“oracle.jdbc.pool.OracleDataSource”,!
                        isolationLevel=TRANSACTION_REPEATABLE_READ,!
                        initialPoolSize=5!
           ) !



13   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Services

     •  Cloud apps consume services
           –  Persistence, queueing, mail, caching, …
     •  Service metadata facilitates ease of use when deploying
        into the cloud
           @JMSConnectionFactoryDefinition(

             name=“java:app/myJMSConnectionFactory”,
             className=“javax.jms.QueueConnectionFactory”

             resourceAdapterName=“myJMSRA”) !
           !
           @JMSDestinationDefinition(

             name=“java:app/myQueue”,

             className=“javax.jms.Queue”

             destinationName=“myQueue1”)!
14   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Services

     •  Cloud apps consume services
           –  Persistence, queueing, mail, caching, …
     •  Service metadata facilitates ease of use when deploying
        into the cloud
           @MailSessionDefinition(!
               name=“java:app/mailSession”,

               host=“example.com”

               from=“MyService@example.com”!
           ) !




15   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Services

     •  Cloud apps consume services
           –  Persistence, queueing, mail, caching, …
     •  Service metadata facilitates ease of use when deploying
        into the cloud
           @ConnectorResourceDefinition(!
               name=“java:app/myCustomConnector”,!
                        className=“com.extraServices.CustomConnector.class”,!
                        properties= {…}!
           ) !




16   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Elasticity
                                                                                   Java EE 7 Focus:
                                                                                  Move the Bar Right



                                                                             Elasticity Continuum


                                                                                  Java EE Cluster            Elastic Cluster
                                                                                                                Elastic Cluster
                                                                                                                                   Capacity
                                                                                                                                      Ca
                                                                                                                                  on Demand



Single node                                                                    Java EE Multi-Node        Dynamic Self Adjusting
Non-Elastic                                                                  Multi-Instance Clustering    SLA Driven Elasticity

      •  Service Levels
      •  Minimum and Maximum Instances
      •  Futures – Self Adjustment, Capacity On Demand
 17   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Demo
     PaaSing a Java EE Application in the Cloud




     glassfish.org/javaone2011


18   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Conference Planning in the Cloud

Java EE Application

       JSF                                JPA                               Deploy

                                   Services
      EJB                          Metadata
                                                                               <glassfish-services>

                                                                               <service-description init-type="LB" name="ConferencePlanner-lb">

                                                                                   <template id="LBNative"/>

                                                                                   <configurations>

                                                                                      <configuration name="https-port" value="50443"/>

                                                                                      <configuration name="ssl-enabled" value="false"/>

                                                                                      <configuration name="http-port" value="50080"/>

                                                                                   </configurations></service-description>

                                                                               <service-description init-type="JavaEE" name="ConferencePlanner">

                                                                                   <characteristics>

                                                                                      <characteristic name="service-type" value="JavaEE"/>

                                                                                   </characteristics>

                                                                                   <configurations>

                                                                                      <configuration name="max.clustersize" value="4"/>

                                                                                      <configuration name="min.clustersize" value="2"/>

                                                                                   </configurations>

                                                                               </service-description>!
                                                                               . . .

                                                                               </glassfish-services>!



19   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Service Provisioning

                                                                              Load
                                                                             Balancer



                                                 Java EE                    Java EE    ...   Java EE


                                                                            Database



20   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Multi-tenancy in Java EE 7
     •  Support for separate isolated instances of the same app for
        different tenants
           –  One application instance per tenant
           –  Tenants correspond to units of isolation
           –  Multitenant apps are declared as such
           –  Each instance customized and deployed for a single tenant
           –  Limited form of SaaS

     •  Mapping to tenant done by the container
     •  Tenant id available to application
           –  E.g., under java:comp/tenantId!

21   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Java EE 7 – Candidate JSRs

                                           Web
                                                                            JAX-RS     JSF 2.2                                      Jcache 1.0
                                         Container                                                 EL 3.0                           (JSR 107)
        CDI                             Extensions                            2.0      JSP 2.2
     Extensions




                                                                                                            Bean Validation 1.1
                                                                                                                                   Concurrency
                                                                              Servlet 3.1                                           Utilities 1.0
                                                                                                                                    (JSR 236)
                                                                                                                                       State
                        CDI 1.1 / Interceptors 1.1 / JSR 250 1.1                                                                  Management 1.0
                                                                                                                                    (JSR 350)
                                                                                                                                       Batch
        Managed Beans 1.0                                                               EJB 3.2                                   Processing 1.0
                                                                                                                                    (JSR 352)
                                                                                                                                     JSON 1.0
                    JPA 2.1                                                  JTA 1.1             JMS 2.0                             (JSR 353)



22   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Java EE 7 Early Draft

     •  Requires Java SE 7
     •  Added new roles
     •  Resource definition metadata
              –  DataSourceDefinition,
                 JMSConnectionFactoryDefinition,
                 JMSDestinationDefinition, MailSessionDefinition,
                 ConnectorResourceDefinition!
              –  Pre-provisioned or shared resource


23   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Java EE 7 Early Draft

     •  Default Data Source java:comp/defaultDataSource!
     •  Default JMS Connection Factory java:comp/
           defaultJMSConnectionFactory!
     •  Tenant Identifier: java:comp/tenantId!
     •  Made optional
              –  EJB Entity Beans, EJB QL, JAX-RPC, Deployment API, JAXR




24   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Java Persistence API 2.1

     •  @NamedStoredProcedureQuery,
        StoredProcedureQuery!
     •  Bulk update/delete using Criteria!
     •  User-defined functions using FUNCTION!
     •  Persistence Context Synchronization




25   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
JPA 2.1
     Stored Procedures
     @Entity

     •  Stored Procedures
     @NamedStoredProcedureQuery(name="topGiftsStoredProcedure",
     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);!
     // there are other setParameter methods for defining the temporal type

     . . .!
     query.execute();!
     String response = query.getOutputParameterValue(1);!
     !

26    Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
JPA 2.1
         Criteria Update/Delete
     CriteriaUpdate<Customer> q = cb.createCriteriaUpdate(Customer.class); 

         •  Update/Delete using Criteria
     Root<Customer> c = q.from(Customer.class); 

     q.set(c.get(Customer_.status), "outstanding")

      .where(cb.lt(c.get(Customer_.balance), 10000));

     . . .!
     @PersistenceContext EntityManager em;
            UPDATE Customer c!
     Query query = em.createQuery(q);
                 SET c.status = 'outstanding'!
     query.executeUpdate();
                           WHERE c.balance < 10000!
     

     !

         CriteriaDelete<Customer> q = cb.createCriteriaDelete(Customer.class); 

         Root<Customer> c = q.from(Customer.class); 

         q.where(cb.equal(c.get(Customer_.status), "inactive"),

                 cb.isEmpty(c.get(Customer_.orders)));

         . . .!
         @PersistenceContext EntityManager em;
           DELETE FROM Customer c

         Query query = em.createQuery(q);
                WHERE c.status = 'inactive'

         query.executeUpdate();
                          AND c.orders IS EMPTY!
         

27
         !Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
JAX-RS 2.0
     Client-side API
     •  Client-side API
 URL url = new URL("http://.../atm/balance");

 HttpURLConnection conn = (HttpURLConnection) url.openConnection();

 conn.setRequestMethod("GET");

 conn.setDoInput(true);

 conn.setDoOutput(false);

             

 BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()));

 String line;

 while ((line = br.readLine()) != null) {

     out.println(line);

 }!


 Client client = ClientFactory.newClient();!
 String balance = client.target("http://.../atm/balance")!
                        .request("text/plain")!
                        .get(String.class);!


28   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
JAX-RS 2.0
     Filters and Interceptors
     @Provider

     class LoggingFilter implements RequestFilter, ResponseFilter {!
         @Override

         public FilterAction preFilter(FilterContext ctx) throws IOException {

             logRequest(ctx.getRequest());

             return FilterAction.NEXT;

         }

     !
         @Override

         public FilterAction postFilter(FilterContext ctx) throws IOException {

             logResponse(ctx.getResponse());

             return FilterAction.NEXT;

         }

     }!


29   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
JAX-RS 2.0
         Client-side Async
         •  Client-side Async
Client client = ClientFactory.newClient();

Future<String> future = client.target("http://.../atm/{card}/balance")

                              .pathParam("card", "1111222233334444")

                              .queryParam("pin", "1234")

                              .request("text/plain")

                              .async()

                              .get(

                                 new InvocationCallback<String>() {

                                     public void completed(String result) {

                                     }



                                                                                           public void failed(InvocationException e) {

                                                                                           }

                                                                                      }

                                                                                );!

    30   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
JAX-RS 2.0
     Bean Validation Integration
     •  Integration with Bean Validation
      @Path("/")

     class ProductResource {!
         @POST

         @Consumes(MediaType.APPLICATION_FORM_URLENCODED)

         public void addProduct(@NotNull 

                                @FormParam("productName") String name,

                                @NotNull 

                                @Category 

                                @FormParam("category") String category) {

             . . .

         }

     }!




31   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
JAX-RS 2.0
     Server-side content negotiation
     @Path("/")

     •  Server-side Content Negotiation
     class ProductResource {!
         @GET

         @Produces({ "text/xml;qs=0.75", "application/json"})

         public Product[] getProducts() {

             . . .

         }

     }!




32   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
JavaServer Faces 2.2

     •  Integration with HTML5 forms
     •  Queue control for Ajax requests
     •  File Upload component (Non-Ajax & Ajax)
     •  Injection in all JSF artifacts – including converters &
        validators
     •  @FaceletsResourceResolver!
     •  Instantiating composite components in Java
     •  . . .
33    Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Contexts & Dependency Injection 1.1

     •  Embedded mode to startup outside Java EE container
     •  Global ordering of interceptors and decorators
     •  API for managing built-in contexts
     •  Send Servlet events as CDI events
     •  . . .




34   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Bean Validation 1.1

     •  Code Sample
@MethodValidated

public class OrderService { 

    public OrderService(@NotNull CreditCardProcessor creditCardProcessor) { . . .   }



           public void placeOrder(

                    @NotNull 

                    @Size(min=3, max=20) String customerCode, 

                    @NotNull @Valid Item item, 

                    @Min(1) int quantity) { . . . }



           @NotNull @Size(min=1)

           public Set<CreditCardProcessor> getCreditCardProcessors() { ... }



           @NotNull @Future

           public Date getNextAvailableDeliveryDate() { ... } !
     } !



35   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Java Message Service 2.0

     •  Simplified API
           –  Less verbose
           –  Reduce the number of objects needed to send/receive message
           –  Allow resource injection
           –  Alternative, not replacement, for standard API
           –  Remove JMSException, where possible
     •  Connection, Session and other objects are
        AutoCloseable
     •  New methods – no need for redundant arguments
36   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
JMS 1.1 – Sending a Message (Java EE)
         Standard API

     @Resource(lookup = "jms/connectionFactory ")

     ConnectionFactory connectionFactory; 

     

     @Resource(lookup="jms/inboundQueue") 

     Queue inboundQueue; 

     

     public void sendMessageOld (String payload) throws JMSException { 

     try (Connection connection = connectionFactory.createConnection()) { 

           Session session = connection.createSession(); 

           MessageProducer messageProducer = session.createProducer(inboundQueue); 

           TextMessage textMessage = session.createTextMessage(payload);

           messageProducer.send(textMessage); 

       } !
     } !



37       Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
JMS 2.0 – Sending a Message (Java EE)
     New Simplified API

     @Resource(mappedName="jms/contextFactory") !
     ConnectionFactory connectionFactory;!
     !
     @Resource(mappedName="jms/inboundQueue") !
     Queue inboundQueue;!
     !
     public void sendMessage(String payload) {!
        try (JMSContext context = connectionFactory.createContext();){!
              context.send(inboundQueue,payload);!
        }!
     }!




38   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
JMS 2.0 – Sending a Message (Java EE)
     New Simplified API (with Injection)
     @Inject!
     @JMSConnectionFactory("jms/contextFactory") !
     JMSContext context;!
     !
     @Resource(mappedName="jms/inboundQueue") !
     Queue inboundQueue;!
     !
     public void sendMessage(String payload) {!
         context.send(inboundQueue,payload);!
     }!




39   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
JSON 1.0 (JSR 353)
     javax.json.*
     •  Object model API to represent JSON
           –  Similar to DOM API in XML world
     •  Streaming API to produce/consume JSON
           –  Similar to StAX API in XML world
     JSR Supporters
           –  fasterxml.com (Jackson)
           –  Doug Crockford (json.org)
     •  Spec: json-processing-spec.java.net
     •  Reference Implementation: jsonp.java.net
40   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
JSON 1.0 (JSR 353)

     •  DOM-based APIs (javax.json.* package)
           –  JSONBuilder – Builds a JSON object
           –  JSONReader – Reads a JSON object or array from the stream
           –  JSONWriter – Writes a JSON object or array to the stream
     •  Streaming APIs (javax.json.stream.* package)
           –  JsonGenerator – Streaming JSON generator
           –  JsonParser – Allows forward, read-only access to JSON



41   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
JSON 1.0 (JSR 353)
       Code Sample - JsonBuilder
JsonObject value = new JsonBuilder()
                                         {	
  
    .beginObject()
                                                           	
  	
  	
  	
  	
  "firstName":	
  "John",	
  	
  
        .add("firstName", "John") 
                                           	
  	
  	
  	
  	
  "lastName":	
  "Smith",	
  	
  
        .add("lastName", "Smith") 
                                           	
  	
  	
  	
  	
  "age":	
  25,	
  
        add("age", 25)
                                                       	
  	
  	
  	
  	
  "address"	
  :	
  {	
  
        .beginObject("address”)

            .add("streetAddress", "21 2nd Street”)
                           	
  	
  	
  	
  	
  	
  	
  	
  	
  "streetAddress",	
  "21	
  2nd	
  Street",	
  
            .add("city", "New York”)
                                         	
  	
  	
  	
  	
  	
  	
  	
  	
  "city",	
  "New	
  York",	
  
            .add("state", "NY”)
                                              	
  	
  	
  	
  	
  	
  	
  	
  	
  "state",	
  "NY",	
  
            .add("postalCode”, "10021”)
                                      	
  	
  	
  	
  	
  	
  	
  	
  	
  "postalCode",	
  "10021"	
  
        .endObject()
                                                         	
  	
  	
  	
  	
  	
  },	
  
        .beginArray("phoneNumber")

            .beginObject() 
                                                  	
  	
  	
  	
  	
  	
  "phoneNumber":	
  [	
  
                .add("type", "home") 
                                        	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {	
  "type":	
  "home",	
  	
  
                .add("number", "212 555-1234") 
                              	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "number":	
  "212	
  555-­‐1234"	
  },	
  
            .endObject() 
                                                    	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {	
  "type":	
  "fax",	
  	
  
            .beginObject() 
                                                  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "number":	
  "646	
  555-­‐4567"	
  }	
  
                .add("type", "home") 

                .add("number", "646 555-4567") 

                                                                              	
  	
  	
  	
  	
  	
  ]	
  
            .endObject() 
                                                    	
  }	
  
        .endArray() 

    .endObject() 

.build(); !

  42   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
JSON 1.0 (JSR 353)
        Code Sample – JsonReader, JsonWriter

String json = "...";

JsonReader reader = new JsonReader(new StringReader(json));

JsonValue value = reader.readObject();

reader.close(); !



JsonWriter jsonWriter = new JsonWriter(new FileWriter(...));

JsonObject jsonObject = new JsonBuilder()

                               .beginObject()

                               . . .

                               .endObject()

                        .build();!
jsonWriter.writeObject(jsonObject);

jsonWriter.close(); !

   43   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
JSON 1.0 (JSR 353)
        Code Sample – JsonGenerator, JsonParser
JsonGenerator generator = new JsonGenerator(new FileWriter(...));

generator

  .beginObject()

  . . .

    .beginArray()

    . . .

    .endArray()

  .endObject()

.build();
                                                                     START_OBJECT!
generator.close(); !                                                           END_OBJECT!
                                                                               START_ARRAY!
                                                                               END_ARRAY!
String json = "..."; 
                                                         KEY_NAME!
JsonParser parser = new JsonParser(new StringReader(json));
                   VALUE_xxx!
Iterator<Event> it = reader.iterator();

Event event = it.next(); !
   44   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Transparency
     •  Oracle’s Java EE 7 JSRs are run in the open on java.net
           –  http://javaee-spec.java.net
           –  One project per spec – e.g., jpa-spec, jax-rs-spec, jms-spec…
     •  Publicly viewable Expert Group mail archive
           –  Users observer list gets copies of all Expert Group emails
     •  Publicly viewable download area
     •  Publicly viewable issue tracker
     •  Commitment to update to JCP 2.8 Process

45   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Status and Schedule


•  All JSRs up and running
•  Early Drafts
  –  Java EE 7 Platform, JSF 2.2, JAX-RS 2.0, JPA 2.1, CDI 1.1, EJB 3.2,
     JMS 2.0, Bean Validation 1.1, Expression Language 3.0

•  Final release target: Q2 2013



  46   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
HTML 5 is Disruptive

     •  HTML 5 is the new UI across devices
           –  Offline, Real-time Communication, File access, Semantic markup,
              Multimedia, CSS3
     •  HTML 5 Requires New Programming Model
           •  Servers no longer generating markup language
              •  Event Driven
              •  JavaScript is part of the domain model
              •  JSON is the payload, not just HTML



47   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Java EE: Investments for HTML5

     •  WebSocket and Server Sent Events Infrastructure
     •  WebSocket SDK and JSR-356
          –  Simplify the programming model for Java EE




48   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
WebSocket
     •  Part of HTML5 Specification
     •  Bi-directional
     •  Full-duplex
     •  Over a single TCP connection
     •  Examples
           –  Real-time online games
           –  Collaborative platforms
           –  Social Networking


49   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
WebSocket Protocol – Handshake
     tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-17
     GET /mychat HTTP/1.1!
     Host: server.example.com!                                              Request
     Upgrade: websocket!
     Connection: Upgrade!
     Sec-WebSocket-Key: x3JJHMbDL1EzLkh9GBhXDw==!
     Sec-WebSocket-Protocol: chat, superchat!
     Sec-WebSocket-Version: 13!
     Origin: http://example.com

     <EMPTY LINE>!
     !
     HTTP/1.1 101 Switching Protocols!
     Upgrade: websocket!                                                    Response
     Connection: Upgrade!
     Sec-WebSocket-Accept: HSmrc0sMlYUkAGmm5OPpG2HaGWk=!
     Sec-WebSocket-Protocol: chat

     <EMPTY LINE>!
50   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
WebSocket Protocol – Framing
     tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-17
     •  Wire format of messages
     •  Design Philosophy – Minimum framing required
     •  Data Frames
           –  Text & Binary
                    •  Blob, ArrayBuffer
     •  Control Frames
           –  Protocol-level signaling




51   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
WebSocket API
     dev.w3.org/html5/websockets/




52   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
WebSocket SDK
     websocket-sdk.java.net

     •  Annotation Driven Model
              –  Allows you to turn POJOs into WebSocket Endpoints
              –  Support for Server Sent Events
              –  WebLogic 12.1.2 support
              –  Runs on GlassFish 4.0 Early Builds Now!
     •  WebSocket SDK and JSR-356
              –  Simplify the programming model for Java EE
              –  Integrated with Java EE Platform e.g. CDI


53   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
WebSocket Example

     import org.glassfish.websocket.api.annotations.WebSocketClose;

     import org.glassfish.websocket.api.annotations.WebSocket;

     import org.glassfish.websocket.api.annotations.WebSocketMessage;   !
     !
     @WebSocket(path=”/HelloWorld")

     public class HelloWorld{

         

         @WebSocketMessage

         public String sayHelloWorld(String caller) {

             return "hello " + caller + "!";

         }

           !
                 @WebSocketClose

                 public void goodbye() {

                     System.out.println(“Adios”);

                  }

     }!
https://blogs.oracle.com/arungupta/entry/websockets_and_java_ee_7
54   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Server-Sent Events
     •  Part of HTML5 Specification
     •  Server-push notifications
     •  Cross-browser JavaScript API: EventSource!
     •  Message callbacks
     •  MIME type: text/eventstream!




55   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
EventSource API
     dev.w3.org/html5/eventsource/




56   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Server-Sent Events Example
      Client-side


     var url = 'http://' + document.location.host + '/glassfish-sse/simple’;

     eventSource = new EventSource(url);!
     eventSource.onmessage = function (event) {

        var theParagraph = document.createElement('p');

        theParagraph.innerHTML = event.data.toString();

        document.body.appendChild(theParagraph);

     }!




     https://blogs.oracle.com/arungupta/entry/server_sent_events_using_glassfish
57     Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Server-Sent Events Example
      Server-side Handler


     @ServerSentEvent("/simple”)

     public class MySimpleHandler extends ServerSentEventHandler {!
      

        public void sendMessage(String data) {

           try {

              connection.sendMessage(data);

           } catch (IOException ex) {

              . . .

           }

        }

     }!


     https://blogs.oracle.com/arungupta/entry/server_sent_events_using_glassfish
58     Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Server-Sent Events Example
      Server-side Business Logic

     @Stateless!
     public class SimpleEvent {!
      !
        @Inject @ServerSentEventContext("/simple")!
        ServerSentEventHandlerContext<MySimpleHandler> simpleHandlers;!
      !
        @Schedule(hour="*", minute="*", second="*/10")!
        public void sendDate() {!
           for(MySimpleHandler handler : simpleHandlers.getHandlers()) {!
              handler.sendMessage(new Date().toString());!
           }!
        }!
     }!


     https://blogs.oracle.com/arungupta/entry/server_sent_events_using_glassfish
59     Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
SSE & WebSocket – competing technologies ?
     •  WebSocket can send/receive, SSE is server-push
     •  SSE are over HTTP, WebSocket require servers to
        understand the protocol
     •  SSE provides simple and easy-to-use for server-push,
        WebSocket is slightly complex and has overhead
     •  WebSocket provide real-time updates, SSE can be
        configured



60   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Project Avatar
     Complete Solution for Dynamic Rich Clients



HTML 5 browser


HTML & Java                                                                 JSON over
hybrid application                                                          WebSocket




Java application                                                                        Java EE Cloud

61   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
JPA-RS: Building Block of Project Avatar
     •  Exposes JPA mapped entities over REST via JAX-RS
     •  HTTP Methods
           –  GET, PUT, POST, DELETE!
     •  Content-Type and Accept-based content negotiation
           –  XML or JSON
     •  Client
           –  HTML5 with JavaScript (primary focus)
           –  JavaFX


62   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
JPA-RS: Current Programming Model
                                                                                        GET http://…/order/4

                                                                                JAX-RS

                                                          Customer               Product            Order



                                                                            Shop Persistence Unit


                                                                                  JPA



63   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
JPA-RS: Thin Server Architecture
                                                                                   GET http://…/<pu-name>/<entity>/4

                                                                            JPA-RS

                                                    Shop PU                               … PU




                                                                             JPA



64   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
JPA-RS: Building Block of Project Avatar
     Server-side Business Logic
     •  Persistence Unit Operations
           –  /<root-uri>/<pu-name>/entity!
           –  /<root-uri>/<pu-name>/query!
           –  /<root-uri>/<pu-name>/metadata!
     •  Supports invocation of @NamedQueries via HTTP
     •  Server-caching – EclipseLink clustered cache
     •  Dynamic Persistence also supported
           –  Entities defined via metadata – no Java classes required
           –  Enables persistence for HTML5/JavaScript apps

65   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
NoSQL Stores
     •  No standards
     •  Differing APIs and feature sets
     •  Some offer query language/API – some not




66   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
EclipseLink NoSQL
     •  Support JPA access to NoSQL databases
     •  Define annotations and XML to identify NoSQL stored
        entities (e.g., @NoSQL)
     •  Support JPQL subset for each
           –  Key principal: leverage what’s available
     •  Initial support for MongoDB and Oracle NoSQL.
     •  Support mixing relational and non-relational data in
        single composite persistence unit

67   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
GlassFish Roadmap
GlassFish v3                                                                        GlassFish Server 3.1               GlassFish Server 3.1.2
•  Java EE 6 support                                                                •  Centralized administration      •  Bug Fixes
•  Single instance                                                                  •  Clustering / HA                 •  Incremental features
•  GlassFish Enterprise Mgr                                                         •  GlassFish Server Control




 2009                                               2010                                           2011               2012                       2013


     GlassFish Server 3.0.1                                                                 GlassFish Server 3.1.1             GlassFish Server 4
     •  Oracle branding                                                                     •  Bug fixes                       •  Java EE 7
     •  Oracle platform support                                                             •  Updated components              •  Multitenancy
     •  Oracle interoperability                                                             •  Incremental features            •  PaaS-enablement




        68   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Call to Action

     •  Java EE 7 Expert Group Project
           – http://javaee-spec.java.net
     •  Java EE 7 Reference Implementation
           – http://glassfish.org
     •  The Aquarium
           –  http://blogs.oracle.com/theaquarium

69   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
70   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

More Related Content

PDF
Websocket 1.0
PDF
JAX-RS 2.0: RESTful Web services on steroids at Geecon 2012
PDF
JAX-RS 2.0: What’s New in JSR 339 ?
PDF
PaaSing a Java EE 6 Application at Geecon 2012
PDF
GlassFish REST Administration Backend at JavaOne India 2012
PDF
JAX-RS 2.0: New and Noteworthy in RESTful Web services API at JAX London
PDF
Java EE 7: Developing for the Cloud at Geecon, JEEConf, Johannesburg
PPTX
The Java EE 7 Platform: Developing for the Cloud
Websocket 1.0
JAX-RS 2.0: RESTful Web services on steroids at Geecon 2012
JAX-RS 2.0: What’s New in JSR 339 ?
PaaSing a Java EE 6 Application at Geecon 2012
GlassFish REST Administration Backend at JavaOne India 2012
JAX-RS 2.0: New and Noteworthy in RESTful Web services API at JAX London
Java EE 7: Developing for the Cloud at Geecon, JEEConf, Johannesburg
The Java EE 7 Platform: Developing for the Cloud

What's hot (19)

PDF
Java EE 7: Developing for the Cloud at Java Day, Istanbul, May 2012
PDF
JAX-RS 2.0: RESTful Web Services
PDF
Java Summit Chennai: JAX-RS 2.0
ODP
RESTing with JAX-RS
PDF
WebLogic 12c Developer Deep Dive at Oracle Develop India 2012
PDF
GlassFish REST Administration Backend
PDF
The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012
PDF
Java EE 7 - Overview and Status
PDF
Jfokus 2012: PaaSing a Java EE Application
PDF
Java Summit Chennai: Java EE 7
PDF
GIDS 2012: Java Message Service 2.0
PDF
GIDS 2012: PaaSing a Java EE Application
PDF
The Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUG
PPT
Have You Seen Java EE Lately?
PDF
TDC 2011: OSGi-enabled Java EE Application
PDF
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...
PDF
Java EE 7 overview
PPTX
JAX-RS 2.0: RESTful Web services on steroids
PDF
Running your Java EE 6 applications in the Cloud
Java EE 7: Developing for the Cloud at Java Day, Istanbul, May 2012
JAX-RS 2.0: RESTful Web Services
Java Summit Chennai: JAX-RS 2.0
RESTing with JAX-RS
WebLogic 12c Developer Deep Dive at Oracle Develop India 2012
GlassFish REST Administration Backend
The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012
Java EE 7 - Overview and Status
Jfokus 2012: PaaSing a Java EE Application
Java Summit Chennai: Java EE 7
GIDS 2012: Java Message Service 2.0
GIDS 2012: PaaSing a Java EE Application
The Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUG
Have You Seen Java EE Lately?
TDC 2011: OSGi-enabled Java EE Application
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...
Java EE 7 overview
JAX-RS 2.0: RESTful Web services on steroids
Running your Java EE 6 applications in the Cloud
Ad

Similar to Java EE 7 and HTML5: Developing for the Cloud (20)

PDF
Jfokus 2012 : The Java EE 7 Platform: Developing for the Cloud
PDF
Java EE Technical Keynote at JavaOne Latin America 2011
PDF
Java EE 7 at JAX London 2011 and JFall 2011
PDF
The Java EE 7 Platform: Developing for the Cloud
PDF
Java ee 7 platform developing for the cloud kshitiz saxena
PDF
Java EE7: Developing for the Cloud
PDF
Avoiding Java EE Application Design Traps to Achieve Effective Use of Cloud C...
KEY
JavaOne 2012 - BOF7955 ­ Avoiding Java EE Application Design Traps to Achieve...
PDF
JUG Darmstadt - Java EE 7 - Auf in die Wolken!
PDF
Java EE Technical Keynote - JavaOne India 2011
PDF
Java EE 7 - Into the Cloud
PDF
GlassFish in the Virtual World
PDF
V fabric overview
PPTX
SPEC INDIA Java Case Study
PPTX
vFabric - Ideal Platform for SaaS Apps
PDF
DevOps for Mobile - DevOpsDays, NY, 2013
PDF
Java one brazil_keynote_dochez
PDF
2011 04-dsi-javaee-in-the-cloud-andreadis
PDF
Keynote | Middleware Everywhere - Ready for Mobile and Cloud | Dr. Mark Little
PDF
Cloud Architectures for Alpha Dogs!
Jfokus 2012 : The Java EE 7 Platform: Developing for the Cloud
Java EE Technical Keynote at JavaOne Latin America 2011
Java EE 7 at JAX London 2011 and JFall 2011
The Java EE 7 Platform: Developing for the Cloud
Java ee 7 platform developing for the cloud kshitiz saxena
Java EE7: Developing for the Cloud
Avoiding Java EE Application Design Traps to Achieve Effective Use of Cloud C...
JavaOne 2012 - BOF7955 ­ Avoiding Java EE Application Design Traps to Achieve...
JUG Darmstadt - Java EE 7 - Auf in die Wolken!
Java EE Technical Keynote - JavaOne India 2011
Java EE 7 - Into the Cloud
GlassFish in the Virtual World
V fabric overview
SPEC INDIA Java Case Study
vFabric - Ideal Platform for SaaS Apps
DevOps for Mobile - DevOpsDays, NY, 2013
Java one brazil_keynote_dochez
2011 04-dsi-javaee-in-the-cloud-andreadis
Keynote | Middleware Everywhere - Ready for Mobile and Cloud | Dr. Mark Little
Cloud Architectures for Alpha Dogs!
Ad

More from Arun Gupta (20)

PDF
5 Skills To Force Multiply Technical Talents.pdf
PPTX
Machine Learning using Kubernetes - AI Conclave 2019
PDF
Machine Learning using Kubeflow and Kubernetes
PPTX
Secure and Fast microVM for Serverless Computing using Firecracker
PPTX
Building Java in the Open - j.Day at OSCON 2019
PPTX
Why Amazon Cares about Open Source
PDF
Machine learning using Kubernetes
PDF
Building Cloud Native Applications
PDF
Chaos Engineering with Kubernetes
PDF
How to be a mentor to bring more girls to STEAM
PDF
Java in a World of Containers - DockerCon 2018
PPTX
The Serverless Tidal Wave - SwampUP 2018 Keynote
PDF
Introduction to Amazon EKS - KubeCon 2018
PDF
Mastering Kubernetes on AWS - Tel Aviv Summit
PDF
Top 10 Technology Trends Changing Developer's Landscape
PDF
Container Landscape in 2017
PDF
Java EE and NoSQL using JBoss EAP 7 and OpenShift
PDF
Docker, Kubernetes, and Mesos recipes for Java developers
PDF
Thanks Managers!
PDF
Migrate your traditional VM-based Clusters to Containers
5 Skills To Force Multiply Technical Talents.pdf
Machine Learning using Kubernetes - AI Conclave 2019
Machine Learning using Kubeflow and Kubernetes
Secure and Fast microVM for Serverless Computing using Firecracker
Building Java in the Open - j.Day at OSCON 2019
Why Amazon Cares about Open Source
Machine learning using Kubernetes
Building Cloud Native Applications
Chaos Engineering with Kubernetes
How to be a mentor to bring more girls to STEAM
Java in a World of Containers - DockerCon 2018
The Serverless Tidal Wave - SwampUP 2018 Keynote
Introduction to Amazon EKS - KubeCon 2018
Mastering Kubernetes on AWS - Tel Aviv Summit
Top 10 Technology Trends Changing Developer's Landscape
Container Landscape in 2017
Java EE and NoSQL using JBoss EAP 7 and OpenShift
Docker, Kubernetes, and Mesos recipes for Java developers
Thanks Managers!
Migrate your traditional VM-based Clusters to Containers

Recently uploaded (20)

PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Electronic commerce courselecture one. Pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
Big Data Technologies - Introduction.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Machine learning based COVID-19 study performance prediction
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
20250228 LYD VKU AI Blended-Learning.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Electronic commerce courselecture one. Pdf
Digital-Transformation-Roadmap-for-Companies.pptx
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Big Data Technologies - Introduction.pptx
Encapsulation_ Review paper, used for researhc scholars
Chapter 3 Spatial Domain Image Processing.pdf
Machine learning based COVID-19 study performance prediction
Reach Out and Touch Someone: Haptics and Empathic Computing
Mobile App Security Testing_ A Comprehensive Guide.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Unlocking AI with Model Context Protocol (MCP)
sap open course for s4hana steps from ECC to s4
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...

Java EE 7 and HTML5: Developing for the Cloud

  • 1. Main sponsor Java  EE  7  and  HTML5:  Developing  for  the  Cloud   Arun  Gupta,  Java  EE  &  GlassFish  Guy   blogs.oracle.com/arungupta,  @arungupta  
  • 2. 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. 2 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 3. Java EE 6 Platform December 10, 2009 3 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 4. Java EE 6 – Key Statistics •  40+ Million Java EE 6 Component Downloads •  #1 Choice for Enterprise Developers •  #1 Application Development Platform •  Fastest implementation of a Java EE release 4 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 5. Top Ten Features in Java EE 6 1.  EJB packaging in a WAR 2.  Servlet and CDI extension points 3.  Optional web.xml! 4.  Type-safe dependency injection 5.  CDI Events 6.  JSF standardizing on Facelets 7.  EJBContainer API 8.  @Schedule! 9.  EJB No Interface View 10. Web Profile 5 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 6. Today’s Cloud Offerings are all Proprietary Infrastructure as Platform as Software as a Service a Service a Service 6 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 7. Java EE 7 7 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 8. Java EE 7 and 8 – Focus Areas Cloud Modularity HTML5 •  Provisioning •  Building on Jigsaw •  Emerging Web Standards require a •  Elastic & Autonomic •  Focus on OSGi interop programming model Scalability •  Supporting Profiles & •  JSON, WebSockets, •  Multi-Tenancy Modular Applications off-line, APIs & DOM 8 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 9. Java EE 7 Focus: Platform as a Service •  Next logical step for Java EE –  J2EE à Java EE 6 : The Java EE Platform provides services –  Java EE 7 : The Java EE Platform IS a service •  PaaS support entails evolutionary change •  Basic form of SaaS •  Provide way for customers and users to leverage public, private, and hybrid clouds 9 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 10. Roles Developer PaaS Provider PaaS Customer/ JVM JVM JVM JVM JVM JVM JVM JVM JVM Tenant Machine Machine Machine PaaS Product Provider JVM JVM JVM JVM JVM JVM JVM JVM JVM Deployer Machine Machine Machine PaaS Account Tenant 1 Tenant 2 Tenant 3 Manager Application Submitter PaaS Administrator Application Administrator 10 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 11. Existing Java EE model Database 1 Provision and Initialize Service •  Configure Java EE resources – JDBC, JMS etc LDAP 2 Service •  Deploy Application EAR Provision and Initialize Messaging 3 Provision and Initialize Service Application 4 Provision and Initialize Container 5 Deploy Application (EAR/ GAR/SAR …) 11 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 12. Java EE 7 Model: Auto-Provision Services from Application Dependencies Cloud Administration •  Provision and deploy application 1 Provision and Initialize Service resources (e.g. LDAP stripe, data source instantiation and Database 2 Service connection …) Provision and Initialize •  Extensible Deployment Models LDAP Supporting Multiple Frameworks 3 Provision and Initialize Service •  Spring, Seam, Play … Messaging 4 Provision and Initialize Service Application 5 Deploy Application (EAR/ GAR/SAR …) Container 12 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 13. Services •  Cloud apps consume services –  Persistence, queueing, mail, caching, … •  Service metadata facilitates ease of use when deploying into the cloud @DataSourceDefinition(! name=“java:app/jdbc/myDB”,! className=“oracle.jdbc.pool.OracleDataSource”,! isolationLevel=TRANSACTION_REPEATABLE_READ,! initialPoolSize=5! ) ! 13 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 14. Services •  Cloud apps consume services –  Persistence, queueing, mail, caching, … •  Service metadata facilitates ease of use when deploying into the cloud @JMSConnectionFactoryDefinition(
 name=“java:app/myJMSConnectionFactory”, className=“javax.jms.QueueConnectionFactory”
 resourceAdapterName=“myJMSRA”) ! ! @JMSDestinationDefinition(
 name=“java:app/myQueue”,
 className=“javax.jms.Queue”
 destinationName=“myQueue1”)! 14 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 15. Services •  Cloud apps consume services –  Persistence, queueing, mail, caching, … •  Service metadata facilitates ease of use when deploying into the cloud @MailSessionDefinition(! name=“java:app/mailSession”,
 host=“example.com”
 from=“MyService@example.com”! ) ! 15 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 16. Services •  Cloud apps consume services –  Persistence, queueing, mail, caching, … •  Service metadata facilitates ease of use when deploying into the cloud @ConnectorResourceDefinition(! name=“java:app/myCustomConnector”,! className=“com.extraServices.CustomConnector.class”,! properties= {…}! ) ! 16 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 17. Elasticity Java EE 7 Focus: Move the Bar Right Elasticity Continuum Java EE Cluster Elastic Cluster Elastic Cluster Capacity Ca on Demand Single node Java EE Multi-Node Dynamic Self Adjusting Non-Elastic Multi-Instance Clustering SLA Driven Elasticity •  Service Levels •  Minimum and Maximum Instances •  Futures – Self Adjustment, Capacity On Demand 17 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 18. Demo PaaSing a Java EE Application in the Cloud glassfish.org/javaone2011 18 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 19. Conference Planning in the Cloud Java EE Application JSF JPA Deploy Services EJB Metadata <glassfish-services>
 <service-description init-type="LB" name="ConferencePlanner-lb">
 <template id="LBNative"/>
 <configurations>
 <configuration name="https-port" value="50443"/>
 <configuration name="ssl-enabled" value="false"/>
 <configuration name="http-port" value="50080"/>
 </configurations></service-description>
 <service-description init-type="JavaEE" name="ConferencePlanner">
 <characteristics>
 <characteristic name="service-type" value="JavaEE"/>
 </characteristics>
 <configurations>
 <configuration name="max.clustersize" value="4"/>
 <configuration name="min.clustersize" value="2"/>
 </configurations>
 </service-description>! . . .
 </glassfish-services>! 19 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 20. Service Provisioning Load Balancer Java EE Java EE ... Java EE Database 20 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 21. Multi-tenancy in Java EE 7 •  Support for separate isolated instances of the same app for different tenants –  One application instance per tenant –  Tenants correspond to units of isolation –  Multitenant apps are declared as such –  Each instance customized and deployed for a single tenant –  Limited form of SaaS •  Mapping to tenant done by the container •  Tenant id available to application –  E.g., under java:comp/tenantId! 21 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 22. Java EE 7 – Candidate JSRs Web JAX-RS JSF 2.2 Jcache 1.0 Container EL 3.0 (JSR 107) CDI Extensions 2.0 JSP 2.2 Extensions Bean Validation 1.1 Concurrency Servlet 3.1 Utilities 1.0 (JSR 236) State CDI 1.1 / Interceptors 1.1 / JSR 250 1.1 Management 1.0 (JSR 350) Batch Managed Beans 1.0 EJB 3.2 Processing 1.0 (JSR 352) JSON 1.0 JPA 2.1 JTA 1.1 JMS 2.0 (JSR 353) 22 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 23. Java EE 7 Early Draft •  Requires Java SE 7 •  Added new roles •  Resource definition metadata –  DataSourceDefinition, JMSConnectionFactoryDefinition, JMSDestinationDefinition, MailSessionDefinition, ConnectorResourceDefinition! –  Pre-provisioned or shared resource 23 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 24. Java EE 7 Early Draft •  Default Data Source java:comp/defaultDataSource! •  Default JMS Connection Factory java:comp/ defaultJMSConnectionFactory! •  Tenant Identifier: java:comp/tenantId! •  Made optional –  EJB Entity Beans, EJB QL, JAX-RPC, Deployment API, JAXR 24 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 25. Java Persistence API 2.1 •  @NamedStoredProcedureQuery, StoredProcedureQuery! •  Bulk update/delete using Criteria! •  User-defined functions using FUNCTION! •  Persistence Context Synchronization 25 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 26. JPA 2.1 Stored Procedures @Entity
 •  Stored Procedures @NamedStoredProcedureQuery(name="topGiftsStoredProcedure", 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);! // there are other setParameter methods for defining the temporal type
 . . .! query.execute();! String response = query.getOutputParameterValue(1);! ! 26 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 27. JPA 2.1 Criteria Update/Delete CriteriaUpdate<Customer> q = cb.createCriteriaUpdate(Customer.class); 
 •  Update/Delete using Criteria Root<Customer> c = q.from(Customer.class); 
 q.set(c.get(Customer_.status), "outstanding")
  .where(cb.lt(c.get(Customer_.balance), 10000));
 . . .! @PersistenceContext EntityManager em;
 UPDATE Customer c! Query query = em.createQuery(q);
 SET c.status = 'outstanding'! query.executeUpdate();
 WHERE c.balance < 10000! 
 ! CriteriaDelete<Customer> q = cb.createCriteriaDelete(Customer.class); 
 Root<Customer> c = q.from(Customer.class); 
 q.where(cb.equal(c.get(Customer_.status), "inactive"),
         cb.isEmpty(c.get(Customer_.orders)));
 . . .! @PersistenceContext EntityManager em;
 DELETE FROM Customer c
 Query query = em.createQuery(q);
 WHERE c.status = 'inactive'
 query.executeUpdate();
 AND c.orders IS EMPTY! 
 27 !Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 28. JAX-RS 2.0 Client-side API •  Client-side API URL url = new URL("http://.../atm/balance");
 HttpURLConnection conn = (HttpURLConnection) url.openConnection();
 conn.setRequestMethod("GET");
 conn.setDoInput(true);
 conn.setDoOutput(false);
             
 BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()));
 String line;
 while ((line = br.readLine()) != null) {
     out.println(line);
 }! Client client = ClientFactory.newClient();! String balance = client.target("http://.../atm/balance")! .request("text/plain")! .get(String.class);! 28 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 29. JAX-RS 2.0 Filters and Interceptors @Provider
 class LoggingFilter implements RequestFilter, ResponseFilter {!     @Override
     public FilterAction preFilter(FilterContext ctx) throws IOException {
         logRequest(ctx.getRequest());
         return FilterAction.NEXT;
     }
 !     @Override
     public FilterAction postFilter(FilterContext ctx) throws IOException {
         logResponse(ctx.getResponse());
         return FilterAction.NEXT;
     }
 }! 29 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 30. JAX-RS 2.0 Client-side Async •  Client-side Async Client client = ClientFactory.newClient();
 Future<String> future = client.target("http://.../atm/{card}/balance")
                               .pathParam("card", "1111222233334444")
                               .queryParam("pin", "1234")
                               .request("text/plain")
                               .async()
                               .get(
 new InvocationCallback<String>() {
 public void completed(String result) {
 }
 
 public void failed(InvocationException e) {
 }
 }
 );! 30 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 31. JAX-RS 2.0 Bean Validation Integration •  Integration with Bean Validation @Path("/")
 class ProductResource {!     @POST
     @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
     public void addProduct(@NotNull 
 @FormParam("productName") String name,
                            @NotNull 
 @Category 
 @FormParam("category") String category) {
         . . .
     }
 }! 31 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 32. JAX-RS 2.0 Server-side content negotiation @Path("/")
 •  Server-side Content Negotiation class ProductResource {!     @GET
     @Produces({ "text/xml;qs=0.75", "application/json"})
     public Product[] getProducts() {
         . . .
     }
 }! 32 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 33. JavaServer Faces 2.2 •  Integration with HTML5 forms •  Queue control for Ajax requests •  File Upload component (Non-Ajax & Ajax) •  Injection in all JSF artifacts – including converters & validators •  @FaceletsResourceResolver! •  Instantiating composite components in Java •  . . . 33 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 34. Contexts & Dependency Injection 1.1 •  Embedded mode to startup outside Java EE container •  Global ordering of interceptors and decorators •  API for managing built-in contexts •  Send Servlet events as CDI events •  . . . 34 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 35. Bean Validation 1.1 •  Code Sample @MethodValidated
 public class OrderService { 
 public OrderService(@NotNull CreditCardProcessor creditCardProcessor) { . . . }
 
 public void placeOrder(
 @NotNull 
 @Size(min=3, max=20) String customerCode, 
 @NotNull @Valid Item item, 
 @Min(1) int quantity) { . . . }
 
 @NotNull @Size(min=1)
 public Set<CreditCardProcessor> getCreditCardProcessors() { ... }
 
 @NotNull @Future
 public Date getNextAvailableDeliveryDate() { ... } ! } ! 35 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 36. Java Message Service 2.0 •  Simplified API –  Less verbose –  Reduce the number of objects needed to send/receive message –  Allow resource injection –  Alternative, not replacement, for standard API –  Remove JMSException, where possible •  Connection, Session and other objects are AutoCloseable •  New methods – no need for redundant arguments 36 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 37. JMS 1.1 – Sending a Message (Java EE) Standard API @Resource(lookup = "jms/connectionFactory ")
 ConnectionFactory connectionFactory; 
 
 @Resource(lookup="jms/inboundQueue") 
 Queue inboundQueue; 
 
 public void sendMessageOld (String payload) throws JMSException { 
 try (Connection connection = connectionFactory.createConnection()) { 
 Session session = connection.createSession(); 
 MessageProducer messageProducer = session.createProducer(inboundQueue); 
 TextMessage textMessage = session.createTextMessage(payload);
 messageProducer.send(textMessage); 
 } ! } ! 37 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 38. JMS 2.0 – Sending a Message (Java EE) New Simplified API @Resource(mappedName="jms/contextFactory") ! ConnectionFactory connectionFactory;! ! @Resource(mappedName="jms/inboundQueue") ! Queue inboundQueue;! ! public void sendMessage(String payload) {! try (JMSContext context = connectionFactory.createContext();){! context.send(inboundQueue,payload);! }! }! 38 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 39. JMS 2.0 – Sending a Message (Java EE) New Simplified API (with Injection) @Inject! @JMSConnectionFactory("jms/contextFactory") ! JMSContext context;! ! @Resource(mappedName="jms/inboundQueue") ! Queue inboundQueue;! ! public void sendMessage(String payload) {! context.send(inboundQueue,payload);! }! 39 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 40. JSON 1.0 (JSR 353) javax.json.* •  Object model API to represent JSON –  Similar to DOM API in XML world •  Streaming API to produce/consume JSON –  Similar to StAX API in XML world JSR Supporters –  fasterxml.com (Jackson) –  Doug Crockford (json.org) •  Spec: json-processing-spec.java.net •  Reference Implementation: jsonp.java.net 40 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 41. JSON 1.0 (JSR 353) •  DOM-based APIs (javax.json.* package) –  JSONBuilder – Builds a JSON object –  JSONReader – Reads a JSON object or array from the stream –  JSONWriter – Writes a JSON object or array to the stream •  Streaming APIs (javax.json.stream.* package) –  JsonGenerator – Streaming JSON generator –  JsonParser – Allows forward, read-only access to JSON 41 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 42. JSON 1.0 (JSR 353) Code Sample - JsonBuilder JsonObject value = new JsonBuilder()
 {   .beginObject()
          "firstName":  "John",     .add("firstName", "John") 
          "lastName":  "Smith",     .add("lastName", "Smith") 
          "age":  25,   add("age", 25)
          "address"  :  {   .beginObject("address”)
 .add("streetAddress", "21 2nd Street”)
                  "streetAddress",  "21  2nd  Street",   .add("city", "New York”)
                  "city",  "New  York",   .add("state", "NY”)
                  "state",  "NY",   .add("postalCode”, "10021”)
                  "postalCode",  "10021"   .endObject()
            },   .beginArray("phoneNumber")
 .beginObject() 
            "phoneNumber":  [   .add("type", "home") 
                    {  "type":  "home",     .add("number", "212 555-1234") 
                        "number":  "212  555-­‐1234"  },   .endObject() 
                    {  "type":  "fax",     .beginObject() 
                        "number":  "646  555-­‐4567"  }   .add("type", "home") 
 .add("number", "646 555-4567") 
            ]   .endObject() 
  }   .endArray() 
 .endObject() 
 .build(); ! 42 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 43. JSON 1.0 (JSR 353) Code Sample – JsonReader, JsonWriter String json = "...";
 JsonReader reader = new JsonReader(new StringReader(json));
 JsonValue value = reader.readObject();
 reader.close(); ! JsonWriter jsonWriter = new JsonWriter(new FileWriter(...));
 JsonObject jsonObject = new JsonBuilder()
 .beginObject()
 . . .
 .endObject()
 .build();! jsonWriter.writeObject(jsonObject);
 jsonWriter.close(); ! 43 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 44. JSON 1.0 (JSR 353) Code Sample – JsonGenerator, JsonParser JsonGenerator generator = new JsonGenerator(new FileWriter(...));
 generator
 .beginObject()
 . . .
 .beginArray()
 . . .
 .endArray()
 .endObject()
 .build();
 START_OBJECT! generator.close(); ! END_OBJECT! START_ARRAY! END_ARRAY! String json = "..."; 
 KEY_NAME! JsonParser parser = new JsonParser(new StringReader(json));
 VALUE_xxx! Iterator<Event> it = reader.iterator();
 Event event = it.next(); ! 44 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 45. Transparency •  Oracle’s Java EE 7 JSRs are run in the open on java.net –  http://javaee-spec.java.net –  One project per spec – e.g., jpa-spec, jax-rs-spec, jms-spec… •  Publicly viewable Expert Group mail archive –  Users observer list gets copies of all Expert Group emails •  Publicly viewable download area •  Publicly viewable issue tracker •  Commitment to update to JCP 2.8 Process 45 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 46. Status and Schedule •  All JSRs up and running •  Early Drafts –  Java EE 7 Platform, JSF 2.2, JAX-RS 2.0, JPA 2.1, CDI 1.1, EJB 3.2, JMS 2.0, Bean Validation 1.1, Expression Language 3.0 •  Final release target: Q2 2013 46 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 47. HTML 5 is Disruptive •  HTML 5 is the new UI across devices –  Offline, Real-time Communication, File access, Semantic markup, Multimedia, CSS3 •  HTML 5 Requires New Programming Model •  Servers no longer generating markup language •  Event Driven •  JavaScript is part of the domain model •  JSON is the payload, not just HTML 47 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 48. Java EE: Investments for HTML5 •  WebSocket and Server Sent Events Infrastructure •  WebSocket SDK and JSR-356 –  Simplify the programming model for Java EE 48 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 49. WebSocket •  Part of HTML5 Specification •  Bi-directional •  Full-duplex •  Over a single TCP connection •  Examples –  Real-time online games –  Collaborative platforms –  Social Networking 49 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 50. WebSocket Protocol – Handshake tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-17 GET /mychat HTTP/1.1! Host: server.example.com! Request Upgrade: websocket! Connection: Upgrade! Sec-WebSocket-Key: x3JJHMbDL1EzLkh9GBhXDw==! Sec-WebSocket-Protocol: chat, superchat! Sec-WebSocket-Version: 13! Origin: http://example.com
 <EMPTY LINE>! ! HTTP/1.1 101 Switching Protocols! Upgrade: websocket! Response Connection: Upgrade! Sec-WebSocket-Accept: HSmrc0sMlYUkAGmm5OPpG2HaGWk=! Sec-WebSocket-Protocol: chat
 <EMPTY LINE>! 50 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 51. WebSocket Protocol – Framing tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-17 •  Wire format of messages •  Design Philosophy – Minimum framing required •  Data Frames –  Text & Binary •  Blob, ArrayBuffer •  Control Frames –  Protocol-level signaling 51 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 52. WebSocket API dev.w3.org/html5/websockets/ 52 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 53. WebSocket SDK websocket-sdk.java.net •  Annotation Driven Model –  Allows you to turn POJOs into WebSocket Endpoints –  Support for Server Sent Events –  WebLogic 12.1.2 support –  Runs on GlassFish 4.0 Early Builds Now! •  WebSocket SDK and JSR-356 –  Simplify the programming model for Java EE –  Integrated with Java EE Platform e.g. CDI 53 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 54. WebSocket Example import org.glassfish.websocket.api.annotations.WebSocketClose;
 import org.glassfish.websocket.api.annotations.WebSocket;
 import org.glassfish.websocket.api.annotations.WebSocketMessage;   ! ! @WebSocket(path=”/HelloWorld")
 public class HelloWorld{
     
     @WebSocketMessage
     public String sayHelloWorld(String caller) {
         return "hello " + caller + "!";
     }
 ! @WebSocketClose
 public void goodbye() {
 System.out.println(“Adios”);
 }
 }! https://blogs.oracle.com/arungupta/entry/websockets_and_java_ee_7 54 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 55. Server-Sent Events •  Part of HTML5 Specification •  Server-push notifications •  Cross-browser JavaScript API: EventSource! •  Message callbacks •  MIME type: text/eventstream! 55 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 56. EventSource API dev.w3.org/html5/eventsource/ 56 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 57. Server-Sent Events Example Client-side var url = 'http://' + document.location.host + '/glassfish-sse/simple’;
 eventSource = new EventSource(url);! eventSource.onmessage = function (event) {
 var theParagraph = document.createElement('p');
 theParagraph.innerHTML = event.data.toString();
 document.body.appendChild(theParagraph);
 }! https://blogs.oracle.com/arungupta/entry/server_sent_events_using_glassfish 57 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 58. Server-Sent Events Example Server-side Handler @ServerSentEvent("/simple”)
 public class MySimpleHandler extends ServerSentEventHandler {! 
 public void sendMessage(String data) {
 try {
 connection.sendMessage(data);
 } catch (IOException ex) {
 . . .
 }
 }
 }! https://blogs.oracle.com/arungupta/entry/server_sent_events_using_glassfish 58 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 59. Server-Sent Events Example Server-side Business Logic @Stateless! public class SimpleEvent {! ! @Inject @ServerSentEventContext("/simple")! ServerSentEventHandlerContext<MySimpleHandler> simpleHandlers;! ! @Schedule(hour="*", minute="*", second="*/10")! public void sendDate() {! for(MySimpleHandler handler : simpleHandlers.getHandlers()) {! handler.sendMessage(new Date().toString());! }! }! }! https://blogs.oracle.com/arungupta/entry/server_sent_events_using_glassfish 59 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 60. SSE & WebSocket – competing technologies ? •  WebSocket can send/receive, SSE is server-push •  SSE are over HTTP, WebSocket require servers to understand the protocol •  SSE provides simple and easy-to-use for server-push, WebSocket is slightly complex and has overhead •  WebSocket provide real-time updates, SSE can be configured 60 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 61. Project Avatar Complete Solution for Dynamic Rich Clients HTML 5 browser HTML & Java JSON over hybrid application WebSocket Java application Java EE Cloud 61 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 62. JPA-RS: Building Block of Project Avatar •  Exposes JPA mapped entities over REST via JAX-RS •  HTTP Methods –  GET, PUT, POST, DELETE! •  Content-Type and Accept-based content negotiation –  XML or JSON •  Client –  HTML5 with JavaScript (primary focus) –  JavaFX 62 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 63. JPA-RS: Current Programming Model GET http://…/order/4 JAX-RS Customer Product Order Shop Persistence Unit JPA 63 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 64. JPA-RS: Thin Server Architecture GET http://…/<pu-name>/<entity>/4 JPA-RS Shop PU … PU JPA 64 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 65. JPA-RS: Building Block of Project Avatar Server-side Business Logic •  Persistence Unit Operations –  /<root-uri>/<pu-name>/entity! –  /<root-uri>/<pu-name>/query! –  /<root-uri>/<pu-name>/metadata! •  Supports invocation of @NamedQueries via HTTP •  Server-caching – EclipseLink clustered cache •  Dynamic Persistence also supported –  Entities defined via metadata – no Java classes required –  Enables persistence for HTML5/JavaScript apps 65 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 66. NoSQL Stores •  No standards •  Differing APIs and feature sets •  Some offer query language/API – some not 66 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 67. EclipseLink NoSQL •  Support JPA access to NoSQL databases •  Define annotations and XML to identify NoSQL stored entities (e.g., @NoSQL) •  Support JPQL subset for each –  Key principal: leverage what’s available •  Initial support for MongoDB and Oracle NoSQL. •  Support mixing relational and non-relational data in single composite persistence unit 67 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 68. GlassFish Roadmap GlassFish v3 GlassFish Server 3.1 GlassFish Server 3.1.2 •  Java EE 6 support •  Centralized administration •  Bug Fixes •  Single instance •  Clustering / HA •  Incremental features •  GlassFish Enterprise Mgr •  GlassFish Server Control 2009 2010 2011 2012 2013 GlassFish Server 3.0.1 GlassFish Server 3.1.1 GlassFish Server 4 •  Oracle branding •  Bug fixes •  Java EE 7 •  Oracle platform support •  Updated components •  Multitenancy •  Oracle interoperability •  Incremental features •  PaaS-enablement 68 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 69. Call to Action •  Java EE 7 Expert Group Project – http://javaee-spec.java.net •  Java EE 7 Reference Implementation – http://glassfish.org •  The Aquarium –  http://blogs.oracle.com/theaquarium 69 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 70. 70 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.