Overview j2ee6
-
Upload
ngoisao-maximus -
Category
Documents
-
view
222 -
download
0
Transcript of Overview j2ee6
-
8/13/2019 Overview j2ee6
1/12
25/11/200
What's New withJava 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 ExtensibilityMore ways to integrate frameworks.
Easier to EvolveThe size and wideness of the Java EE has made itdifficult to evolve. Profiles and Pruning should take care of that.
SOABetter support for SOA is also defired as a goal of the newspec.
-
8/13/2019 Overview j2ee6
2/12
25/11/200
Java SE 6 Timeline
Java EE 6 Timeline
Java EE: Past & Present
-
8/13/2019 Overview j2ee6
3/12
25/11/200
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, super sets 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
-
8/13/2019 Overview j2ee6
4/12
25/11/200
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-RPCReplaced by JAX-WS
EJB Entity BeanReplaced by JPA
JAXRAPI for XML Registr ies, never widely adopted.
JSR 88Deployment 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 getdiscovered 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.
-
8/13/2019 Overview j2ee6
5/12
25/11/200
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)
-
8/13/2019 Overview j2ee6
6/12
25/11/200
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()
-
8/13/2019 Overview j2ee6
7/12
25/11/200
JavaServer Faces 2 0
JavaServer Faces 2.0 HighlightsTop 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 FacesComponent+Ajax solution Resource Delivery Mechanism
Partial Tree Traversal Partial Page Update
Ajaxification Capability
Ajax Enabled Components
In JSF 2.0 Spec
In Component Library
-
8/13/2019 Overview j2ee6
8/12
-
8/13/2019 Overview j2ee6
9/12
25/11/200
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
-
8/13/2019 Overview j2ee6
10/12
25/11/200
1
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
-
8/13/2019 Overview j2ee6
11/12
25/11/200
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.1RESTful 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 fami lies 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
-
8/13/2019 Overview j2ee6
12/12
25/11/200
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