SlideShare a Scribd company logo
1 of 79
Download to read offline
Main sponsor




The	
  Java	
  EE	
  7	
  Pla,orm:	
  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.
Resource/Service Metadata
     •  Which service ?
           –  Application require an instance, not a particular one
           –  Application require a particular instance, with specific properties
     •  Services scoped to application, or shareable
     •  Quality-of-service attributes such as pool size, elasticity
     •  Usecases
           –      Need only SQL and JTA transactions; use PaaS platform defaults
           –      Needs Oracle database, initial/minimum/maximum poolsize, JNDI name
           –      Pre-provisioned MySQL, JNDI name, host/port
           –      Apps sharing JMS queues by referring to global JNDI name


17   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
 18   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Example Scenario

     “A software company writes an application, submits it to a
       PaaS provider, then any number of tenants sign up for the
       application, deploy it, their end users access it”




19   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Walkthrough (1)
                   SimplyCRM	
                                              DiabloCloud	
  




20   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Walkthrough (2)
                   SimplyCRM	
                                              DiabloCloud	
  


                   ApplicaDon	
  
                   Developer	
  


                                    Writes


                        App




21   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Walkthrough (3)
                   SimplyCRM	
                                                                             DiabloCloud	
  

                                                                            Signs up as a customer
               PaaS	
  Customer	
                                                                    PaaS	
  Account	
  Manager	
  




22   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Walkthrough (4)
                   SimplyCRM	
                                                                             DiabloCloud	
  

                                                                            Submits the application
                  Application                                                                         System	
  Administrator	
  
                  Submitter



                                                                                                                 App




23   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Walkthrough (5)
                 ExtraServices	
                                                          DiabloCloud	
  

                                                                            Discovers
                                                                                        App




24   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Walkthrough (6)
                 ExtraServices	
                                                                           DiabloCloud	
  

                                                                            Signs up as a customer
               PaaS	
  Customer	
                                                                    PaaS	
  Account	
  Manager	
  



                                                                                                       App




25   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Walkthrough (7)
                 ExtraServices	
                                                                           DiabloCloud	
  


                    Deployer	
                                                                        System	
  Administrator	
  
                                                                            Customizes and
                                                                            deploys the application



                                                                                                             App




26   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Walkthrough (8)
                 ExtraServices	
                                                   DiabloCloud	
  


                    Deployer	
                                                System	
  Administrator	
  



                                                                            Provisions on
                                                                                Cloud
                                                                            infrastructure

                                                                                          App




27   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Walkthrough (9)
                 ExtraServices	
                                                 DiabloCloud	
  


                    Deployer	
                                              System	
  Administrator	
  




                                                                              Provisioned and
                                                                               Deployed App




28   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Walkthrough (10)
                 ExtraServices	
                                                                       DiabloCloud	
  




                                                                            Access the application
                      End-­‐Users	
                                                                  Provisioned and
                                                                                                      Deployed App




29   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Walkthrough (11)
                 ExtraServices	
                                                                            DiabloCloud	
  




                      End-­‐Users	
                                         Access the application


                                                                                                          Provisioned and
                                                                                                           Deployed App

                  Administrator	
                                           Administers the application




30   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Walkthrough (12)
                 ExtraServices	
                                                                               DiabloCloud	
  


                                                                                                          System	
  Administrator	
  




                                                                                                                            Monitors

                      End-­‐Users	
                                         Access the application


                                                                                                            Provisioned and
                                                                                                             Deployed App

                  Administrator	
                                           Administers the application




31   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Demo
     PaaSing a Java EE Application in the Cloud




     glassfish.org/javaone2011


32   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>!



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

                                                                              Load
                                                                             Balancer



                                                 Java EE                    Java EE    ...   Java EE


                                                                            Database



34   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!

35   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Java EE 7 Is Not Just Cloud-y
     •  Alignment of ManagedBeans across CDI, EJB, JSF, …
           –  POJO à ManagedBean à Enterprise JavaBean
           –  Extension of container-managed transactions beyond EJB

     •  Further simplifications for ease-of-development
           –      JAX-RS 2.0 Client API, hypermedia, bean validation, …
           –      JMS 2.0 focus on ease-of-development
           –      Expanded use of dependency injection
           –      Expanded service metadata; improved configuration

     •  Pruning
           –  EJB CMP and BMP, JAX-RPC, Deployment API
     •  Update to Web Profile

36   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)



37   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


38   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




39   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




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

     @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);!
     !

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

     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!
         

42
         !Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Java API for RESTful Web Services 2.0

     •  Client-side API
     •  Filters and Entity Interceptors
     •  Client-side and Server-side Async
     •  Validation
     •  Server-side content negotiation (qs)
     •  Hypermedia
     •  Alignment with CDI

43   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
JAX-RS 2.0
     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);!


44   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;

         }

     }!


45   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
JAX-RS 2.0
         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) {

                                                                                           }

                                                                                      }

                                                                                );!

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

     class ProductResource {

         @Context ExecutionContext ctx;

     #
         @GET

         @Suspend

         public Product longOp() {

             Executors.newSingleThreadExecutor().submit(

                 new Runnable() {

                     public void run() {

                         Proruct product = longQueryFromDatabase();

                         ctx.resume(product);

                     }

                 }

             );

         }

     }!



47   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
JAX-RS 2.0
     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) {

             . . .

         }

     }!




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

     class ProductResource {!
         @GET

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

         public Product[] getProducts() {

             . . .

         }

     }!




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

     •  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
     •  . . .

50   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
     •  . . .




51   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Enterprise JavaBeans 3.2

     •  Three-part specification
           –  Core CMT transactions on Managed Beans, Non-persistent timer
              and Async method to Lite
           –  Optional CMP, BMP, Entity Beans, EJB QL, JAX-RPC Web
              service endpoint
           –  Interceptors




52   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
Enterprise JavaBeans 3.2
     Under discussion
     •  Alignment with JMS 2.0
     •  QoS – @MaxConcurrency, @Poolsize!
     •  Non persistent timers and Async invocations in EJB.Lite
     •  Support for CMT in ManagedBeans
           –  Subset of transaction attributes
           –  BMT are already supported using UserTransaction!




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

     •  Open: Spec, Reference Implementation, TCK
     •  Alignment with Dependency Injection
     •  Method-level validation
           –  Constraints on parameters and return values
           –  Check pre-/post-conditions




54   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() { ... } !
     } !



55   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
56   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
JMS 1.1
     Sending messages in Java EE
     @Resource(lookup = "jms/connFactory")

     ConnectionFactory cf; !
     @Resource(lookup="jms/inboundQueue")!
     Destination dest;!
      !
     public void sendMessage (String payload) throws JMSException {!
        Connection conn = cf.createConnection();

        Session sess =       !
           conn.createSession(false,Session.AUTO_ACKNOWLEDGE);

        MessageProducer producer = sess.createProducer(dest);

        TextMessage textMessage = sess.createTextMessage(payload);

        messageProducer.send(textMessage); 

        connection.close();

     }!




57   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
JMS 2.0
     Sending messages in Java EE
     @Resource(lookup = "jms/connFactory")
                                 Need to create
     ConnectionFactory cf; !                                                intermediate objects
     @Resource(lookup="jms/inboundQueue")!                                  just to satisfy the API
     Destination dest;!
      !
     public void sendMessage (String payload) throws JMSException {!
        Connection conn = cf.createConnection();

        Session sess =       !
           conn.createSession(false,Session.AUTO_ACKNOWLEDGE);

        MessageProducer producer = sess.createProducer(dest);

        TextMessage textMessage = sess.createTextMessage(payload);

        messageProducer.send(textMessage); 

        connection.close();

     }!




58   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
JMS 2.0
     Sending messages in Java EE
      @Resource(lookup = "jms/connFactory")

      ConnectionFactory cf; !
      @Resource(lookup="jms/inboundQueue")!                          Redundant
      Destination dest;!                                             arguments
       !
      public void sendMessage (String payload) throws JMSException {!
         Connection conn = cf.createConnection();

         Session sess =       !
            conn.createSession(false,Session.AUTO_ACKNOWLEDGE);

         MessageProducer producer = sess.createProducer(dest);

         TextMessage textMessage = sess.createTextMessage(payload);

         messageProducer.send(textMessage); 

         connection.close();

      }!




59   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
JMS 2.0
     Sending messages in Java EE
     @Resource(lookup = "jms/connFactory")

     ConnectionFactory cf; !
     @Resource(lookup="jms/inboundQueue")!
     Destination dest;!                                             Boilerplate code
      !
     public void sendMessage (String payload) throws JMSException {!
        Connection conn = cf.createConnection();

        Session sess =       !
           conn.createSession(false,Session.AUTO_ACKNOWLEDGE);

        MessageProducer producer = sess.createProducer(dest);

        TextMessage textMessage = sess.createTextMessage(payload);

        messageProducer.send(textMessage); 

        connection.close();

     }!




60   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
JMS 2.0
     Sending messages in Java EE
     public void sendMessage (String payload) throws JMSException {!
        try {!
           Connection conn = null;!
           con = cf.createConnection();

           Session sess =      !
               conn.createSession(false,Session.AUTO_ACKNOWLEDGE);

           MessageProducer producer = sess.createProducer(dest);

           TextMessage textMessage=sess.createTextMessage(payload);

           messageProducer.send(textMessage); !
        } finally {

           connection.close();!
        }

     }!
                                                                            Need to close
                                                                            connections
                                                                            after use


61   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
JMS 2.0
     Sending messages in Java EE
     public void sendMessage (String payload) {!
        Connection conn = null;!
        try {!
           con = cf.createConnection();

           Session sess =      !
               conn.createSession(false,Session.AUTO_ACKNOWLEDGE);

           MessageProducer producer = sess.createProducer(dest);

           TextMessage textMessage=sess.createTextMessage(payload);

           messageProducer.send(textMessage); !
        } catch (JMSException e1) {!
           // do something!
        } finally {!                                                 And there's
           try {
                                                    always exception
               if (conn!=null) connection.close();!                  handling to add
           } catch (JMSException e2){!
               // do something else!
           }!
        }

     }!
62   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); 

       } !
     } !




63   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);!
        }!
     }!




64   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);!
     }!




65   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
JMS 1.1 – Receiving a Message Synchronously
     Standard API
     @Resource(lookup = "jms/connectionFactory")

     ConnectionFactory connectionFactory;!
     

     @Resource(lookup="jms/inboundQueue")

     Queue inboundQueue; 

     

     public String receiveMessageOld() throws JMSException { 

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

              connection.start(); 

              Session session = connection.createSession(); 

              MessageConsumer messageConsumer = session.createConsumer(inboundQueue); 

              TextMessage textMessage = (TextMessage)messageConsumer.receive();

              String payload = textMessage.getText(); 

              return payload; 

          } 

     } !



66   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
JMS 2.0 – Receiving a Message Synchronously
     New Simplified API
     @Resource(lookup = "jms/connectionFactory") 

     ConnectionFactory connectionFactory; 

     

     @Resource(lookup="jms/inboundQueue") 

     Queue inboundQueue; 

     

     public String receiveMessageNew() { 

         try (JMSContext context = connectionFactory.createContext()) { 

             JMSConsumer consumer = context.createConsumer(inboundQueue); 

             return consumer.receivePayload(String.class); 

         } 

     } !




67   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
JMS 2.0 – Receiving a Message Synchronously
     New Simplified API (With Injection)
     @Inject 

     @JMSConnectionFactory("jms/connectionFactory") 

     private JMSContext context; 

     

     @Resource(lookup="jms/inboundQueue") 

     Queue inboundQueue; 

     

     public String receiveMessageNew() { 

         JMSConsumer consumer = context.createConsumer(inboundQueue); 

         return consumer.receivePayload(String.class); 

     } !




68   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
JSON – Standard API

     •  Advantages
           –  Applications can use standard types
           –  Leaner, portable applications
     •  Two JSRs
           –  Processing/Parsing JSON (JSON-P)
           –  Binding JSON <-> Java objects (JSON-B)
           –  Similar to JAXP and JAXB
           –  Close collaboration between the two


69   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
70   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



71   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(); !

  72   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(); !

   73   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(); !
   74   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

75   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



  76   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




        77   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

78   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
79   Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

More Related Content

What's hot

Java Summit Chennai: Java EE 7
Java Summit Chennai: Java EE 7Java Summit Chennai: Java EE 7
Java Summit Chennai: Java EE 7Arun Gupta
 
Jfokus 2012: PaaSing a Java EE Application
Jfokus 2012: PaaSing a Java EE ApplicationJfokus 2012: PaaSing a Java EE Application
Jfokus 2012: PaaSing a Java EE ApplicationArun Gupta
 
TDC 2011: OSGi-enabled Java EE Application
TDC 2011: OSGi-enabled Java EE ApplicationTDC 2011: OSGi-enabled Java EE Application
TDC 2011: OSGi-enabled Java EE ApplicationArun Gupta
 
GlassFish REST Administration Backend
GlassFish REST Administration BackendGlassFish REST Administration Backend
GlassFish REST Administration BackendArun Gupta
 
The Java EE 7 Platform: Developing for the Cloud
The Java EE 7 Platform: Developing for the CloudThe Java EE 7 Platform: Developing for the Cloud
The Java EE 7 Platform: Developing for the CloudArun Gupta
 
Jfokus 2012 : The Java EE 7 Platform: Developing for the Cloud
Jfokus 2012 : The Java EE 7 Platform: Developing for the CloudJfokus 2012 : The Java EE 7 Platform: Developing for the Cloud
Jfokus 2012 : The Java EE 7 Platform: Developing for the CloudArun Gupta
 
Java EE Technical Keynote at JavaOne Latin America 2011
Java EE Technical Keynote at JavaOne Latin America 2011Java EE Technical Keynote at JavaOne Latin America 2011
Java EE Technical Keynote at JavaOne Latin America 2011Arun Gupta
 
JAX-RS 2.0: What’s New in JSR 339 ?
JAX-RS 2.0: What’s New in JSR 339 ?JAX-RS 2.0: What’s New in JSR 339 ?
JAX-RS 2.0: What’s New in JSR 339 ?Arun Gupta
 
Java EE 7 at JAX London 2011 and JFall 2011
Java EE 7 at JAX London 2011 and JFall 2011Java EE 7 at JAX London 2011 and JFall 2011
Java EE 7 at JAX London 2011 and JFall 2011Arun Gupta
 
Java Summit Chennai: JAX-RS 2.0
Java Summit Chennai: JAX-RS 2.0Java Summit Chennai: JAX-RS 2.0
Java Summit Chennai: JAX-RS 2.0Arun Gupta
 
The Java EE 7 Platform: Developing for the Cloud (FISL 12)
The Java EE 7 Platform: Developing for the Cloud  (FISL 12)The Java EE 7 Platform: Developing for the Cloud  (FISL 12)
The Java EE 7 Platform: Developing for the Cloud (FISL 12)Arun Gupta
 
The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012
The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012
The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012Arun Gupta
 
Creating Quick and Powerful Web applications with Oracle, GlassFish and NetBe...
Creating Quick and Powerful Web applications with Oracle, GlassFish and NetBe...Creating Quick and Powerful Web applications with Oracle, GlassFish and NetBe...
Creating Quick and Powerful Web applications with Oracle, GlassFish and NetBe...Arun Gupta
 
GlassFish Community Update @ JavaOne 2011
GlassFish Community Update @ JavaOne 2011GlassFish Community Update @ JavaOne 2011
GlassFish Community Update @ JavaOne 2011Arun Gupta
 
Java EE / GlassFish Strategy & Roadmap @ JavaOne 2011
Java EE / GlassFish Strategy & Roadmap @ JavaOne 2011Java EE / GlassFish Strategy & Roadmap @ JavaOne 2011
Java EE / GlassFish Strategy & Roadmap @ JavaOne 2011Arun Gupta
 
GIDS 2012: PaaSing a Java EE Application
GIDS 2012: PaaSing a Java EE ApplicationGIDS 2012: PaaSing a Java EE Application
GIDS 2012: PaaSing a Java EE ApplicationArun Gupta
 
GIDS 2012: Java Message Service 2.0
GIDS 2012: Java Message Service 2.0GIDS 2012: Java Message Service 2.0
GIDS 2012: Java Message Service 2.0Arun Gupta
 
GlassFish 3.1 at JCertif 2011
GlassFish 3.1 at JCertif 2011GlassFish 3.1 at JCertif 2011
GlassFish 3.1 at JCertif 2011Arun Gupta
 
Running your Java EE 6 applications in the Cloud
Running your Java EE 6 applications in the CloudRunning your Java EE 6 applications in the Cloud
Running your Java EE 6 applications in the CloudArun Gupta
 

What's hot (20)

Websocket 1.0
Websocket 1.0Websocket 1.0
Websocket 1.0
 
Java Summit Chennai: Java EE 7
Java Summit Chennai: Java EE 7Java Summit Chennai: Java EE 7
Java Summit Chennai: Java EE 7
 
Jfokus 2012: PaaSing a Java EE Application
Jfokus 2012: PaaSing a Java EE ApplicationJfokus 2012: PaaSing a Java EE Application
Jfokus 2012: PaaSing a Java EE Application
 
TDC 2011: OSGi-enabled Java EE Application
TDC 2011: OSGi-enabled Java EE ApplicationTDC 2011: OSGi-enabled Java EE Application
TDC 2011: OSGi-enabled Java EE Application
 
GlassFish REST Administration Backend
GlassFish REST Administration BackendGlassFish REST Administration Backend
GlassFish REST Administration Backend
 
The Java EE 7 Platform: Developing for the Cloud
The Java EE 7 Platform: Developing for the CloudThe Java EE 7 Platform: Developing for the Cloud
The Java EE 7 Platform: Developing for the Cloud
 
Jfokus 2012 : The Java EE 7 Platform: Developing for the Cloud
Jfokus 2012 : The Java EE 7 Platform: Developing for the CloudJfokus 2012 : The Java EE 7 Platform: Developing for the Cloud
Jfokus 2012 : The Java EE 7 Platform: Developing for the Cloud
 
Java EE Technical Keynote at JavaOne Latin America 2011
Java EE Technical Keynote at JavaOne Latin America 2011Java EE Technical Keynote at JavaOne Latin America 2011
Java EE Technical Keynote at JavaOne Latin America 2011
 
JAX-RS 2.0: What’s New in JSR 339 ?
JAX-RS 2.0: What’s New in JSR 339 ?JAX-RS 2.0: What’s New in JSR 339 ?
JAX-RS 2.0: What’s New in JSR 339 ?
 
Java EE 7 at JAX London 2011 and JFall 2011
Java EE 7 at JAX London 2011 and JFall 2011Java EE 7 at JAX London 2011 and JFall 2011
Java EE 7 at JAX London 2011 and JFall 2011
 
Java Summit Chennai: JAX-RS 2.0
Java Summit Chennai: JAX-RS 2.0Java Summit Chennai: JAX-RS 2.0
Java Summit Chennai: JAX-RS 2.0
 
The Java EE 7 Platform: Developing for the Cloud (FISL 12)
The Java EE 7 Platform: Developing for the Cloud  (FISL 12)The Java EE 7 Platform: Developing for the Cloud  (FISL 12)
The Java EE 7 Platform: Developing for the Cloud (FISL 12)
 
The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012
The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012
The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012
 
Creating Quick and Powerful Web applications with Oracle, GlassFish and NetBe...
Creating Quick and Powerful Web applications with Oracle, GlassFish and NetBe...Creating Quick and Powerful Web applications with Oracle, GlassFish and NetBe...
Creating Quick and Powerful Web applications with Oracle, GlassFish and NetBe...
 
GlassFish Community Update @ JavaOne 2011
GlassFish Community Update @ JavaOne 2011GlassFish Community Update @ JavaOne 2011
GlassFish Community Update @ JavaOne 2011
 
Java EE / GlassFish Strategy & Roadmap @ JavaOne 2011
Java EE / GlassFish Strategy & Roadmap @ JavaOne 2011Java EE / GlassFish Strategy & Roadmap @ JavaOne 2011
Java EE / GlassFish Strategy & Roadmap @ JavaOne 2011
 
GIDS 2012: PaaSing a Java EE Application
GIDS 2012: PaaSing a Java EE ApplicationGIDS 2012: PaaSing a Java EE Application
GIDS 2012: PaaSing a Java EE Application
 
GIDS 2012: Java Message Service 2.0
GIDS 2012: Java Message Service 2.0GIDS 2012: Java Message Service 2.0
GIDS 2012: Java Message Service 2.0
 
GlassFish 3.1 at JCertif 2011
GlassFish 3.1 at JCertif 2011GlassFish 3.1 at JCertif 2011
GlassFish 3.1 at JCertif 2011
 
Running your Java EE 6 applications in the Cloud
Running your Java EE 6 applications in the CloudRunning your Java EE 6 applications in the Cloud
Running your Java EE 6 applications in the Cloud
 

Viewers also liked

Melhore o Desenvolvimento do Time com DevOps na Nuvem
Melhore o Desenvolvimento do Time com DevOps na NuvemMelhore o Desenvolvimento do Time com DevOps na Nuvem
Melhore o Desenvolvimento do Time com DevOps na NuvemBruno Borges
 
Novidades do Java SE 8
Novidades do Java SE 8Novidades do Java SE 8
Novidades do Java SE 8Bruno Borges
 
JavaFX - Straight from the trenches
JavaFX - Straight from the trenchesJavaFX - Straight from the trenches
JavaFX - Straight from the trenchesAnderson Braz
 
JEE Conf: Архитектура Android приложений: полезные и вредные советы
JEE Conf: Архитектура Android приложений: полезные и вредные советыJEE Conf: Архитектура Android приложений: полезные и вредные советы
JEE Conf: Архитектура Android приложений: полезные и вредные советыdmalykhanov
 
JDK: CPU, PSU, LU, FR — WTF?!
JDK: CPU, PSU, LU, FR — WTF?!JDK: CPU, PSU, LU, FR — WTF?!
JDK: CPU, PSU, LU, FR — WTF?!Alexey Fyodorov
 
Pragmatic functional refactoring with java 8 (1)
Pragmatic functional refactoring with java 8 (1)Pragmatic functional refactoring with java 8 (1)
Pragmatic functional refactoring with java 8 (1)RichardWarburton
 
мифы о спарке
мифы о спарке мифы о спарке
мифы о спарке Evgeny Borisov
 
Scalable Java Application Development on AWS
Scalable Java Application Development on AWSScalable Java Application Development on AWS
Scalable Java Application Development on AWSMikalai Alimenkou
 
JetBrains IDEハンズオン
JetBrains IDEハンズオンJetBrains IDEハンズオン
JetBrains IDEハンズオンYusuke Yamamoto
 
Enterprise Java Beans 3 - Business Logic
Enterprise Java Beans 3 - Business LogicEnterprise Java Beans 3 - Business Logic
Enterprise Java Beans 3 - Business LogicEmprovise
 
EJB and CDI - Alignment and Strategy
EJB and CDI - Alignment and StrategyEJB and CDI - Alignment and Strategy
EJB and CDI - Alignment and StrategyDavid Delabassee
 
Enterprise Java Beans - EJB
Enterprise Java Beans - EJBEnterprise Java Beans - EJB
Enterprise Java Beans - EJBPeter R. Egli
 
Lecture 8 Enterprise Java Beans (EJB)
Lecture 8  Enterprise Java Beans (EJB)Lecture 8  Enterprise Java Beans (EJB)
Lecture 8 Enterprise Java Beans (EJB)Fahad Golra
 

Viewers also liked (20)

Melhore o Desenvolvimento do Time com DevOps na Nuvem
Melhore o Desenvolvimento do Time com DevOps na NuvemMelhore o Desenvolvimento do Time com DevOps na Nuvem
Melhore o Desenvolvimento do Time com DevOps na Nuvem
 
Novidades do Java SE 8
Novidades do Java SE 8Novidades do Java SE 8
Novidades do Java SE 8
 
JavaFX - Straight from the trenches
JavaFX - Straight from the trenchesJavaFX - Straight from the trenches
JavaFX - Straight from the trenches
 
From Swing to JavaFX
From Swing to JavaFXFrom Swing to JavaFX
From Swing to JavaFX
 
JEE Conf: Архитектура Android приложений: полезные и вредные советы
JEE Conf: Архитектура Android приложений: полезные и вредные советыJEE Conf: Архитектура Android приложений: полезные и вредные советы
JEE Conf: Архитектура Android приложений: полезные и вредные советы
 
JDK: CPU, PSU, LU, FR — WTF?!
JDK: CPU, PSU, LU, FR — WTF?!JDK: CPU, PSU, LU, FR — WTF?!
JDK: CPU, PSU, LU, FR — WTF?!
 
Pragmatic functional refactoring with java 8 (1)
Pragmatic functional refactoring with java 8 (1)Pragmatic functional refactoring with java 8 (1)
Pragmatic functional refactoring with java 8 (1)
 
мифы о спарке
мифы о спарке мифы о спарке
мифы о спарке
 
Ejb3 Presentation
Ejb3 PresentationEjb3 Presentation
Ejb3 Presentation
 
Scalable Java Application Development on AWS
Scalable Java Application Development on AWSScalable Java Application Development on AWS
Scalable Java Application Development on AWS
 
JetBrains IDEハンズオン
JetBrains IDEハンズオンJetBrains IDEハンズオン
JetBrains IDEハンズオン
 
EJB 3.1 by Bert Ertman
EJB 3.1 by Bert ErtmanEJB 3.1 by Bert Ertman
EJB 3.1 by Bert Ertman
 
Enterprise Java Beans 3 - Business Logic
Enterprise Java Beans 3 - Business LogicEnterprise Java Beans 3 - Business Logic
Enterprise Java Beans 3 - Business Logic
 
EJB and CDI - Alignment and Strategy
EJB and CDI - Alignment and StrategyEJB and CDI - Alignment and Strategy
EJB and CDI - Alignment and Strategy
 
Curso Java Avanzado 5 Ejb
Curso Java Avanzado   5 EjbCurso Java Avanzado   5 Ejb
Curso Java Avanzado 5 Ejb
 
Introduction to EJB
Introduction to EJBIntroduction to EJB
Introduction to EJB
 
Enterprise Java Beans - EJB
Enterprise Java Beans - EJBEnterprise Java Beans - EJB
Enterprise Java Beans - EJB
 
EJB .
EJB .EJB .
EJB .
 
Lecture 8 Enterprise Java Beans (EJB)
Lecture 8  Enterprise Java Beans (EJB)Lecture 8  Enterprise Java Beans (EJB)
Lecture 8 Enterprise Java Beans (EJB)
 
Enterprise JavaBeans(EJB)
Enterprise JavaBeans(EJB)Enterprise JavaBeans(EJB)
Enterprise JavaBeans(EJB)
 

Similar to Java EE 7: Developing for the Cloud at Geecon, JEEConf, Johannesburg

Introduction to java_ee
Introduction to java_eeIntroduction to java_ee
Introduction to java_eeYogesh Bindwal
 
Sun Java EE 6 Overview
Sun Java EE 6 OverviewSun Java EE 6 Overview
Sun Java EE 6 Overviewsbobde
 
Java ee 7 platform developing for the cloud kshitiz saxena
Java ee 7 platform developing for the cloud   kshitiz saxenaJava ee 7 platform developing for the cloud   kshitiz saxena
Java ee 7 platform developing for the cloud kshitiz saxenaIndicThreads
 
SPEC INDIA Java Case Study
SPEC INDIA Java Case StudySPEC INDIA Java Case Study
SPEC INDIA Java Case StudySPEC INDIA
 
Java EE7 in action
Java EE7 in actionJava EE7 in action
Java EE7 in actionAnkara JUG
 
Java EE 6 & GlassFish v3: Paving the path for the future - Tech Days 2010 India
Java EE 6 & GlassFish v3: Paving the path for the future - Tech Days 2010 IndiaJava EE 6 & GlassFish v3: Paving the path for the future - Tech Days 2010 India
Java EE 6 & GlassFish v3: Paving the path for the future - Tech Days 2010 IndiaArun Gupta
 
Handling Service Orchestration in the Cloud for GlassFish - JavaOne, San Fran...
Handling Service Orchestration in the Cloud for GlassFish - JavaOne, San Fran...Handling Service Orchestration in the Cloud for GlassFish - JavaOne, San Fran...
Handling Service Orchestration in the Cloud for GlassFish - JavaOne, San Fran...Sivakumar Thyagarajan
 
Servidores de Aplicação: por que ainda precisamos deles?
Servidores de Aplicação: por que ainda precisamos deles?Servidores de Aplicação: por que ainda precisamos deles?
Servidores de Aplicação: por que ainda precisamos deles?Bruno Borges
 
Enterprise java unit-1_chapter-1
Enterprise java unit-1_chapter-1Enterprise java unit-1_chapter-1
Enterprise java unit-1_chapter-1sandeep54552
 
Enterprise Java in 2012 and Beyond, by Juergen Hoeller
Enterprise Java in 2012 and Beyond, by Juergen Hoeller Enterprise Java in 2012 and Beyond, by Juergen Hoeller
Enterprise Java in 2012 and Beyond, by Juergen Hoeller Codemotion
 
Virtual dev-day-java7-keynote-1641807
Virtual dev-day-java7-keynote-1641807Virtual dev-day-java7-keynote-1641807
Virtual dev-day-java7-keynote-1641807Vinay H G
 
Java EE 6 & GlassFish v3: Paving the path for the future - Spark IT 2010
Java EE 6 & GlassFish v3: Paving the path for the future - Spark IT 2010Java EE 6 & GlassFish v3: Paving the path for the future - Spark IT 2010
Java EE 6 & GlassFish v3: Paving the path for the future - Spark IT 2010Arun Gupta
 
JUG Darmstadt - Java EE 7 - Auf in die Wolken!
JUG Darmstadt - Java EE 7 - Auf in die Wolken!JUG Darmstadt - Java EE 7 - Auf in die Wolken!
JUG Darmstadt - Java EE 7 - Auf in die Wolken!Markus Eisele
 
JavaEE 6 and GlassFish v3 at SFJUG
JavaEE 6 and GlassFish v3 at SFJUGJavaEE 6 and GlassFish v3 at SFJUG
JavaEE 6 and GlassFish v3 at SFJUGMarakana Inc.
 

Similar to Java EE 7: Developing for the Cloud at Geecon, JEEConf, Johannesburg (20)

Introduction to java_ee
Introduction to java_eeIntroduction to java_ee
Introduction to java_ee
 
Sun Java EE 6 Overview
Sun Java EE 6 OverviewSun Java EE 6 Overview
Sun Java EE 6 Overview
 
JMS 2.0
JMS 2.0JMS 2.0
JMS 2.0
 
Java ee 7 platform developing for the cloud kshitiz saxena
Java ee 7 platform developing for the cloud   kshitiz saxenaJava ee 7 platform developing for the cloud   kshitiz saxena
Java ee 7 platform developing for the cloud kshitiz saxena
 
SPEC INDIA Java Case Study
SPEC INDIA Java Case StudySPEC INDIA Java Case Study
SPEC INDIA Java Case Study
 
Java EE7 in action
Java EE7 in actionJava EE7 in action
Java EE7 in action
 
JavaOne Update zur Java Plattform
JavaOne Update zur Java PlattformJavaOne Update zur Java Plattform
JavaOne Update zur Java Plattform
 
Java EE 6 & GlassFish v3: Paving the path for the future - Tech Days 2010 India
Java EE 6 & GlassFish v3: Paving the path for the future - Tech Days 2010 IndiaJava EE 6 & GlassFish v3: Paving the path for the future - Tech Days 2010 India
Java EE 6 & GlassFish v3: Paving the path for the future - Tech Days 2010 India
 
JavaCro'14 - WebLogic-GlassFish-JaaS Strategy and Roadmap – Duško Vukmanović
JavaCro'14 - WebLogic-GlassFish-JaaS Strategy and Roadmap – Duško VukmanovićJavaCro'14 - WebLogic-GlassFish-JaaS Strategy and Roadmap – Duško Vukmanović
JavaCro'14 - WebLogic-GlassFish-JaaS Strategy and Roadmap – Duško Vukmanović
 
Handling Service Orchestration in the Cloud for GlassFish - JavaOne, San Fran...
Handling Service Orchestration in the Cloud for GlassFish - JavaOne, San Fran...Handling Service Orchestration in the Cloud for GlassFish - JavaOne, San Fran...
Handling Service Orchestration in the Cloud for GlassFish - JavaOne, San Fran...
 
Java EE 6 and GlassFish portfolio
Java EE 6 and GlassFish portfolioJava EE 6 and GlassFish portfolio
Java EE 6 and GlassFish portfolio
 
Servidores de Aplicação: por que ainda precisamos deles?
Servidores de Aplicação: por que ainda precisamos deles?Servidores de Aplicação: por que ainda precisamos deles?
Servidores de Aplicação: por que ainda precisamos deles?
 
Enterprise java unit-1_chapter-1
Enterprise java unit-1_chapter-1Enterprise java unit-1_chapter-1
Enterprise java unit-1_chapter-1
 
Introduction To JavaFX 2.0
Introduction To JavaFX 2.0Introduction To JavaFX 2.0
Introduction To JavaFX 2.0
 
JDK versions and OpenJDK
JDK versions and OpenJDKJDK versions and OpenJDK
JDK versions and OpenJDK
 
Enterprise Java in 2012 and Beyond, by Juergen Hoeller
Enterprise Java in 2012 and Beyond, by Juergen Hoeller Enterprise Java in 2012 and Beyond, by Juergen Hoeller
Enterprise Java in 2012 and Beyond, by Juergen Hoeller
 
Virtual dev-day-java7-keynote-1641807
Virtual dev-day-java7-keynote-1641807Virtual dev-day-java7-keynote-1641807
Virtual dev-day-java7-keynote-1641807
 
Java EE 6 & GlassFish v3: Paving the path for the future - Spark IT 2010
Java EE 6 & GlassFish v3: Paving the path for the future - Spark IT 2010Java EE 6 & GlassFish v3: Paving the path for the future - Spark IT 2010
Java EE 6 & GlassFish v3: Paving the path for the future - Spark IT 2010
 
JUG Darmstadt - Java EE 7 - Auf in die Wolken!
JUG Darmstadt - Java EE 7 - Auf in die Wolken!JUG Darmstadt - Java EE 7 - Auf in die Wolken!
JUG Darmstadt - Java EE 7 - Auf in die Wolken!
 
JavaEE 6 and GlassFish v3 at SFJUG
JavaEE 6 and GlassFish v3 at SFJUGJavaEE 6 and GlassFish v3 at SFJUG
JavaEE 6 and GlassFish v3 at SFJUG
 

More from Arun Gupta

5 Skills To Force Multiply Technical Talents.pdf
5 Skills To Force Multiply Technical Talents.pdf5 Skills To Force Multiply Technical Talents.pdf
5 Skills To Force Multiply Technical Talents.pdfArun Gupta
 
Machine Learning using Kubernetes - AI Conclave 2019
Machine Learning using Kubernetes - AI Conclave 2019Machine Learning using Kubernetes - AI Conclave 2019
Machine Learning using Kubernetes - AI Conclave 2019Arun Gupta
 
Machine Learning using Kubeflow and Kubernetes
Machine Learning using Kubeflow and KubernetesMachine Learning using Kubeflow and Kubernetes
Machine Learning using Kubeflow and KubernetesArun Gupta
 
Secure and Fast microVM for Serverless Computing using Firecracker
Secure and Fast microVM for Serverless Computing using FirecrackerSecure and Fast microVM for Serverless Computing using Firecracker
Secure and Fast microVM for Serverless Computing using FirecrackerArun Gupta
 
Building Java in the Open - j.Day at OSCON 2019
Building Java in the Open - j.Day at OSCON 2019Building Java in the Open - j.Day at OSCON 2019
Building Java in the Open - j.Day at OSCON 2019Arun Gupta
 
Why Amazon Cares about Open Source
Why Amazon Cares about Open SourceWhy Amazon Cares about Open Source
Why Amazon Cares about Open SourceArun Gupta
 
Machine learning using Kubernetes
Machine learning using KubernetesMachine learning using Kubernetes
Machine learning using KubernetesArun Gupta
 
Building Cloud Native Applications
Building Cloud Native ApplicationsBuilding Cloud Native Applications
Building Cloud Native ApplicationsArun Gupta
 
Chaos Engineering with Kubernetes
Chaos Engineering with KubernetesChaos Engineering with Kubernetes
Chaos Engineering with KubernetesArun Gupta
 
How to be a mentor to bring more girls to STEAM
How to be a mentor to bring more girls to STEAMHow to be a mentor to bring more girls to STEAM
How to be a mentor to bring more girls to STEAMArun Gupta
 
Java in a World of Containers - DockerCon 2018
Java in a World of Containers - DockerCon 2018Java in a World of Containers - DockerCon 2018
Java in a World of Containers - DockerCon 2018Arun Gupta
 
The Serverless Tidal Wave - SwampUP 2018 Keynote
The Serverless Tidal Wave - SwampUP 2018 KeynoteThe Serverless Tidal Wave - SwampUP 2018 Keynote
The Serverless Tidal Wave - SwampUP 2018 KeynoteArun Gupta
 
Introduction to Amazon EKS - KubeCon 2018
Introduction to Amazon EKS - KubeCon 2018Introduction to Amazon EKS - KubeCon 2018
Introduction to Amazon EKS - KubeCon 2018Arun Gupta
 
Mastering Kubernetes on AWS - Tel Aviv Summit
Mastering Kubernetes on AWS - Tel Aviv SummitMastering Kubernetes on AWS - Tel Aviv Summit
Mastering Kubernetes on AWS - Tel Aviv SummitArun Gupta
 
Top 10 Technology Trends Changing Developer's Landscape
Top 10 Technology Trends Changing Developer's LandscapeTop 10 Technology Trends Changing Developer's Landscape
Top 10 Technology Trends Changing Developer's LandscapeArun Gupta
 
Container Landscape in 2017
Container Landscape in 2017Container Landscape in 2017
Container Landscape in 2017Arun Gupta
 
Java EE and NoSQL using JBoss EAP 7 and OpenShift
Java EE and NoSQL using JBoss EAP 7 and OpenShiftJava EE and NoSQL using JBoss EAP 7 and OpenShift
Java EE and NoSQL using JBoss EAP 7 and OpenShiftArun Gupta
 
Docker, Kubernetes, and Mesos recipes for Java developers
Docker, Kubernetes, and Mesos recipes for Java developersDocker, Kubernetes, and Mesos recipes for Java developers
Docker, Kubernetes, and Mesos recipes for Java developersArun Gupta
 
Thanks Managers!
Thanks Managers!Thanks Managers!
Thanks Managers!Arun Gupta
 
Migrate your traditional VM-based Clusters to Containers
Migrate your traditional VM-based Clusters to ContainersMigrate your traditional VM-based Clusters to Containers
Migrate your traditional VM-based Clusters to ContainersArun Gupta
 

More from Arun Gupta (20)

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

Recently uploaded

Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 

Recently uploaded (20)

Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 

Java EE 7: Developing for the Cloud at Geecon, JEEConf, Johannesburg

  • 1. Main sponsor The  Java  EE  7  Pla,orm:  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. Resource/Service Metadata •  Which service ? –  Application require an instance, not a particular one –  Application require a particular instance, with specific properties •  Services scoped to application, or shareable •  Quality-of-service attributes such as pool size, elasticity •  Usecases –  Need only SQL and JTA transactions; use PaaS platform defaults –  Needs Oracle database, initial/minimum/maximum poolsize, JNDI name –  Pre-provisioned MySQL, JNDI name, host/port –  Apps sharing JMS queues by referring to global JNDI name 17 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 18. 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 18 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 19. Example Scenario “A software company writes an application, submits it to a PaaS provider, then any number of tenants sign up for the application, deploy it, their end users access it” 19 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 20. Walkthrough (1) SimplyCRM   DiabloCloud   20 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 21. Walkthrough (2) SimplyCRM   DiabloCloud   ApplicaDon   Developer   Writes App 21 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 22. Walkthrough (3) SimplyCRM   DiabloCloud   Signs up as a customer PaaS  Customer   PaaS  Account  Manager   22 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 23. Walkthrough (4) SimplyCRM   DiabloCloud   Submits the application Application System  Administrator   Submitter App 23 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 24. Walkthrough (5) ExtraServices   DiabloCloud   Discovers App 24 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 25. Walkthrough (6) ExtraServices   DiabloCloud   Signs up as a customer PaaS  Customer   PaaS  Account  Manager   App 25 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 26. Walkthrough (7) ExtraServices   DiabloCloud   Deployer   System  Administrator   Customizes and deploys the application App 26 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 27. Walkthrough (8) ExtraServices   DiabloCloud   Deployer   System  Administrator   Provisions on Cloud infrastructure App 27 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 28. Walkthrough (9) ExtraServices   DiabloCloud   Deployer   System  Administrator   Provisioned and Deployed App 28 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 29. Walkthrough (10) ExtraServices   DiabloCloud   Access the application End-­‐Users   Provisioned and Deployed App 29 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 30. Walkthrough (11) ExtraServices   DiabloCloud   End-­‐Users   Access the application Provisioned and Deployed App Administrator   Administers the application 30 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 31. Walkthrough (12) ExtraServices   DiabloCloud   System  Administrator   Monitors End-­‐Users   Access the application Provisioned and Deployed App Administrator   Administers the application 31 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 32. Demo PaaSing a Java EE Application in the Cloud glassfish.org/javaone2011 32 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 33. 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>! 33 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 34. Service Provisioning Load Balancer Java EE Java EE ... Java EE Database 34 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 35. 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! 35 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 36. Java EE 7 Is Not Just Cloud-y •  Alignment of ManagedBeans across CDI, EJB, JSF, … –  POJO à ManagedBean à Enterprise JavaBean –  Extension of container-managed transactions beyond EJB •  Further simplifications for ease-of-development –  JAX-RS 2.0 Client API, hypermedia, bean validation, … –  JMS 2.0 focus on ease-of-development –  Expanded use of dependency injection –  Expanded service metadata; improved configuration •  Pruning –  EJB CMP and BMP, JAX-RPC, Deployment API •  Update to Web Profile 36 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 37. 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) 37 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 38. 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 38 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 39. 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 39 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 40. Java Persistence API 2.1 •  @NamedStoredProcedureQuery, StoredProcedureQuery! •  Bulk update/delete using Criteria! •  User-defined functions using FUNCTION! •  Persistence Context Synchronization 40 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 41. JPA 2.1 Stored Procedures @Entity
 @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);! ! 41 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 42. JPA 2.1 Update/Delete using Criteria CriteriaUpdate<Customer> q = cb.createCriteriaUpdate(Customer.class); 
 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! 
 42 !Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 43. Java API for RESTful Web Services 2.0 •  Client-side API •  Filters and Entity Interceptors •  Client-side and Server-side Async •  Validation •  Server-side content negotiation (qs) •  Hypermedia •  Alignment with CDI 43 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 44. JAX-RS 2.0 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);! 44 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 45. 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;
     }
 }! 45 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 46. JAX-RS 2.0 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) {
 }
 }
 );! 46 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 47. JAX-RS 2.0 Server-side Async @Path("/async")
 class ProductResource {
     @Context ExecutionContext ctx;
 #     @GET
     @Suspend
     public Product longOp() {
         Executors.newSingleThreadExecutor().submit(
             new Runnable() {
                 public void run() {
                     Proruct product = longQueryFromDatabase();
                     ctx.resume(product);
                 }
             }
         );
     }
 }! 47 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 48. JAX-RS 2.0 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) {
         . . .
     }
 }! 48 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 49. JAX-RS 2.0 Server-side Content Negotiation @Path("/")
 class ProductResource {!     @GET
     @Produces({ "text/xml;qs=0.75", "application/json"})
     public Product[] getProducts() {
         . . .
     }
 }! 49 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 50. JavaServer Faces 2.2 •  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 •  . . . 50 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 51. 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 •  . . . 51 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 52. Enterprise JavaBeans 3.2 •  Three-part specification –  Core CMT transactions on Managed Beans, Non-persistent timer and Async method to Lite –  Optional CMP, BMP, Entity Beans, EJB QL, JAX-RPC Web service endpoint –  Interceptors 52 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 53. Enterprise JavaBeans 3.2 Under discussion •  Alignment with JMS 2.0 •  QoS – @MaxConcurrency, @Poolsize! •  Non persistent timers and Async invocations in EJB.Lite •  Support for CMT in ManagedBeans –  Subset of transaction attributes –  BMT are already supported using UserTransaction! 53 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 54. Bean Validation 1.1 •  Open: Spec, Reference Implementation, TCK •  Alignment with Dependency Injection •  Method-level validation –  Constraints on parameters and return values –  Check pre-/post-conditions 54 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 55. 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() { ... } ! } ! 55 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 56. 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 56 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 57. JMS 1.1 Sending messages in Java EE @Resource(lookup = "jms/connFactory")
 ConnectionFactory cf; ! @Resource(lookup="jms/inboundQueue")! Destination dest;! ! public void sendMessage (String payload) throws JMSException {! Connection conn = cf.createConnection();
 Session sess = ! conn.createSession(false,Session.AUTO_ACKNOWLEDGE);
 MessageProducer producer = sess.createProducer(dest);
 TextMessage textMessage = sess.createTextMessage(payload);
 messageProducer.send(textMessage); 
 connection.close();
 }! 57 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 58. JMS 2.0 Sending messages in Java EE @Resource(lookup = "jms/connFactory")
 Need to create ConnectionFactory cf; ! intermediate objects @Resource(lookup="jms/inboundQueue")! just to satisfy the API Destination dest;! ! public void sendMessage (String payload) throws JMSException {! Connection conn = cf.createConnection();
 Session sess = ! conn.createSession(false,Session.AUTO_ACKNOWLEDGE);
 MessageProducer producer = sess.createProducer(dest);
 TextMessage textMessage = sess.createTextMessage(payload);
 messageProducer.send(textMessage); 
 connection.close();
 }! 58 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 59. JMS 2.0 Sending messages in Java EE @Resource(lookup = "jms/connFactory")
 ConnectionFactory cf; ! @Resource(lookup="jms/inboundQueue")! Redundant Destination dest;! arguments ! public void sendMessage (String payload) throws JMSException {! Connection conn = cf.createConnection();
 Session sess = ! conn.createSession(false,Session.AUTO_ACKNOWLEDGE);
 MessageProducer producer = sess.createProducer(dest);
 TextMessage textMessage = sess.createTextMessage(payload);
 messageProducer.send(textMessage); 
 connection.close();
 }! 59 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 60. JMS 2.0 Sending messages in Java EE @Resource(lookup = "jms/connFactory")
 ConnectionFactory cf; ! @Resource(lookup="jms/inboundQueue")! Destination dest;! Boilerplate code ! public void sendMessage (String payload) throws JMSException {! Connection conn = cf.createConnection();
 Session sess = ! conn.createSession(false,Session.AUTO_ACKNOWLEDGE);
 MessageProducer producer = sess.createProducer(dest);
 TextMessage textMessage = sess.createTextMessage(payload);
 messageProducer.send(textMessage); 
 connection.close();
 }! 60 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 61. JMS 2.0 Sending messages in Java EE public void sendMessage (String payload) throws JMSException {! try {! Connection conn = null;! con = cf.createConnection();
 Session sess = ! conn.createSession(false,Session.AUTO_ACKNOWLEDGE);
 MessageProducer producer = sess.createProducer(dest);
 TextMessage textMessage=sess.createTextMessage(payload);
 messageProducer.send(textMessage); ! } finally {
 connection.close();! }
 }! Need to close connections after use 61 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 62. JMS 2.0 Sending messages in Java EE public void sendMessage (String payload) {! Connection conn = null;! try {! con = cf.createConnection();
 Session sess = ! conn.createSession(false,Session.AUTO_ACKNOWLEDGE);
 MessageProducer producer = sess.createProducer(dest);
 TextMessage textMessage=sess.createTextMessage(payload);
 messageProducer.send(textMessage); ! } catch (JMSException e1) {! // do something! } finally {! And there's try {
 always exception if (conn!=null) connection.close();! handling to add } catch (JMSException e2){! // do something else! }! }
 }! 62 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 63. 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); 
 } ! } ! 63 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 64. 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);! }! }! 64 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 65. 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);! }! 65 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 66. JMS 1.1 – Receiving a Message Synchronously Standard API @Resource(lookup = "jms/connectionFactory")
 ConnectionFactory connectionFactory;! 
 @Resource(lookup="jms/inboundQueue")
 Queue inboundQueue; 
 
 public String receiveMessageOld() throws JMSException { 
 try (Connection connection = connectionFactory.createConnection()) { 
 connection.start(); 
 Session session = connection.createSession(); 
 MessageConsumer messageConsumer = session.createConsumer(inboundQueue); 
 TextMessage textMessage = (TextMessage)messageConsumer.receive();
 String payload = textMessage.getText(); 
 return payload; 
 } 
 } ! 66 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 67. JMS 2.0 – Receiving a Message Synchronously New Simplified API @Resource(lookup = "jms/connectionFactory") 
 ConnectionFactory connectionFactory; 
 
 @Resource(lookup="jms/inboundQueue") 
 Queue inboundQueue; 
 
 public String receiveMessageNew() { 
 try (JMSContext context = connectionFactory.createContext()) { 
 JMSConsumer consumer = context.createConsumer(inboundQueue); 
 return consumer.receivePayload(String.class); 
 } 
 } ! 67 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 68. JMS 2.0 – Receiving a Message Synchronously New Simplified API (With Injection) @Inject 
 @JMSConnectionFactory("jms/connectionFactory") 
 private JMSContext context; 
 
 @Resource(lookup="jms/inboundQueue") 
 Queue inboundQueue; 
 
 public String receiveMessageNew() { 
 JMSConsumer consumer = context.createConsumer(inboundQueue); 
 return consumer.receivePayload(String.class); 
 } ! 68 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 69. JSON – Standard API •  Advantages –  Applications can use standard types –  Leaner, portable applications •  Two JSRs –  Processing/Parsing JSON (JSON-P) –  Binding JSON <-> Java objects (JSON-B) –  Similar to JAXP and JAXB –  Close collaboration between the two 69 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 70. 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 70 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 71. 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 71 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 72. 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(); ! 72 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 73. 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(); ! 73 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 74. 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(); ! 74 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 75. 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 75 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 76. 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 76 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 77. 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 77 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 78. 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 78 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.
  • 79. 79 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.