35
1 Java EE 6 - Update Harpreet Singh – GlassFish Portfolio Product Manager Sun Microsystems 1

Java EE 6 and GlassFish portfolio

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Java EE 6 and GlassFish portfolio

1

Java EE 6 - Update

Harpreet Singh – GlassFish Portfolio Product Manager

Sun Microsystems

1

Page 2: Java EE 6 and GlassFish portfolio

2

The Elephant In The Room

Page 3: Java EE 6 and GlassFish portfolio

3

Here's what I can ...

Show Say

Page 4: Java EE 6 and GlassFish portfolio

4

Business As Usual

Page 5: Java EE 6 and GlassFish portfolio

5

Business As Usual=

Participate in an active community+

Create a Great Product+

Kick Competitive Butt

Page 6: Java EE 6 and GlassFish portfolio

6

Any Questions?

Page 7: Java EE 6 and GlassFish portfolio

7

Business @ HandJava EE 6 Update

Page 8: Java EE 6 and GlassFish portfolio

8

JPE

Project

J2EE 1.2Servlet, JSP,

EJB, JMSRMI/IIOP

J2EE 1.3CMP,

Connector

Architecture

J2EE 1.4Web Services,

Management,

Deployment,

Async.

Connector

Java EE 5Ease of

Development

Annotations

EJB 3.0

Persistence API

New and

Updated

Web Services

Robustness

Web Services

Enterprise Java Platform

Java EE 6EJB Lite

Restful WS

Web Beans

Extensibility

Java EE 6Web Profile

Ease ofDevelopment

Right Sizing

Java EE: Past & Present

Page 9: Java EE 6 and GlassFish portfolio

9

Over 18M Downloads since FY'06

Active Users

Java EE Adoption

FY 06 FY 07 FY 08 FY 09

0

2000000

4000000

6000000

8000000

10000000

12000000

Y/Y Download Growth

Add. ForcastYTD

Page 10: Java EE 6 and GlassFish portfolio

10

Compatible Java EE 5 Implementations

Page 11: Java EE 6 and GlassFish portfolio

11

Goals for the Java EE 6 Platform

• “Right Sizing”● Flexible, lighter weight

• Extensible● Embrace Open Source Frameworks

• Easier to use, develop on● Continue on path set by Java EE 5

Page 12: Java EE 6 and GlassFish portfolio

12

Right Sizing the Platform: Profiles• Make platform flexible

> Decouple specifications to allow more combinations

> Expands potential licensee ecosystem> Profiles

● Targeted technology bundles● Defined through the JCP● First profile: Web Profile

– Defined by the Java EE 6 Expert Group

Page 13: Java EE 6 and GlassFish portfolio

13

Web Profile• Fully functional mid-sized profile

> Actively discussed in Java EE Expert Group and outside it

> Technologies*● Servlet 3.0, EJB Lite 3.1, JPA 2.0, JSP 2.2, EL 1.2, JSTL 1.2,

JSF 2.0, JTA 1.1, JSR-45, JSR-250

*Final set of technologies will be determined by the platform EG

Page 14: Java EE 6 and GlassFish portfolio

14

Right Sizing the Platform: Pruning

• Make platform lighter> Makes some technologies optional> Pruned today, means

● Optional in the next release● Deleted in the subsequent release

> Pruned Technologies will be marked in the javadocs> Current pruning list

● JAX-RPC, EJB 2.X Entity Beans, JAXR, JSR-88

Page 15: Java EE 6 and GlassFish portfolio

15

Extensibility• Embrace open source libraries and frameworks• Zero-configuration, drag-and-drop for web frameworks

> Servlets, servlet filters, context listeners for a framework get discovered and registered automatically

• Plugin library jars using web fragments

Page 16: Java EE 6 and GlassFish portfolio

16

Ease of Development

• Continue advancements of Java EE 5• Primary focus: Web Tier• Multiple Areas easier to use: EJB 3.1• General principles

> Annotation-based programming model> Reduce or eliminate need for deployment descriptors> Traditional API for advanced users

Page 17: Java EE 6 and GlassFish portfolio

17

Ease of Development: Adding an EJB to a Web Application

BuyBooks.warShoppingCart

EJB Class

ShoppingCart.jar

BuyBooks.ear

Java EE 5

ShoppingCart EJB Class

BuyBooks.war

Java EE 6

Page 18: Java EE 6 and GlassFish portfolio

18

EoD Example - Annotations

<!--Deployment descriptor web.xml -->

<web-app><servlet>

<servlet-name>MyServlet

</servlet-name> <servlet-class> com.foo.MyServlet </servlet-class> </servlet> <servlet-mapping> <servlet-name>MyServlet </servlet-name> <url-pattern>/myApp/* </url-pattern> </servlet-mapping> ... </web-app>

Servlet in Java EE 5: Create two source files

/* Code in Java Class */

package com.foo;public class MyServlet extends HttpServlet {public void doGet(HttpServletRequest req,HttpServletResponse res)

{

...

}

...

}

Page 19: Java EE 6 and GlassFish portfolio

19

EoD Example - AnnotationsServlet in Java EE 6: In many cases a single source file

package com.foo;@WebServlet(name=”MyServlet”, urlPattern=”/myApp/*”)public class MyServlet {

public void doGet(HttpServletRequest req, HttpServletResponse res)

{...

}

Page 20: Java EE 6 and GlassFish portfolio

20

Java EE 6 Status

•Public reviews completed•Majority of the specs are in Proposed Final Draft•Preview release available for JavaOne

> Reference Implementation is GlassFish V3> Regular RI source drops started

•Final release in Q3> Targeted for September

• Making the process more open

Page 21: Java EE 6 and GlassFish portfolio

21

Java EE JSR Status

• EJB 3.1 PFD

• JPA 2.0PFD

• Servlet 3.0PFD

• JSF 2.0FD Submitted

• Java EE 6.0PFD June

> Platform> Managed Beans> Web Profile

• Connectors 1.6PFD

• JCDI 1.0PFD June

• Bean ValidationPFD

Page 22: Java EE 6 and GlassFish portfolio

22

Java EE JSR Status Continued

• JACC 1.3 MR Final

• JASPIC 1.1 MR Final

• JSR 250 1.1 MR Soon

• JAXB 2.2 MR Final

• JAX-RS 1.1 MR Final

• JAX-WS 2.2 MR Final

• EL 2.2 MR Final

• JSP 2.2 MR Final

Page 23: Java EE 6 and GlassFish portfolio

23

Servlet 3.0

• Use of annotations for greater ease of development

• Optional web.xml

• Better defaults

• Enable web framework pluggability

• Support for asynchronous processing

• Alignments with JSF 2.0 and JAX-RS 1.0

Page 24: Java EE 6 and GlassFish portfolio

24

Servlet 3.0

• Annotation-based programming model> @WebServlet @WebFilter etc.

• Modular web.xml descriptor:> WEB-INF/lib/mylibrary.jar ->

Meta_INF/web-fragment.xml

• Annotations and web fragments are merged

• Programmatic API for dynamic registration of servlets

Page 25: Java EE 6 and GlassFish portfolio

25

Servlet 3.0 Async API

• Useful for Comet, chat rooms, long waits• Must declare @WebServlet(asyncSupported=true)• Then call

AsyncContext ctx = ServletRequest.startAsync(req,res);

• AsyncContext can then either:dispatch(String path)start(Runnable action)

• AsyncContext.start(Runnable) must be paired with:complete()

Page 26: Java EE 6 and GlassFish portfolio

26

EJB 3.1Ease-of-use improvements• No-interface view

> One source file per bean

• Allow EJB component classes inside a web app> No ejb-jar> Use WEB-INF/classes> Shared component environment

Page 27: Java EE 6 and GlassFish portfolio

27

EJB 3.1• Singleton beans: @Singleton

> Shared state> One instance per bean per server JVM> Support for container-managed concurrency and

bean-managed concurrency@ConcurrencyManagement

• Light-weight asynchronicity> Async business methods @Asynchronous> Methods must return void or Future<T>

Page 28: Java EE 6 and GlassFish portfolio

28

EJB 3.1• EJB Timer Service enhancements

> Cron-like scheduling> Initialization-time timer creation

@Schedule(dayOfWeek=”Mon,Wed”)

• Embeddable EJB container> Provides use in Java SE environments> Bootstrapping API

EJBContainer

Page 29: Java EE 6 and GlassFish portfolio

29

EJB 3.1 Lite

Proper, portable subset of EJB 3.1• Session beans (stateless, stateful, singletons)

> Local, no-interface views

• Transactions• Security• Interceptors• ejb-jar.xml or annotations• Embeddable container API: EJBContainer• OK to bootstrap on Java SE

Page 30: Java EE 6 and GlassFish portfolio

30

Web Beans 1.0• Adds contextual services to the platform• Unifies JSF managed beans and EJB components• Dependency injection framework

> @LoggedIn User user;

• Binding type to select among alternatives• Built-in scope management (request, session,

conversation, application scopes)• Deployment types to select families of beans (e.g.

mock)• Programmatic API: Manager, Bean, Context

Page 31: Java EE 6 and GlassFish portfolio

31

Removing Barriers

• EJB components can be placed in web applications> No need to wrap them in an EJB jar archive

• Web Beans has a unified EL resolver> Place @Named(“foo”) on a bean to give it a name> Use “#{foo}” to refer to it from JSR

• Unify @Resource-style injection with Web Beans• Apply javax.interceptor more widely

Page 32: Java EE 6 and GlassFish portfolio

32

Java Persistence API 2.0

• Expanded object/relational mapping functionality• Additions to the Java Persistence query language• Metamodel API• Type-safe Criteria API• Pessimistic locking• Standardized caching configuration• Support for automatic validation

Page 33: Java EE 6 and GlassFish portfolio

33

JSF 2.0

• Easier to develop components• Better leverage annotations• Declarative renderers• View description language (similar to Facelets,

JSFTemplating, Tiles)• Intuitive Ajax for JSF• Additions to the render kit: calendar, tree, tab view,

etc.• Streamlined rendering process via caching• Scripting

Page 34: Java EE 6 and GlassFish portfolio

34

Summary

•Right Sizing> Profiles> Pruning

•Extensible•Ease of use and development• RI and source code

available today

•More Information> Java EE Hub

● http://java.sun.com/javaee

> Java EE SDK Downloads● http://java.sun.com/javaee/downloads

> JCP > http://jcp.org/en/jsr/detail?id=316

Page 35: Java EE 6 and GlassFish portfolio

35

GLASSFISHQ&A