Java EE 6 Overview: Roberto Chinnici
Java EE 6 Overview: Roberto Chinnici
Java EE 6
Final Release December 10, 2009
2
Java EE 6 Platform
What's New? Several new APIs Web Profile Pluggability/extensibility Dependency injection Many improvements to individual APIs
Java EE 6 Platform
New Technologies JAX-RS 1.1 Bean Validation 1.0 DI 1.0 CDI 1.0 Managed Beans 1.0
Java EE 6 Platform
Updated Technologies EJB 3.1 JPA 2.0 Servlet 3.0 JSF 2.0 Connectors 1.6 Interceptors 1.1 JAX-WS 2.2 JSR-109 1.3 JSP 2.2 EL 2.2 JSR-250 1.1 JACC 1.4 JASPIC 1.0
5
J2EE 1.2
JPE Project Servlet JSP EJB JMS RMI/IIOP
J2EE 1.3
CMP Connector Architecture
Java EE 6
Pruning Extensibility Profiles Ease of Development EJB Lite RESTful Services Dependency Ejection
J2EE 1.2
JPE Project Servlet JSP EJB JMS RMI/IIOP
J2EE 1.3
CMP Connector Architecture
Web Profile
7
Profiles
Increase Flexibility and Focus Bundles of technologies targeting specific classes of applications Decoupled from each other With compatibility guarantees
Web Profile
A Modern Java Web Application Stack First profile to be defined Mid-size, fully functional Complete, but not the kitchen sink
Web Profile
Contents Servlet JSP / EL JSTL JSF Bean Validation EJB Lite JPA JTA DI CDI Managed Beans Interceptors JSR-250
10
Pruning
Two-step Process Addresses bloat concern These technologies will become optional in the next release:
> > > >
Pluggability / Extensibility
Goals Focus on the web tier Simplify packaging of web apps > Zero-configuration Create a level playing field for third party libraries and frameworks
12
13
Web Fragment
META-INF/web-fragment.xml
<web-fragment version=3.0 xmlns="http://java.sun.com/xml/ns/javaee"> <servlet> <servlet-name>welcome</servlet-name> <servlet-class>WelcomeServlet</servlet-class> </servlet> <listener> <listener-class>RequestListener</listener-class> </listener> </web-fragment>
14
Pluggability
Servlet 3.0 ServletContainerInitializer interface implemented by extensions @HandlesTypes to declare interest in one or more annotation types ServletContext now contains method to dynamically register servlets and filters
15
16
Asynchronous Processing
Servlet 3.0 New programming model for async request processing > e.g. Comet, chat, push apps Opt-in model @WebServlet(asyncSupported=true) Threads are managed by the container
17
EJB 3.1
Ease of development @Singleton beans @Startup beans @Asynchronous invocations No interface view Define EJBs directly inside a web application EJBContainer API works on Java SE
18
Simplified Packaging
Adding an EJB to a Web Application
BuyBooks.war ShoppingCart EJB Class ShoppingCart EJB Class
ShoppingCart.jar
BuyBooks.war
BuyBooks.war
19
20
Dependency Injection
DI 1.0 / CDI 1.0 New @Inject annotation @Inject @LoggedIn User user; Beans autodiscovered at startup Injection metamodel (BeanManager API) @Resource still available for container resources
21
22
23
Persistence
JPA 2.0 Support for collections of basic types and embeddable objects JPQL enhancements > e.g. CASE WHEN, NULLIF Pessimistic locking Criteria API for dynamic query construction
25
26
Connectors
Java Connector Architecture 1.6 Annotation-based programming model for resource adapters Generic work context > QoS across EIS Security contract for RAs
27
Ease of Development
Some of the strategies we applied Capture common patterns Fix inconsistencies Adopt what works Make APIs work better together Reducing packaging overhead Be transparent
28
Demo
Java EE 6
29
Summary
Java EE 6 Platform More powerful More flexible More extensible Easier to use
30
Resources
Java EE 6 and GlassFish v3
Java EE 6 Home
java.sun.com/javaee
Java EE 6 Downloads
java.sun.com/javaee/downloads
Community Page
glassfish.org
Upcoming Training
java.sun.com/javaee/support/training
White Papers/Webinars
http://www.sun.com/glassfish/resources
Java EE 6
GlassFish
31
Thank You!
[email protected]
32