+ All Categories
Home > Technology > Java Summit Chennai: Java EE 7

Java Summit Chennai: Java EE 7

Date post: 11-Nov-2014
Category:
Upload: arun-gupta
View: 6,376 times
Download: 0 times
Share this document with a friend
Description:
Java Summit Chennai: Java EE 7
49
Main sponsor The Java EE 7 Pla,orm: Developing for the Cloud Arun Gupta, Java EE & GlassFish Guy blogs.oracle.com/arungupta, @arungupta
Transcript
Page 1: Java Summit Chennai: Java EE 7

Main sponsor

The  Java  EE  7  Pla,orm:  Developing  for  the  Cloud  Arun  Gupta,  Java  EE  &  GlassFish  Guy  blogs.oracle.com/arungupta,  @arungupta  

Page 2: Java Summit Chennai: Java EE 7

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

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.

Page 3: Java Summit Chennai: Java EE 7

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

Java EE 6 Platform December 10, 2009

Page 4: Java Summit Chennai: Java EE 7

4 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

Page 5: Java Summit Chennai: Java EE 7

5 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

Page 6: Java Summit Chennai: Java EE 7

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

Today’s Cloud Offerings are all Proprietary

Infrastructure as a Service

Platform as a Service

Software as a Service

Page 7: Java Summit Chennai: Java EE 7

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

Java EE 7

Page 8: Java Summit Chennai: Java EE 7

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

Java EE 7 and 8 – Focus Areas

Cloud

•  Provisioning

•  Elastic & Autonomic Scalability

• Multi-Tenancy

Modularity

•  Building on Jigsaw

•  Focus on OSGi interop

•  Supporting Profiles & Modular Applications

HTML5

•  Emerging Web Standards require a programming model

•  JSON, WebSockets, off-line, APIs & DOM

Page 9: Java Summit Chennai: Java EE 7

9 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

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

Page 10: Java Summit Chennai: Java EE 7

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

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

Page 11: Java Summit Chennai: Java EE 7

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

Roles

Developer

PaaS Customer/

Tenant

Application Submitter

Application Administrator

PaaS Provider

PaaS Product Provider

PaaS Account Manager

PaaS Administrator

Deployer

Tenant 1 Tenant 2 Tenant 3

Machine

JVM

JVM

JVM

Machine

JVM

JVM

JVM

Machine

JVM

JVM

JVM

Machine

JVM

JVM

JVM

Machine

JVM

JVM

JVM

Machine

JVM

JVM

JVM

Page 12: Java Summit Chennai: Java EE 7

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

Existing Java EE model

• Configure Java EE resources – JDBC, JMS etc

• Deploy Application EAR

Database Service 1  

2  

4  

5  

LDAP Service

Provision and Initialize

Provision and Initialize

Provision and Initialize

Provision and Initialize

3  

Messaging Service

Application Container

Deploy Application (EAR/GAR/SAR …)

Page 13: Java Summit Chennai: Java EE 7

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

Java EE 7 Model: Auto-Provision Services from Application Dependencies

•  Provision and deploy application resources (e.g. LDAP stripe, data source instantiation and connection …) •  Extensible Deployment Models

Supporting Multiple Frameworks •  Spring, Seam, Play …

Database Service

Cloud Administration Service 1  

2  

4  

5  

LDAP Service

Provision and Initialize

Provision and Initialize

Provision and Initialize

Provision and Initialize

3  

Messaging Service

Application Container Deploy Application (EAR/

GAR/SAR …)

Page 14: Java Summit Chennai: Java EE 7

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 @DataSourceDefinition(!

name=“java:app/jdbc/myDB”,!

className=“oracle.jdbc.pool.OracleDataSource”,! isolationLevel=TRANSACTION_REPEATABLE_READ,!

initialPoolSize=5!

) !

Page 15: Java Summit Chennai: Java EE 7

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 @JMSConnectionFactory (!

name=“java:app/myJMSConnectionFactory”,!

resourceType=“javax.jms.QueueConnectionFactory”) !!

@JMSDestination(!

name=“java:app/myQueue”,!

resourceType=“javax.jms.Queue”)!

Page 16: Java Summit Chennai: Java EE 7

16 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 @MailSession (!

name=“java:app/mailSession”,!

from=“[email protected]”!) !

Page 17: Java Summit Chennai: Java EE 7

17 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 @ConnectorService (!

name=“java:app/myCustomConnector”,!

type=“com.extraServices.customConnector.class”,! properties = {…}!) !

Page 18: Java Summit Chennai: Java EE 7

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

Elasticity

•  Service Levels • Minimum and Maximum Instances •  Futures – Self Adjustment, Capacity On Demand

Elasticity Continuum

Single node Non-Elastic

Dynamic Self Adjusting SLA Driven Elasticity

Java EE Multi-Node Multi-Instance Clustering

Java EE 7 Focus: Move the Bar Right

Java EE Cluster Ca

Elastic Cluster Capacity

on Demand

Elastic Cluster

Page 19: Java Summit Chennai: Java EE 7

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

Page 20: Java Summit Chennai: Java EE 7

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

Walkthrough (1) DiabloCloud  SimplyCRM  

Page 21: Java Summit Chennai: Java EE 7

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

Walkthrough (2) SimplyCRM  

ApplicaDon  Developer  

App

Writes

DiabloCloud  

Page 22: Java Summit Chennai: Java EE 7

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

Walkthrough (3)

PaaS  Account  Manager  PaaS  Customer  Signs up as a customer

SimplyCRM   DiabloCloud  

Page 23: Java Summit Chennai: Java EE 7

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

Walkthrough (4)

Application Submitter

App

Submits the application System  Administrator  

SimplyCRM   DiabloCloud  

Page 24: Java Summit Chennai: Java EE 7

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

Walkthrough (5) ExtraServices  

App Discovers

DiabloCloud  

Page 25: Java Summit Chennai: Java EE 7

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

Walkthrough (6)

PaaS  Customer  Signs up as a customer

DiabloCloud  ExtraServices  

PaaS  Account  Manager  

App

Page 26: Java Summit Chennai: Java EE 7

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

App

Walkthrough (7)

Deployer  Customizes and deploys the application

DiabloCloud  ExtraServices  

System  Administrator  

Page 27: Java Summit Chennai: Java EE 7

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

App

Walkthrough (8)

Provisions on Cloud

infrastructure

DiabloCloud  ExtraServices  

System  Administrator  Deployer  

Page 28: Java Summit Chennai: Java EE 7

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

Walkthrough (9)

Provisioned and Deployed App

DiabloCloud  ExtraServices  

System  Administrator  Deployer  

Page 29: Java Summit Chennai: Java EE 7

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

Walkthrough (10)

End-­‐Users  Access the application

DiabloCloud  ExtraServices  

Provisioned and Deployed App

Page 30: Java Summit Chennai: Java EE 7

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

Walkthrough (11)

End-­‐Users   Access the application

Administrator   Administers the application

DiabloCloud  ExtraServices  

Provisioned and Deployed App

Page 31: Java Summit Chennai: Java EE 7

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

Walkthrough (12)

Monitors

DiabloCloud  ExtraServices  

System  Administrator  

End-­‐Users   Access the application

Administrator   Administers the application

Provisioned and Deployed App

Page 32: Java Summit Chennai: Java EE 7

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

Demo PaaSing a Java EE Application in the Cloud

glassfish.org/javaone2011

Page 33: Java Summit Chennai: Java EE 7

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

Conference Planning in the Cloud

Java EE Application

Deploy

EJB Services Metadata

JSF JPA

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

Page 34: Java Summit Chennai: Java EE 7

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

Service Provisioning

Database

Java EE Java EE Java EE . . .

Load Balancer

Page 35: Java Summit Chennai: Java EE 7

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

Page 36: Java Summit Chennai: Java EE 7

36 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

Page 37: Java Summit Chennai: Java EE 7

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

Java EE 7 – Candidate JSRs

JPA 2.1

Managed Beans 1.0 EJB 3.2

CDI 1.1 / Interceptors 1.1 / JSR 250 1.1

Servlet 3.1

CDI Extensions

JSF 2.2 JSP 2.2

JAX-RS 2.0

Web Container

Extensions

Bea

n Va

lidat

ion

1.1

JMS 2.0

Jcache 1.0 (JSR 107)

Concurrency Utilities 1.0 (JSR 236)

State Management 1.0

Batch Processing 1.0

JSON 1.0 (JSR 353) JTA 1.1

EL 3.0

Page 38: Java Summit Chennai: Java EE 7

38 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

Page 39: Java Summit Chennai: Java EE 7

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

Java API for RESTful Web Services 2.0

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

Page 40: Java Summit Chennai: Java EE 7

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

Page 41: Java Summit Chennai: Java EE 7

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

Page 42: Java Summit Chennai: Java EE 7

42 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 Entity Beans, JAX-RPC Web service endpoint –  Interceptors

•  Alignment with JMS 2.0

Page 43: Java Summit Chennai: Java EE 7

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

Bean Validation 1.1

• Open: Spec, Reference Implementation, TCK • Method-level validation • Dependency Injection

@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  quanDty)  {                //...              }    }  

Page 44: Java Summit Chennai: Java EE 7

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

Java Message Service 2.0

•  Connection, Session and other objects are AutoCloseable

•  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

• New methods – no need for redundant arguments

Page 45: Java Summit Chennai: Java EE 7

45 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

Page 46: Java Summit Chennai: Java EE 7

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

Status and Schedule

•  All JSRs up and running

•  Early Drafts –  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

Page 47: Java Summit Chennai: Java EE 7

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

GlassFish Roadmap

2009 2010 2011

GlassFish Server 3.1.2 •  Bug Fixes •  Incremental features

GlassFish Server 3.1 •  Centralized administration •  Clustering / HA •  GlassFish Server Control

2012

GlassFish Server 4 •  Java EE 7 •  Multitenancy •  PaaS-enablement

GlassFish v3 •  Java EE 6 support •  Single instance •  GlassFish Enterprise Mgr

GlassFish Server 3.0.1 •  Oracle branding •  Oracle platform support •  Oracle interoperability

GlassFish Server 3.1.1 •  Bug fixes •  Updated components •  Incremental features

2013

Page 48: Java Summit Chennai: Java EE 7

48 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

Page 49: Java Summit Chennai: Java EE 7

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


Recommended