The Java EE 7 Platform: Developing for the Cloud

                                   Kshitiz Saxena
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.
Java EE 6 Implementations
Fastest implementations of a Java EE release ever!
Java EE – Developer Adoption
                                   Downloads                    40 Million+
           45
Millions



           40
           35
           30
           25
           20
           15
           10
            5
            0
                FY 06   FY 07   FY 08   FY 09   FY 10   FY 11   FY 12
Java EE 7
What Do We Mean by “The Cloud”?

• Infrastructure as a Service (IaaS)
   The capability provided to the consumer is to provision processing,
   storage, networks, and other fundamental computing resources
   where the consumer is able to deploy and run arbitrary software,
   which can include operating systems and applications. (NIST)
• Platform as a Service (Paas)
• Software as a Service (SaaS)

                                        (*) NIST Definition of Cloud Computing – 800-145
What Do We Mean by “The Cloud”?

• Infrastructure as a Service (IaaS)
• Platform as a Service (Paas)
   The capability provided to the consumer is to deploy onto the cloud
   infrastructure consumer-created or acquired applications created
   using programming languages and tools supported by the provider.
   The consumer does not manage or control the underlying cloud
   infrastructure…, but has control over the deployed applications and
   possibly application hosting environment configurations. (NIST)
• Software as a Service (SaaS)
                                        (*) NIST Definition of Cloud Computing – 800-145
What Do We Mean by “The Cloud”?

• Infrastructure as a Service (IaaS)
• Platform as a Service (Paas)
• Software as a Service (SaaS)
   The capability provided to the consumer is to use the provider’s
   applications running on a cloud infrastructure. The consumer does
   not manage or control the underlying cloud infrastructure…, with
   the possible exception of limited user-specific application
   configuration settings. (NIST)

                                     (*) NIST Definition of Cloud Computing – 800-145
Today’s Cloud Offerings Are Vendor-Specific

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




                        …
Java EE 7 Focus: Platform as a Service

• Provide way for customers and users to leverage public,
  private, and hybrid clouds

• PaaS support entails evolutionary change

• 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
Java EE 7 PaaS Roadmap
• Define new platform roles to accommodate PaaS model
• Add metadata
  –   For service provisioning and configuration
  –   For QoS, elasticity
  –   For sharing of applications and resources
  –   For (re)configurability and customization
• Add useful APIs for cloud environment
  – JAX-RS client API, Caching API, State Management, JSON,…
• Extend existing APIs with support for multi-tenancy
Roles
Java EE 7 Focus Area: Cloud Services, Not Just
   APIs
• In the cloud tenant applications              Tenant App               Tenant App              Tenant App

  consume services                                      Java EE Application Level Services
• PaaS administrators host,                       Queuing
                                                  Service
                                                                   Persistence
                                                                     Service
                                                                                    Caching
                                                                                     Service
                                                                                                     …

  configure, and manage
                                                             PaaS Infrastructure Services
  application and infrastructure                  Security         Provisioning    File
                                                                                                     …
  services                                         Service            Service         Service

                                                         Platform as a Service - Services
• Existing APIs in Java EE need to
                                                             IaaS Infrastructure Services
  be updated to be service-enabled
                                                 Virt        VIP       VLAN       Volume       LBR       …
  and tenant-aware
  – Example: pluggable services, late binding                 Infrastructure as a Service
    and tenant id injection
Old 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/WAR/RAR…)
Java EE 7 Model: Auto-Provision Services
        from Application Dependencies
• Provision and deploy application       1   Provision and Initialize    Cloud Administration Service


resources (e.g. LDAP stripe, data
source instantiation and                                                     Database
                                                                              Service
connection …)                            2    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/WAR/RAR…)
                                                                           Container
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
  )
Services

• Cloud apps consume services
  – Persistence, queueing, mail, caching, …
• Service metadata facilitates ease of use when deploying
  into the cloud
  @JMSConnectionFactory (
   name=“java:app/myJMSConnectionFactory”,
   resourceType=“javax.jms.QueueConnectionFactory”)

  @JMSDestination(
   name=“java:app/myQueue”,
   resourceType=“javax.jms.Queue”)
Services

• Cloud apps consume services
  – Persistence, queueing, mail, caching, …
• Service metadata facilitates ease of use when deploying
  into the cloud
  @MailSession (
    name=“java:app/mailSession”,
    from=“MyService@ExtraServices.com”
  )
Services

• Cloud apps consume services
  – Persistence, queueing, mail, caching, …
• Service metadata facilitates ease of use when deploying
  into the cloud
  @ConnectorService (
    name=“java:app/myCustomConnector”,
    type=“com.extraServices.customConnector.class”,
    properties = {…}
  )
Java EE 7 Focus Area: 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
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”
Walkthrough (1)
  SimplyCRM       DiabloCloud
Walkthrough (2)
  SimplyCRM        DiabloCloud


  Application
  Developer


          Writes


    App
Walkthrough (3)
   SimplyCRM                                   DiabloCloud

                  Signs up as a customer
  PaaS Customer                            PaaS Account Manager
Walkthrough (4)
  SimplyCRM                                   DiabloCloud

                Submits the application
  Application                             System Administrator
  Submitter


                                                   App
Walkthrough (5)
  ExtraServices                 DiabloCloud

                  Discovers
                              App
Walkthrough (6)
  ExtraServices                                DiabloCloud

                  Signs up as a customer
  PaaS Customer                            PaaS Account Manager



                                            App
Walkthrough (7)
  ExtraServices                                 DiabloCloud


   Deployer                                 System Administrator
                  Customizes and
                  deploys the application



                                                 App
Walkthrough (8)
  ExtraServices          DiabloCloud


   Deployer         System Administrator



                  Provisions on
                      Cloud
                  infrastructure

                              App
Walkthrough (9)
  ExtraServices       DiabloCloud


   Deployer       System Administrator




                   Provisioned and
                    Deployed App
Walkthrough (10)
  ExtraServices                              DiabloCloud




                  Access the application
    End-Users                              Provisioned and
                                            Deployed App
Walkthrough (11)
  ExtraServices                                    DiabloCloud




    End-Users      Access the application


                                                 Provisioned and
                                                  Deployed App

  Administrator    Administers the application
Walkthrough (12)
  ExtraServices                                      DiabloCloud


                                                 System Administrator




                                                              Monitors

    End-Users      Access the application


                                                  Provisioned and
                                                   Deployed App

  Administrator    Administers the application
PaaS and Multitenancy: Some Models
1. PaaS Platform on Demand
  –   New runtime stack for each tenant

2. PaaS Multitenant Containers
  –   Isolated application partitions per tenant with shared runtime

3. SaaS Multitenant Applications
  –   Shared application instances, with tenant-specific customization

4. SaaS-limited
  –   Separate application instances, with tenant-specific
      customizations
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 or by injection
Java EE 7 Focus Area: Application Level Multi-
Tenancy
• Goal: Simple configuration
• Flexible tenant discriminator support
• Other areas impacted - JNDI, JMS, EJB …
     @Entity
     @Table(name=“EMP”)
     @MultiTenant(SINGLE_TABLE)
     @TenantDiscriminator(name=“department-id”, columnName=“DEPT_ID”)
     Public class Employee{
     EMP
        EMP_ID          VERSION       F_NAME         L_NAME         GENDER   DEPT_ID
           1                  1         John           Doe              M       1
           2                  3         Jane           Doe              F       2


     SELECT * FROM EMPLOYEE WHERE L_NAME LIKE ‘D%’ AND DEPT_ID= 1
Persistence Layer
Multi-tenant Taxonomies
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
  – 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
Java EE 7 – Candidate JSRs

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




                                                        Bean Validation 1.1
    s                                                                          Concurrency
                            Servlet 3.1                                         Utilities 1.0

                                                                                  State
      CDI 1.1 / Interceptors 1.1 / JSR 250 1.1                                Management 1.0

                                                                                  Batch
Managed Beans 1.0                   EJB 3.2                                   Processing 1.0

            JPA 2.1, JTA 1.1                 JMS 2.0                             JSON 1.0
Transparency
• Our 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 match JCP 2.8 Process
Status and Schedule


• Nearly all JSRs up and running
• Remaining ones to be filed in next few weeks
• Final release target: Q3 2012
• Date-driven release: anything not ready will be
  deferred to Java EE 8
How to Get in the Loop
• 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

• The NIST Definition of Cloud Computing -- Special Publication 800-145

   – http://1.usa.gov/ohXnlM
The Java EE 7 Platform: Developing for the Cloud

                                   Kshitiz Saxena

Java ee 7 platform developing for the cloud kshitiz saxena

  • 1.
    The Java EE7 Platform: Developing for the Cloud Kshitiz Saxena
  • 2.
    The following isintended 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.
  • 3.
    Java EE 6Implementations Fastest implementations of a Java EE release ever!
  • 4.
    Java EE –Developer Adoption Downloads 40 Million+ 45 Millions 40 35 30 25 20 15 10 5 0 FY 06 FY 07 FY 08 FY 09 FY 10 FY 11 FY 12
  • 5.
  • 6.
    What Do WeMean by “The Cloud”? • Infrastructure as a Service (IaaS) The capability provided to the consumer is to provision processing, storage, networks, and other fundamental computing resources where the consumer is able to deploy and run arbitrary software, which can include operating systems and applications. (NIST) • Platform as a Service (Paas) • Software as a Service (SaaS) (*) NIST Definition of Cloud Computing – 800-145
  • 7.
    What Do WeMean by “The Cloud”? • Infrastructure as a Service (IaaS) • Platform as a Service (Paas) The capability provided to the consumer is to deploy onto the cloud infrastructure consumer-created or acquired applications created using programming languages and tools supported by the provider. The consumer does not manage or control the underlying cloud infrastructure…, but has control over the deployed applications and possibly application hosting environment configurations. (NIST) • Software as a Service (SaaS) (*) NIST Definition of Cloud Computing – 800-145
  • 8.
    What Do WeMean by “The Cloud”? • Infrastructure as a Service (IaaS) • Platform as a Service (Paas) • Software as a Service (SaaS) The capability provided to the consumer is to use the provider’s applications running on a cloud infrastructure. The consumer does not manage or control the underlying cloud infrastructure…, with the possible exception of limited user-specific application configuration settings. (NIST) (*) NIST Definition of Cloud Computing – 800-145
  • 9.
    Today’s Cloud OfferingsAre Vendor-Specific Infrastructure as Platform as Software as a Service a Service a Service …
  • 10.
    Java EE 7Focus: Platform as a Service • Provide way for customers and users to leverage public, private, and hybrid clouds • PaaS support entails evolutionary change • 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
  • 11.
    Java EE 7PaaS Roadmap • Define new platform roles to accommodate PaaS model • Add metadata – For service provisioning and configuration – For QoS, elasticity – For sharing of applications and resources – For (re)configurability and customization • Add useful APIs for cloud environment – JAX-RS client API, Caching API, State Management, JSON,… • Extend existing APIs with support for multi-tenancy
  • 12.
  • 13.
    Java EE 7Focus Area: Cloud Services, Not Just APIs • In the cloud tenant applications Tenant App Tenant App Tenant App consume services Java EE Application Level Services • PaaS administrators host, Queuing Service Persistence Service Caching Service … configure, and manage PaaS Infrastructure Services application and infrastructure Security Provisioning File … services Service Service Service Platform as a Service - Services • Existing APIs in Java EE need to IaaS Infrastructure Services be updated to be service-enabled Virt VIP VLAN Volume LBR … and tenant-aware – Example: pluggable services, late binding Infrastructure as a Service and tenant id injection
  • 14.
    Old Java EEmodel 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/WAR/RAR…)
  • 15.
    Java EE 7Model: Auto-Provision Services from Application Dependencies • Provision and deploy application 1 Provision and Initialize Cloud Administration Service resources (e.g. LDAP stripe, data source instantiation and Database Service connection …) 2 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/WAR/RAR…) Container
  • 16.
    Services • Cloud appsconsume 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 )
  • 17.
    Services • Cloud appsconsume services – Persistence, queueing, mail, caching, … • Service metadata facilitates ease of use when deploying into the cloud @JMSConnectionFactory ( name=“java:app/myJMSConnectionFactory”, resourceType=“javax.jms.QueueConnectionFactory”) @JMSDestination( name=“java:app/myQueue”, resourceType=“javax.jms.Queue”)
  • 18.
    Services • Cloud appsconsume services – Persistence, queueing, mail, caching, … • Service metadata facilitates ease of use when deploying into the cloud @MailSession ( name=“java:app/mailSession”, from=“MyService@ExtraServices.com” )
  • 19.
    Services • Cloud appsconsume services – Persistence, queueing, mail, caching, … • Service metadata facilitates ease of use when deploying into the cloud @ConnectorService ( name=“java:app/myCustomConnector”, type=“com.extraServices.customConnector.class”, properties = {…} )
  • 20.
    Java EE 7Focus Area: 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
  • 21.
    Example Scenario “A softwarecompany 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”
  • 22.
    Walkthrough (1) SimplyCRM DiabloCloud
  • 23.
    Walkthrough (2) SimplyCRM DiabloCloud Application Developer Writes App
  • 24.
    Walkthrough (3) SimplyCRM DiabloCloud Signs up as a customer PaaS Customer PaaS Account Manager
  • 25.
    Walkthrough (4) SimplyCRM DiabloCloud Submits the application Application System Administrator Submitter App
  • 26.
    Walkthrough (5) ExtraServices DiabloCloud Discovers App
  • 27.
    Walkthrough (6) ExtraServices DiabloCloud Signs up as a customer PaaS Customer PaaS Account Manager App
  • 28.
    Walkthrough (7) ExtraServices DiabloCloud Deployer System Administrator Customizes and deploys the application App
  • 29.
    Walkthrough (8) ExtraServices DiabloCloud Deployer System Administrator Provisions on Cloud infrastructure App
  • 30.
    Walkthrough (9) ExtraServices DiabloCloud Deployer System Administrator Provisioned and Deployed App
  • 31.
    Walkthrough (10) ExtraServices DiabloCloud Access the application End-Users Provisioned and Deployed App
  • 32.
    Walkthrough (11) ExtraServices DiabloCloud End-Users Access the application Provisioned and Deployed App Administrator Administers the application
  • 33.
    Walkthrough (12) ExtraServices DiabloCloud System Administrator Monitors End-Users Access the application Provisioned and Deployed App Administrator Administers the application
  • 34.
    PaaS and Multitenancy:Some Models 1. PaaS Platform on Demand – New runtime stack for each tenant 2. PaaS Multitenant Containers – Isolated application partitions per tenant with shared runtime 3. SaaS Multitenant Applications – Shared application instances, with tenant-specific customization 4. SaaS-limited – Separate application instances, with tenant-specific customizations
  • 35.
    Multi-tenancy in JavaEE 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 or by injection
  • 36.
    Java EE 7Focus Area: Application Level Multi- Tenancy • Goal: Simple configuration • Flexible tenant discriminator support • Other areas impacted - JNDI, JMS, EJB … @Entity @Table(name=“EMP”) @MultiTenant(SINGLE_TABLE) @TenantDiscriminator(name=“department-id”, columnName=“DEPT_ID”) Public class Employee{ EMP EMP_ID VERSION F_NAME L_NAME GENDER DEPT_ID 1 1 John Doe M 1 2 3 Jane Doe F 2 SELECT * FROM EMPLOYEE WHERE L_NAME LIKE ‘D%’ AND DEPT_ID= 1
  • 37.
  • 38.
    Java EE 7Is 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 – 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
  • 39.
    Java EE 7– Candidate JSRs Web Jcache 1.0 JAX-RS JSP 2.2 CDI Container JSF 2.2 Extensions 2.0 EL 3.0 (JSR 107) Extension Bean Validation 1.1 s Concurrency Servlet 3.1 Utilities 1.0 State CDI 1.1 / Interceptors 1.1 / JSR 250 1.1 Management 1.0 Batch Managed Beans 1.0 EJB 3.2 Processing 1.0 JPA 2.1, JTA 1.1 JMS 2.0 JSON 1.0
  • 40.
    Transparency • Our JavaEE 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 match JCP 2.8 Process
  • 41.
    Status and Schedule •Nearly all JSRs up and running • Remaining ones to be filed in next few weeks • Final release target: Q3 2012 • Date-driven release: anything not ready will be deferred to Java EE 8
  • 42.
    How to Getin the Loop • 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 • The NIST Definition of Cloud Computing -- Special Publication 800-145 – http://1.usa.gov/ohXnlM
  • 43.
    The Java EE7 Platform: Developing for the Cloud Kshitiz Saxena