1
<Insert Picture Here>




Java EE 7: Developing for the Cloud
Martin Grebac
Metro / JAXWS / JAXB Project Lead
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.




                                                      3
Agenda

•   Java EE 7 theme
•   Main features
•   Component JSRs
•   Transparency
•   Status and Schedule
•   Roadmap




                          4
Java EE 7 Theme: The Cloud




                             5
What Do We Mean by “The Cloud”?

• Infrastructure as a Service (IaaS) ?
• Platform as a Service (PaaS) ?
• Software as a Service (SaaS) ?




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




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




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




                                                                     9
Support for Platform-as-a-Service Model
 (Paas)
• Next logical step in extending value proposition of
  Java EE platform
  • Provide a way for customers and users of Java EE to
    leverage private and public clouds
• PaaS support entails evolutionary change
  • New platform roles; some modifications to existing roles
  • Small programming model changes
  • Multitenancy
• Java EE 7 is the first step
  • An evolutionary step, not a radical one
  • May include limited support for SaaS


                                                               10
Java EE 7 Cloud 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 multitenancy



                                                             11
Roles
                Developer                                             PaaS Provider

          PaaS
      Customer/
         Tenant                                                            PaaS Product
                                                                             Provider


     Deployer               JVM JVM JVM   JVM JVM JVM   JVM JVM JVM

                              Machine       Machine       Machine


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

                                                                           PaaS
        Application                                                     Administrator
      Administrator




                                                                                        12
Services
• Cloud applications 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
 )
 @JMSConnectionFactoryDefinition (
   name=“java:app/jms/myJMSConnectionFactory”,
   className=“javax.jms.QueueConnectionFactory”
 )
 @MailSessionDefinition (
   name=“java:app/mailSession”,
   from=MyService@ExtraServices.com
 )

                                                    13
Old Java EE Model

•   Configure Java EE resources – JDBC, JMS etc
•   Deploy Application EAR




                                                  14
Java EE 7 Model

• Provision and deploy application
resources (e.g. LDAP stripe, data
source instantiation and connection …)
•       Extensible Deployment Models Supporting
        Multiple Frameworks
    •   Spring, Seam, Play …




                                                  15
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
(3*) SaaS-limited
  • Separate application instances, with tenant-specific
    customizations




                                                                     16
Multitenancy in Java EE 7

• Support for separate isolated instances of the same
  app for different tenants
  •   One application instance per tenant
  •   Each instance is customized and deployed for a single tenant
  •   “SaaS-limited”
  •   Allow shared resources
• “SaaS-proper” deferred to Java EE 8




                                                                     17
Tenants

• Tenants correspond to the unit of isolation
• Mapping to a tenant done by the container
  • E.g., using virtual servers
• Apps are marked as Multitenancy-Enabled
  • Possible restrictions on application code
• Tenant identifier available to application
  • E.g., under java:comp/tenantId




                                                18
Multitenancy and Resources

• Separate database, shared nothing
  • Best isolation
  • Resource intensive
• Shared database, separate schema
  • Database provides isolation at schema-level
  • Less resource intensive
• Shared database, shared schema
  • Isolation happens at row level !
  • Least resource intensive




                                                  19
Application Level Multi Tenancy
@Entity
@Table(name=“EMP”)
@MultiTenant(SINGLE_TABLE)
@TenantDiscriminator(name=“company-id”, columnName=“COMPANY”)
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




                                                                    20
Dedicated App, Dedicated Database




                                    21
Shared App, Dedicated Database




                                 22
Dedicated App, Shared Database




                                 23
Shared App, Shared Database




                              24
New and Updated Roles

         Cloud Vendor                   Cloud Customer

•   Java EE Product Provider   •   PaaS Customer (Tenant)
•   PaaS Provider              •   Application Submitter
•   PaaS Account Manager       •   Deployer
•   System Administrator       •   Application Administrator
                               •   End-User




                                                               25
Use Cases / Scenarios

• Java EE vendor becomes a PaaS product vendor

• A PaaS provider wants to support Java EE applications

• A PaaS customer writes a web application, deploys it to
  a cloud infrastructure, end users access it

• 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


                                                              26
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”




                                              27
Walkthrough (1)
SimplyCRM         DiabloCloud




                                28
Walkthrough (2)
SimplyCRM         DiabloCloud

Application
Developer

         Writes


   App




                                29
Walkthrough (3)
SimplyCRM                            DiabloCloud

  PaaS      Signs up as a customer     PaaS
 Customer                             Account
                                      Manager




                                                   30
Walkthrough (4)
SimplyCRM                               DiabloCloud

Application   Submits the application     System
Submitter                               Administrator

                                        App




                                                        31
Walkthrough (5)
ExtraServices                 DiabloCloud
                  Discovers

                              App




                                            32
Walkthrough (6)
ExtraServices                            DiabloCloud

  PaaS          Signs up as a customer     PaaS
 Customer                                 Account
                                          Manager

                                         App




                                                       33
Walkthrough (7)
ExtraServices                             DiabloCloud

                   Customizes and
  Deployer                                  System
                deploys the application
                                          Administrator


                                          App




                                                          34
Walkthrough (8)
ExtraServices           DiabloCloud

  Deployer               System
                       Administrator

                  Provisions on
                          Cloud
                  infrastructure

                              App




                                       35
Walkthrough (9)
ExtraServices     DiabloCloud

  Deployer          System
                  Administrator




                    Provisioned
                        and
                     Deployed
                        App




                                  36
Walkthrough (10)
ExtraServices                            DiabloCloud




 End-Users      Access the application
                                          Provisioned
                                              and
                                           Deployed
                                              App




                                                        37
Walkthrough (11)
ExtraServices                                 DiabloCloud




 End-Users      Access the application
                                               Provisioned
                                                   and
                                                Deployed
                                                   App
Administrator   Administers the application




                                                             38
Walkthrough (12)
ExtraServices                                 DiabloCloud

                                                System
                                              Administrator


                                                       Monitors

 End-Users      Access the application
                                                Provisioned
                                                    and
                                                 Deployed
                                                    App
Administrator   Administers the application




                                                              39
Other Topics on the Java EE 7 Agenda

• Alignment of Managed Beans across CDI, EJB, JSF,
  Servlet, …
  • Extension of container-managed transactions beyond EJB
• Further simplifications for ease-of-development
  • Expanded use of dependency injection
  • Expanded service metadata; improved configuration
• Pruning
  • EJB CMP/BMP, JAX-RPC, Deployment API
• Update to Web Profile
• …




                                                             40
Java EE 7 JSRs

•   Platform 7 / Web Profile 7   •   Bean Validation 1.1
•   JPA 2.1                      •   State Management 1.0
•   JAX-RS 2.0                   •   JSON 1.0
•   EJB 3.2                      •   Batch Processing1.0
•   JMS 2.0                      •   Common Annotations 1.2 MR
•   Servlet 3.1                  •   JTA 1.2 MR
•   EL 3.0                       •   JSP 2.3 MR
•   JSF 2.2                      •   JASPIC 1.3 MR
•   CDI 1.1
•   JCache 1.0 (JSR 107)
•   Concurrency Utilities 1.0



                                                                 41
Transparency

• High level of transparency for all Java EE JSRs
• Using java.net projects to run our JSRs in the open
    • One java.net project per specification
    • E.g., javaee-spec, jpa-spec, jax-rs-spec, ejb-spec,…
•   Publicly viewable Expert Group mailing list archive
•   Users observer list gets copies of all emails to the EG
•   Download area
•   JIRA for issue tracking
•   Wiki, source repository, etc. at the group’s discretion
•   JCP.org private mailing list for administrative /
    confidential info


                                                              42
Status and Schedule

•   Nearly all JSRs up and running
•   Remaining ones to be filed in the coming weeks
•   Final release 2012
•   Date-driven release: anything not ready will be
    deferred to Java EE 8




                                                      43
To Get in the Loop

• Java EE 7 java.net project
  • Archives, documents, mailing lists,…
    http://java.net/projects/javaee-spec
• Component projects
    http://java.net/projects/XXX-spec
  (where XXX = jpa, ejb, jms, servlet, jax-rs, jsf,…)
• Send us feedback
  • users@javaee-spec.java.net
  • linda.demichiel@oracle.com




                                                        44
The preceding 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.




                                                      45

Java EE7: Developing for the Cloud

  • 1.
  • 2.
    <Insert Picture Here> JavaEE 7: Developing for the Cloud Martin Grebac Metro / JAXWS / JAXB Project Lead
  • 3.
    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
  • 4.
    Agenda • Java EE 7 theme • Main features • Component JSRs • Transparency • Status and Schedule • Roadmap 4
  • 5.
    Java EE 7Theme: The Cloud 5
  • 6.
    What Do WeMean by “The Cloud”? • Infrastructure as a Service (IaaS) ? • Platform as a Service (PaaS) ? • Software as a Service (SaaS) ? 6
  • 7.
    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) 7
  • 8.
    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) 8
  • 9.
    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) 9
  • 10.
    Support for Platform-as-a-ServiceModel (Paas) • Next logical step in extending value proposition of Java EE platform • Provide a way for customers and users of Java EE to leverage private and public clouds • PaaS support entails evolutionary change • New platform roles; some modifications to existing roles • Small programming model changes • Multitenancy • Java EE 7 is the first step • An evolutionary step, not a radical one • May include limited support for SaaS 10
  • 11.
    Java EE 7Cloud 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 multitenancy 11
  • 12.
    Roles Developer PaaS Provider PaaS Customer/ Tenant PaaS Product Provider Deployer JVM JVM JVM JVM JVM JVM JVM JVM JVM Machine Machine Machine PaaS Account Application JVM JVM JVM JVM JVM JVM JVM JVM JVM Manager Submitter Machine Machine Machine Tenant 1 Tenant 2 Tenant 3 PaaS Application Administrator Administrator 12
  • 13.
    Services • Cloud applicationsconsume 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 ) @JMSConnectionFactoryDefinition ( name=“java:app/jms/myJMSConnectionFactory”, className=“javax.jms.QueueConnectionFactory” ) @MailSessionDefinition ( name=“java:app/mailSession”, from=MyService@ExtraServices.com ) 13
  • 14.
    Old Java EEModel • Configure Java EE resources – JDBC, JMS etc • Deploy Application EAR 14
  • 15.
    Java EE 7Model • Provision and deploy application resources (e.g. LDAP stripe, data source instantiation and connection …) • Extensible Deployment Models Supporting Multiple Frameworks • Spring, Seam, Play … 15
  • 16.
    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 (3*) SaaS-limited • Separate application instances, with tenant-specific customizations 16
  • 17.
    Multitenancy in JavaEE 7 • Support for separate isolated instances of the same app for different tenants • One application instance per tenant • Each instance is customized and deployed for a single tenant • “SaaS-limited” • Allow shared resources • “SaaS-proper” deferred to Java EE 8 17
  • 18.
    Tenants • Tenants correspondto the unit of isolation • Mapping to a tenant done by the container • E.g., using virtual servers • Apps are marked as Multitenancy-Enabled • Possible restrictions on application code • Tenant identifier available to application • E.g., under java:comp/tenantId 18
  • 19.
    Multitenancy and Resources •Separate database, shared nothing • Best isolation • Resource intensive • Shared database, separate schema • Database provides isolation at schema-level • Less resource intensive • Shared database, shared schema • Isolation happens at row level ! • Least resource intensive 19
  • 20.
    Application Level MultiTenancy @Entity @Table(name=“EMP”) @MultiTenant(SINGLE_TABLE) @TenantDiscriminator(name=“company-id”, columnName=“COMPANY”) 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 20
  • 21.
  • 22.
  • 23.
  • 24.
    Shared App, SharedDatabase 24
  • 25.
    New and UpdatedRoles Cloud Vendor Cloud Customer • Java EE Product Provider • PaaS Customer (Tenant) • PaaS Provider • Application Submitter • PaaS Account Manager • Deployer • System Administrator • Application Administrator • End-User 25
  • 26.
    Use Cases /Scenarios • Java EE vendor becomes a PaaS product vendor • A PaaS provider wants to support Java EE applications • A PaaS customer writes a web application, deploys it to a cloud infrastructure, end users access it • 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 26
  • 27.
    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” 27
  • 28.
  • 29.
    Walkthrough (2) SimplyCRM DiabloCloud Application Developer Writes App 29
  • 30.
    Walkthrough (3) SimplyCRM DiabloCloud PaaS Signs up as a customer PaaS Customer Account Manager 30
  • 31.
    Walkthrough (4) SimplyCRM DiabloCloud Application Submits the application System Submitter Administrator App 31
  • 32.
    Walkthrough (5) ExtraServices DiabloCloud Discovers App 32
  • 33.
    Walkthrough (6) ExtraServices DiabloCloud PaaS Signs up as a customer PaaS Customer Account Manager App 33
  • 34.
    Walkthrough (7) ExtraServices DiabloCloud Customizes and Deployer System deploys the application Administrator App 34
  • 35.
    Walkthrough (8) ExtraServices DiabloCloud Deployer System Administrator Provisions on Cloud infrastructure App 35
  • 36.
    Walkthrough (9) ExtraServices DiabloCloud Deployer System Administrator Provisioned and Deployed App 36
  • 37.
    Walkthrough (10) ExtraServices DiabloCloud End-Users Access the application Provisioned and Deployed App 37
  • 38.
    Walkthrough (11) ExtraServices DiabloCloud End-Users Access the application Provisioned and Deployed App Administrator Administers the application 38
  • 39.
    Walkthrough (12) ExtraServices DiabloCloud System Administrator Monitors End-Users Access the application Provisioned and Deployed App Administrator Administers the application 39
  • 40.
    Other Topics onthe Java EE 7 Agenda • Alignment of Managed Beans across CDI, EJB, JSF, Servlet, … • Extension of container-managed transactions beyond EJB • Further simplifications for ease-of-development • Expanded use of dependency injection • Expanded service metadata; improved configuration • Pruning • EJB CMP/BMP, JAX-RPC, Deployment API • Update to Web Profile • … 40
  • 41.
    Java EE 7JSRs • Platform 7 / Web Profile 7 • Bean Validation 1.1 • JPA 2.1 • State Management 1.0 • JAX-RS 2.0 • JSON 1.0 • EJB 3.2 • Batch Processing1.0 • JMS 2.0 • Common Annotations 1.2 MR • Servlet 3.1 • JTA 1.2 MR • EL 3.0 • JSP 2.3 MR • JSF 2.2 • JASPIC 1.3 MR • CDI 1.1 • JCache 1.0 (JSR 107) • Concurrency Utilities 1.0 41
  • 42.
    Transparency • High levelof transparency for all Java EE JSRs • Using java.net projects to run our JSRs in the open • One java.net project per specification • E.g., javaee-spec, jpa-spec, jax-rs-spec, ejb-spec,… • Publicly viewable Expert Group mailing list archive • Users observer list gets copies of all emails to the EG • Download area • JIRA for issue tracking • Wiki, source repository, etc. at the group’s discretion • JCP.org private mailing list for administrative / confidential info 42
  • 43.
    Status and Schedule • Nearly all JSRs up and running • Remaining ones to be filed in the coming weeks • Final release 2012 • Date-driven release: anything not ready will be deferred to Java EE 8 43
  • 44.
    To Get inthe Loop • Java EE 7 java.net project • Archives, documents, mailing lists,… http://java.net/projects/javaee-spec • Component projects http://java.net/projects/XXX-spec (where XXX = jpa, ejb, jms, servlet, jax-rs, jsf,…) • Send us feedback • users@javaee-spec.java.net • linda.demichiel@oracle.com 44
  • 45.
    The preceding 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. 45