Sie sind auf Seite 1von 12

25/11/2009

What's New with Java EE 6?

Agenda
Java EE 6 Overview
Servlet 3.0
JavaServer Faces 2.0 EJB 3.1 Web Beans 1.0 (formly) JSR-299

Overall goal for Java EE 6


Make the platform
Easier to use, Easier to learn. Easier Extensibility More ways to integrate frameworks.

Easier to Evolve The size and wideness of the Java EE has made it

difficult to evolve. Profiles and Pruning should take care of that.


SOA Better support for SOA is also defired as a goal of the new

spec.

25/11/2009

Java SE 6 Timeline

Java EE 6 Timeline

Java EE: Past & Present

25/11/2009

Major new features


Profiles Pruning Extensibility Ease of development.

Profiles
Profiles are targeted bundles of technologies

(Simple) rules set by platform spec.


Profiles can be subsets, supersets or overlapping. Decoupling of specs to allow more combinations Two profiles available: Full profile (including all technologies) Web profile (including a subset of technologies)

Web Profile
Much discussion in the expert group and outside it Latest proposal: a fully functional mid-sized profile Accepted:
Servlet 3.0, JSP 2.1, JSR-45 (Debugging), EL 1.2, JSTL 1.2,

JSF 2.0
EJB Lite 3.1, JTA 1.1, JPA 2.0, JSR-250 (Annotations)

Controversial:
JAX-RS 1.1, Web Beans 1.0, JSR-303 Bean Validation

25/11/2009

Pruning
Make some technologies optional A component marked pruned at the current version may

become optional in the next version.


Pruned technologies will be marked in the javadocs. Current Pruning list:
JAX-RPC Replaced by JAX-WS EJB Entity Bean Replaced by JPA

JAXR API for XML Registries, never widely adopted.


JSR 88 Deployment API, never widely adopted

Extensibility
Embrace open source libraries and frameworks.

Zero-configuration, drag-and-drop for web frameworks.


Servlet, servlet filters, context listeners for a framework get

discovered and registered automatically.


Completely general solution using web fragments. Scripting languages can use the same mechanism.

Ease of development
Ongoing concern This time focus is the web tier Lots of opportunities in other areas, e.g. EJB General principles: Annotation-based programming model. Traditional API for advanced users Reduce or eliminate need for deployment descriptors Get technologies to work together well.

25/11/2009

Ease of development (cont.)

Proposed components(1)
Full JSRs EJB 3.1(JSR-318) JPA 2.0 (JSR-317) Servlet 3.0 (JSR-315) JSF 2.0 (JSR-314) JAX-RS 1.0 (JSR-311) Connectors 1.6 (JSR-322) Web Beans 1.0 (JSR-299) Bean Validation 1.0 (JSR-303)

Proposed components(2)
Maintenance Releases JAXB 2.2 JAX-WS 2.2 JAX-RS 1.1 EL 1.2 JSP 2.2 Others Authentication SPI (JSR-196) Concurrency utilities for Java EE (JSR-236)

25/11/2009

Servlet 3.0

Servlet 3.0 highlight


Annotation-based programming model
@WebServlet, @ServletFilter, 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.

Servlet 3.0 async API


Useful for Comet, chat rooms, long waits. Must declare @ WebServlet(asyncSupported=true) The call:

AsyncContext ctx=ServletRequest.startAsync(req,res);
AsyncContext can then either:
dispatch(String path) start(Runnable action)

Must be paired with


Complete()

25/11/2009

JavaServer Faces 2.0

JavaServer Faces 2.0 Highlights


Top Five Goals: Make custom components much easier to develop Ajax support Page description language (PDL) Reduce the configuration burden Provide for better compatibility between JSF component libraries from different vendors

Ingredients of a JavaServer Faces Component+Ajax solution


Resource Delivery Mechanism Partial Tree Traversal Partial Page Update Ajaxification Capability Ajax Enabled Components

In JSF 2.0 Spec

In Component Library

25/11/2009

Ingredients of a JSF Component+Ajax solution : Partial Tree Traversal

Ingredients of a JavaServer Faces Component+Ajax solution

Ingredients of a JSF Component+Ajax solution:Ajax Enabled Components


Such components always build on top of the previous

ingredients
Current offerings are tightly coupled to their specific

implementation of the previous ingredients.


By standardizing the foundations upon which these

components build, we can guarantee interoperability between them. Ajaxification Capability A way to give ajax capability to existing JavaServer Faces components without writing any JavaScript language Common approaches include
AjaxZone tag, enclose region to ajaxify AjaxSupport tag, nest inside of component to ajaxify

25/11/2009

EJB 3.1

EJB 3.1 Highlights


Ease-of-use improvements

No-interface view
Once source file per bean

EJB inside web applications


No ejb-jar Use WEB-INF/classes Shared component environment

Portable JNDI

EJB 3.1 Highlights (cont.)


Singleton beans: @Singleton
Shared state One instance per bean per JVM

Container/Bean managed security

@ConcurrencyManagement
Lightweight asynchronicity
Async business methods

@Asynchronous
Methods must return void or Future <T>

25/11/2009

EJB 3.1 Highlights (cont.)


Enhanced EJB Timer Service
Cron-like scheduling Initialization-time timer creation

@Schedule(dayOfWeek=Mon/Wed)
Embeddable EJB Container
Use in JavaSE environments Bootstrapping API

EJBContainer

EJB 3.1 Lite


Session beans (stateless, stateful, singletons)

Transactions
Security Interceptors Ejb-jar.xml Embeddable container API: EJBContainer OK to bootstrap on Java SE Beans looked up by global JNDI name

EJB 3.1 lite vs EJB 3.1 full


EJB 3.1 lite => Java EE 6 web profile EJB 3.1 full => Java EE 6 full profile

10

25/11/2009

Additional Features
Java Persistence Architecture 2.0
Improve object/relational mapping Java Contexts & Dependency Injection (AKA - Web

Beans)
Java Server Faces 2.0
AJAX Simplified component creation

JAX-RS 1.1 RESTful services

Web Beans 1.0


Adds contextual services to the platform

Unifies JSF managed-beans and EJB components


Dependency-injection
@LoggedIn User user; Binding types to select among alternatives Scopes (session, singleton, conversation,) Deployment types to select families of beans(e.g. mocks)

Programmatic API: Manager, Bean, Context,..

Summary
Smaller, more agile platform: profiles, pruning, extensibility Ease of development still a major focus area Component specs ready for public review Open source implementation in GlassFishV3

11

25/11/2009

References
http://jcp.org/en/jsr/results?id=4821 http://jcp.org/en/jsr/results?id=4821 http://weblogs.java.net/blog/robc/ https://glassfish.dev.java.net/ http://blogs.sun.com/theaquarium http://wiki.glassfish.java.nethttp://jcp.org/en/jsr/results?id

=4821

12

Das könnte Ihnen auch gefallen