0
Carol McDonald Java EE 6: The Next Generation Enterprise Application Platform
Topics <ul><li>Java EE 6 themes </li><ul><li>Right-sizing, Extensibility, Ease of development </li></ul><li>Java EE 6 Tech...
Bean validation
DI (JSR-330) and CDI (JSR-299)
JPA 2.0
Servlet 3.0
EJB 3.1
JSF 2.0
JAX-RS 1.1 </li></ul></ul>
JAVA EE 6 FINAL RELEASE DECEMBER 10, 2009
Java EE 6 Themes
A brief history May 1998 Project JPE Dec 1999 10 specs J2EE 1.2 Enterprise Application Servlet JSP EJB JMS RMI/IIOP Sept 2...
<ul><li>Right-sizing </li><ul><li>Profiles & Pruning
Use only what you need
Web profile, EJB Lite </li></ul><li>Extensibility (Pluggability) </li><ul><li>Use 3rd-party frameworks or libraries withou...
Dependency Injection (DI) </li></ul></ul>Major Themes of Java EE 6
Profiles
Web Profile <ul><li>Subset of full platform
For web development
Separate specification </li><ul><li>Evolves at its own pace </li></ul><li>Other profiles will come </li><ul><li>Minimal (S...
Portal.... </li></ul></ul>JSF 2.0 Servlet 3.0 JSP 2.2 EL 2.2 JSTL 1.2 EJB Lite 3.1 Managed Beans 1.0 Interceptors 1.1 JTA ...
Pruning <ul><li>Marks some specifications “deprecated” in next version </li><ul><li>Might disappear from Java EE 7 </li></...
JAX-RPC
JAX-R
JSR 88 (Java EE Application Deployment) </li></ul></ul>
EJB Lite <ul><li>Subset of  EJB 3.1  </li><ul><li>Local session bean
Injection
Transaction
Interceptors
Security </li></ul><li>Part of Web profile </li></ul><ul><li>Not included </li><ul><li>Message Driven Beans
EJB Web Service Endpoint
RMI/IIOP Interoperability
Remote interface
EJB 2.x
Timer service
CMP / BMP </li></ul></ul>
New Specs  Updated Specs <ul><li>DI 1.0
CDI 1.0
Managed Beans 1.0
Bean Validation 1.0
JAX-RS 1.1 </li></ul><ul><li>EJB 3.1
JPA 2.0
Servlet 3.0
JSF 2.0
Interceptors 1.1
Connectors 1.6
JAX-WS 2.2
JSR-109 1.3
JSP 2.2 / EL 2.2
JSR-250 1.1 </li></ul>
Managed Bean 1.0 & Interceptors 1.1
Managed Bean 1.0: What is it? <ul><li>Managed Beans are  container-managed POJOs </li><ul><li>Lightweight component model ...
Life-cycle management (@PostConstruct, @PreDestroy)
Interceptor (@Interceptors, @AroundInvoke) </li></ul></ul>
Managed Beans 1.0: Example @ManagedBean public class MyPojo { @Resource  // Resource injection private Datasource ds; @Pos...
Managed Bean vs. EJB and REST <ul><li>You could see everything as a Managed Bean with extra services
An EJB is a Managed Bean with : </li><ul><li>Transaction support
Security
Thread safety </li></ul><li>A REST service is a Managed Bean with </li><ul><li>HTTP support </li></ul></ul>
Interceptors 1.1: What is it? <ul><li>Address cross-cutting concerns in Java EE
Was part of the EJB 3.0 spec
Now a separate spec shipped with EJB 3.1
Can be uses in EJBs...
… as well as ManagedBeans
@AroundInvoke  </li></ul>
Managed Beans 1.0: Example @ManagedBean @Interceptors(LoggingInterceptor.class) public class MyPojo { public void myMethod...
Demo : Managed Bean & Interceptor <ul><li>Create a managed bean “ IsbnGenerator ”
Inject the managed bean through  @Resource  (works only under a container environment)
Use an interceptor for logging
Use “appclient” container (from GlassFish) to run it </li></ul>
Dependency Injection for Java (DI) 1.0 (JSR 330) & Context and  Dependency Injection (CDI) 1.0 (JSR 299)
<ul><li>Stands for “Dependency Injection for Java”
Java EE 5 has resource injection </li><ul><li>@Resource, @PersistenceContext, @EJB </li></ul><li>But there is no applicati...
DI 1.0 introduces  @Inject  annotation (and others) for application level injection
Spec. leads are Bob Lee (from Google) and Rod Johnson (from SpringSource) </li></ul>DI 1.0 (JSR 330): What  & Why?
<ul><li>javax.inject  package
@Inject  : Identifies injectable constructors, methods, and fields
@Named  : String-based qualifier (for EL)
@Qualifier  : Identifies qualifier
@Scope  : Identifies scope annotations
@Singleton  : Instantiates once </li></ul>DI 1.0 (JSR 330)
<ul><li>Used to be called “WebBeans”
Uses annotations defined in DI 1.0 (JSR-330) </li></ul>@Inject ShoppingCart cart;  <ul><li>Bean  discovery and wiring </li...
Every object managed by CDI has a well-defined scope </li><ul><li>@Dependent, @ConversationalScoped, @RequestScoped, @Sess...
<ul><li>Injected type is identified by </li><ul><li>Qualifier(s)  +  Java type
e.g. @Inject  @LoggedIn   User  user;
Qualifier is used to narrow down a particular class when more than one candidate for injection exists </li></ul><li>Contex...
public class ShoppingCart { … } </li></ul></ul>CDI 1.0 (JSR-299)
ItemController Bean and Dependency Injection import service.CatalogService; @Controller @Scope(&quot;session&quot;) public...
Demo: How to Check Out “ glassfish-samples” www.javapassion.com/handsonlabs/javaee6_examples/#Exercise_1
Demo: DI & CDI “ webbeans-guess” (Available from  “ glassfish-samples” project)
JPA 2.0
JPA 2.0 Features <ul><li>Richer mappings
Richer JPQL
Pessimistic Locking
Criteria API
Cache API
Many more </li></ul>
JPA 2.0: Richer Mapping <ul><li>Supports collection of basic types and embeddables </li><ul><li>In JPA 1.0, only collectio...
Upcoming SlideShare
Loading in...5
×

Javaee6 Overview

3,385

Published on

Published in: Technology
1 Comment
7 Likes
Statistics
Notes
No Downloads
Views
Total Views
3,385
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
243
Comments
1
Likes
7
Embeds 0
No embeds

No notes for slide
  • This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  • This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  • This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  • This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  • This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  • This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  • Based on java.util.concurrent.Future&lt;V&gt; For : Result values System/Application exceptions thrown from target bean Cancelation requests Method signature declares return type as Future&lt;V&gt; e.g. public Future&lt;int&gt; compute(Task t) Method implementation returns javax.ejb.AsyncResult&lt;V&gt; Concrete helper class for passing result value to container javax.ejb.AsyncResult&lt;V&gt; implements Future&lt;V&gt; Constructor takes result value as argument
  • Based on java.util.concurrent.Future&lt;V&gt; For : Result values System/Application exceptions thrown from target bean Cancelation requests Method signature declares return type as Future&lt;V&gt; e.g. public Future&lt;int&gt; compute(Task t) Method implementation returns javax.ejb.AsyncResult&lt;V&gt; Concrete helper class for passing result value to container javax.ejb.AsyncResult&lt;V&gt; implements Future&lt;V&gt; Constructor takes result value as argument
  • Based on java.util.concurrent.Future&lt;V&gt; For : Result values System/Application exceptions thrown from target bean Cancelation requests Method signature declares return type as Future&lt;V&gt; e.g. public Future&lt;int&gt; compute(Task t) Method implementation returns javax.ejb.AsyncResult&lt;V&gt; Concrete helper class for passing result value to container javax.ejb.AsyncResult&lt;V&gt; implements Future&lt;V&gt; Constructor takes result value as argument
  • Based on java.util.concurrent.Future&lt;V&gt; For : Result values System/Application exceptions thrown from target bean Cancelation requests Method signature declares return type as Future&lt;V&gt; e.g. public Future&lt;int&gt; compute(Task t) Method implementation returns javax.ejb.AsyncResult&lt;V&gt; Concrete helper class for passing result value to container javax.ejb.AsyncResult&lt;V&gt; implements Future&lt;V&gt; Constructor takes result value as argument
  • getItems() method wraps a List of items, returned from the CatalogFacade Stateless Session EJB, in a DataModel. dataTable, supports data binding to a collection of data objects represented by a DataModel instance, which is the current value of this component itself. The data collection underlying a DataModel instance is modeled as a collection of row objects that can be accessed by a row index. The APIs provide mechanisms to position to a specified row index, and to retrieve an object that represents the data that corresponds to the current row index.
  • This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  • This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  • This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  • This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  • This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  • This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  • This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  • This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  • This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  • This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  • This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  • This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  • This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  • This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  • This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  • Based on java.util.concurrent.Future&lt;V&gt; For : Result values System/Application exceptions thrown from target bean Cancelation requests Method signature declares return type as Future&lt;V&gt; e.g. public Future&lt;int&gt; compute(Task t) Method implementation returns javax.ejb.AsyncResult&lt;V&gt; Concrete helper class for passing result value to container javax.ejb.AsyncResult&lt;V&gt; implements Future&lt;V&gt; Constructor takes result value as argument
  • Goal is to remove an artificial packaging restriction NOT to create a new flavor of EJB component EJB component behavior is independent of packaging One exception : module-level vs. component-level environment Full EJB container functionality available No new restrictions placed on .war Deploy stand-alone OR in an .ear
  • This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  • This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  • This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  • This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  • This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  • This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  • This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  • This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  • This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  • This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  • This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  • This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  • This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  • This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  • This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  • This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  • Transcript of "Javaee6 Overview"

    1. 1. Carol McDonald Java EE 6: The Next Generation Enterprise Application Platform
    2. 2. Topics <ul><li>Java EE 6 themes </li><ul><li>Right-sizing, Extensibility, Ease of development </li></ul><li>Java EE 6 Technologies </li><ul><li>Managed Beans & Interceptors
    3. 3. Bean validation
    4. 4. DI (JSR-330) and CDI (JSR-299)
    5. 5. JPA 2.0
    6. 6. Servlet 3.0
    7. 7. EJB 3.1
    8. 8. JSF 2.0
    9. 9. JAX-RS 1.1 </li></ul></ul>
    10. 10. JAVA EE 6 FINAL RELEASE DECEMBER 10, 2009
    11. 11. Java EE 6 Themes
    12. 12. A brief history May 1998 Project JPE Dec 1999 10 specs J2EE 1.2 Enterprise Application Servlet JSP EJB JMS RMI/IIOP Sept 2001 13 specs J2EE 1.3 Robust Scalable CMP JCA Nov 2003 20 specs J2EE 1.4 Web Services WS Management Deployment May 2006 23 specs Java EE 5 Ease of development Annotations EJB 3 JPA 1.0 WS-* JSF Q4 2009 28 specs Java EE 6 Right-sizing EJB 3.1 JPA 2.0 Servlet 3.0 JSF 2.0 JAX-RS 1.1 JCDI 1.0 @Inject Bean Validat° Web Profile Managed Bean
    13. 13. <ul><li>Right-sizing </li><ul><li>Profiles & Pruning
    14. 14. Use only what you need
    15. 15. Web profile, EJB Lite </li></ul><li>Extensibility (Pluggability) </li><ul><li>Use 3rd-party frameworks or libraries without extra configuration </li></ul><li>Ease of development </li><ul><li>Default over configuration
    16. 16. Dependency Injection (DI) </li></ul></ul>Major Themes of Java EE 6
    17. 17. Profiles
    18. 18. Web Profile <ul><li>Subset of full platform
    19. 19. For web development
    20. 20. Separate specification </li><ul><li>Evolves at its own pace </li></ul><li>Other profiles will come </li><ul><li>Minimal (Servlet/JSP)
    21. 21. Portal.... </li></ul></ul>JSF 2.0 Servlet 3.0 JSP 2.2 EL 2.2 JSTL 1.2 EJB Lite 3.1 Managed Beans 1.0 Interceptors 1.1 JTA 1.1 JPA 2.0 Bean Validation 1.0 DI 1.0 CDI 1.0
    22. 22. Pruning <ul><li>Marks some specifications “deprecated” in next version </li><ul><li>Might disappear from Java EE 7 </li></ul><li>Pruned in Java EE 6 </li><ul><li>Entity CMP 2.x
    23. 23. JAX-RPC
    24. 24. JAX-R
    25. 25. JSR 88 (Java EE Application Deployment) </li></ul></ul>
    26. 26. EJB Lite <ul><li>Subset of EJB 3.1 </li><ul><li>Local session bean
    27. 27. Injection
    28. 28. Transaction
    29. 29. Interceptors
    30. 30. Security </li></ul><li>Part of Web profile </li></ul><ul><li>Not included </li><ul><li>Message Driven Beans
    31. 31. EJB Web Service Endpoint
    32. 32. RMI/IIOP Interoperability
    33. 33. Remote interface
    34. 34. EJB 2.x
    35. 35. Timer service
    36. 36. CMP / BMP </li></ul></ul>
    37. 37. New Specs Updated Specs <ul><li>DI 1.0
    38. 38. CDI 1.0
    39. 39. Managed Beans 1.0
    40. 40. Bean Validation 1.0
    41. 41. JAX-RS 1.1 </li></ul><ul><li>EJB 3.1
    42. 42. JPA 2.0
    43. 43. Servlet 3.0
    44. 44. JSF 2.0
    45. 45. Interceptors 1.1
    46. 46. Connectors 1.6
    47. 47. JAX-WS 2.2
    48. 48. JSR-109 1.3
    49. 49. JSP 2.2 / EL 2.2
    50. 50. JSR-250 1.1 </li></ul>
    51. 51. Managed Bean 1.0 & Interceptors 1.1
    52. 52. Managed Bean 1.0: What is it? <ul><li>Managed Beans are container-managed POJOs </li><ul><li>Lightweight component model </li></ul><li>Support a small set of basic services </li><ul><li>Injection of a resource (@Resource...)
    53. 53. Life-cycle management (@PostConstruct, @PreDestroy)
    54. 54. Interceptor (@Interceptors, @AroundInvoke) </li></ul></ul>
    55. 55. Managed Beans 1.0: Example @ManagedBean public class MyPojo { @Resource // Resource injection private Datasource ds; @PostConstruct // Life-cycle private void init() { .... } public void myMethod() {...} }
    56. 56. Managed Bean vs. EJB and REST <ul><li>You could see everything as a Managed Bean with extra services
    57. 57. An EJB is a Managed Bean with : </li><ul><li>Transaction support
    58. 58. Security
    59. 59. Thread safety </li></ul><li>A REST service is a Managed Bean with </li><ul><li>HTTP support </li></ul></ul>
    60. 60. Interceptors 1.1: What is it? <ul><li>Address cross-cutting concerns in Java EE
    61. 61. Was part of the EJB 3.0 spec
    62. 62. Now a separate spec shipped with EJB 3.1
    63. 63. Can be uses in EJBs...
    64. 64. … as well as ManagedBeans
    65. 65. @AroundInvoke </li></ul>
    66. 66. Managed Beans 1.0: Example @ManagedBean @Interceptors(LoggingInterceptor.class) public class MyPojo { public void myMethod() {...} } public class LoggingInterceptor { @AroundInvoke public Object logMethod(InvContext ic) {...} }
    67. 67. Demo : Managed Bean & Interceptor <ul><li>Create a managed bean “ IsbnGenerator ”
    68. 68. Inject the managed bean through @Resource (works only under a container environment)
    69. 69. Use an interceptor for logging
    70. 70. Use “appclient” container (from GlassFish) to run it </li></ul>
    71. 71. Dependency Injection for Java (DI) 1.0 (JSR 330) & Context and Dependency Injection (CDI) 1.0 (JSR 299)
    72. 72. <ul><li>Stands for “Dependency Injection for Java”
    73. 73. Java EE 5 has resource injection </li><ul><li>@Resource, @PersistenceContext, @EJB </li></ul><li>But there is no application level injection in Java EE 5
    74. 74. DI 1.0 introduces @Inject annotation (and others) for application level injection
    75. 75. Spec. leads are Bob Lee (from Google) and Rod Johnson (from SpringSource) </li></ul>DI 1.0 (JSR 330): What & Why?
    76. 76. <ul><li>javax.inject package
    77. 77. @Inject : Identifies injectable constructors, methods, and fields
    78. 78. @Named : String-based qualifier (for EL)
    79. 79. @Qualifier : Identifies qualifier
    80. 80. @Scope : Identifies scope annotations
    81. 81. @Singleton : Instantiates once </li></ul>DI 1.0 (JSR 330)
    82. 82. <ul><li>Used to be called “WebBeans”
    83. 83. Uses annotations defined in DI 1.0 (JSR-330) </li></ul>@Inject ShoppingCart cart; <ul><li>Bean discovery and wiring </li><ul><li>Container discovers beans and wires everything together automatically </li></ul><li>Let you use EJBs directly as JSF backing beans
    84. 84. Every object managed by CDI has a well-defined scope </li><ul><li>@Dependent, @ConversationalScoped, @RequestScoped, @SessionScoped, @ApplicationScoped, </li></ul></ul>CDI 1.0 (JSR-299)
    85. 85. <ul><li>Injected type is identified by </li><ul><li>Qualifier(s) + Java type
    86. 86. e.g. @Inject @LoggedIn User user;
    87. 87. Qualifier is used to narrow down a particular class when more than one candidate for injection exists </li></ul><li>Context management with scopes </li><ul><li>@ConversationScoped
    88. 88. public class ShoppingCart { … } </li></ul></ul>CDI 1.0 (JSR-299)
    89. 89. ItemController Bean and Dependency Injection import service.CatalogService; @Controller @Scope(&quot;session&quot;) public class ItemController { @Inject private CatalogService catalogService ; . . . Inject Bean Creates ItemController bean no need to put in .xml CatalogService injected by type
    90. 90. Demo: How to Check Out “ glassfish-samples” www.javapassion.com/handsonlabs/javaee6_examples/#Exercise_1
    91. 91. Demo: DI & CDI “ webbeans-guess” (Available from “ glassfish-samples” project)
    92. 92. JPA 2.0
    93. 93. JPA 2.0 Features <ul><li>Richer mappings
    94. 94. Richer JPQL
    95. 95. Pessimistic Locking
    96. 96. Criteria API
    97. 97. Cache API
    98. 98. Many more </li></ul>
    99. 99. JPA 2.0: Richer Mapping <ul><li>Supports collection of basic types and embeddables </li><ul><li>In JPA 1.0, only collections of entities were supported </li></ul><li>Supports multiple levels of embeddables
    100. 100. Embeddables containing collection of embeddables and basic types
    101. 101. PK can be derived entities
    102. 102. More support for Maps... </li></ul>
    103. 103. JPA 2.0: Collection of basic types @Entity Public class Item { @ElementCollection private Set<String> tags; } @Entity Public class Item { @ElementCollection @CollectionTable(name=&quot;TAGS&quot;) private Set<String> tags; } Mapped by default in ITEM_TAGS Mapped in TAGS
    104. 104. JPA 2.0: Richer JPQL <ul><li>Added entity type to support non-polymorphic queries
    105. 105. Allow joins in subquery FROM clause
    106. 106. Added new operators </li><ul><li>INDEX (for ordered lists)
    107. 107. CASE (for case expressions)
    108. 108. more </li></ul><li>Added new reserved words </li><ul><li>ABS, BOTH, CONCAT, ELSE, END, ESCAPE, LEADING, LENGTH, LOCATE, SET, SIZE, SQRT, SUBSTRING, TRAILING </li></ul></ul>
    109. 109. Example: JPQL CASE Expression @Entity public class Employee { @Id Integer empId; String name; Float salary; Integer rating; // ... } UPDATE Employee e SET e.salary = CASE WHEN e.rating = 1 THEN e.salary * 1.05 WHEN e.rating = 2 THEN e.salary * 1.02 ELSE e.salary * 0.95 END
    110. 110. JPA 2.0: Standard Properties <ul><li>In persistence.xml : </li><ul><li>javax.persistence.jdbc.driver
    111. 111. javax.persistence.jdbc.url
    112. 112. javax.persistence.jdbc.user
    113. 113. javax.persistence.jdbc.password </li></ul></ul>
    114. 114. JPA 2.0: Locking Enhancements <ul><li>JPA 1.0 supports only optimist locking
    115. 115. JPA 2.0 adds pessimistic locking
    116. 116. Multiple places to specify lock </li><ul><li>read and lock
    117. 117. read then lock
    118. 118. read then lock and refresh </li></ul></ul>public enum LockModeType { OPTIMISTIC, OPTIMISTIC_FORCE_INCREMENT, PESSIMISTIC, PESSIMISTIC_FORCE_INCREMENT, NONE }
    119. 119. Example Scenario public void applyCharges () { em.getTransaction().begin(); Account acct = em.find (Account.class, acctId); // … Do some work to compute charge double balance = acct.getBalance(); if (charge > 0){ acct.setBalance(balance – charge); } em.getTransaction().commit(); } source: Mike Keith
    120. 120. Pessimistic Locking: Example 1 // // Read then lock // public void applyCharges () { em.getTransaction().begin(); Account acct = em.find (Account.class, acctId); // … Do some work to compute charge double balance = acct.getBalance(); if (charge > 0){ em.lock(acct, PESSIMISTIC); acct.setBalance(balance – charge); } em.getTransaction().commit(); } source: Mike Keith
    121. 121. Pessimistic Locking: Example 2 // // Read and lock // public void applyCharges () { em.getTransaction().begin(); Account acct = em.find (Account.class, acctId, PESSIMISTIC ); // … Do some work to compute charge double balance = acct.getBalance(); if (charge > 0){ acct.setBalance(balance – charge); } em.getTransaction().commit(); } source: Mike Keith
    122. 122. Pessimistic Locking: Example 3 // // Read then lock and refresh // public void applyCharges () { em.getTransaction().begin(); Account acct = em.find (Account.class, acctId); // … Do some work to compute charge em.refresh(acct, PESSIMISTIC); double balance = acct.getBalance(); if (charge > 0){ acct.setBalance(balance – charge); } em.getTransaction().commit(); } source: Mike Keith
    123. 123. JPA 2.0: Criteria API <ul><li>Strongly typed criteria API
    124. 124. Object-based query definition objects </li><ul><li>rather than string-based </li></ul><li>Like JPQL
    125. 125. Uses a metamodel – Compile time type checking using Generics </li><ul><li>Each entity X has a metamodel class X_
    126. 126. Criteria API operates on the metamodel </li></ul></ul>
    127. 127. JPA 2.0: Criteria API Example #1 // Retrieve all orders whose lineitems is empty. // Using Criteria API CriteriaBuilder qb = em.getEntityManagerFactory().getCriteriaBuilder(); CriteriaQuery<Order> cq = qb.createQuery(Order.class); Root<Order> order = cq.from(Order.class); cq.where(qb.isEmpty(order.get(Order_.lineitems))).select(order); // Using JPQL SELECT o FROM Order o WHERE o.lineItems IS EMPTY
    128. 128. JPA 2.0: Criteria API Example #2 // Using Criteria API CriteriaBuilder qb = em.getEntityManagerFactory().getCriteriaBuilder(); CriteriaQuery<Customer> q = qb.createQuery(Customer.class); Root<Customer> customer = q.from(Customer.class); Join<Customer,Order> order = customer.join(Customer_.orders, JoinType.LEFT); q.where(qb.equal(customer.get(Customer_.status), 1)) .select(customer); // Using JPQL SELECT c FROM Customer c LEFT JOIN c.orders o WHERE c.status = 1
    129. 129. JPA 2.0: Caching <ul><li>Supports the use of a second-level cache
    130. 130. Cache API </li><ul><li>contain(Class, PK)
    131. 131. evict(Class, PK), evict(Class)
    132. 132. evictAll() </li></ul><li>@Cacheable annotation on entities </li></ul>
    133. 133. Demo : Book Entity
    134. 134. Servlet 3.0
    135. 135. <ul><li>Ease of Development </li><ul><li>Through annotation </li></ul><li>Dynamic registration of Servlets and Filters </li><ul><li>During runtime </li></ul><li>Pluggability (of 3rd-party frameworks/libs) </li><ul><li>No more tweaking of web.xml is needed </li></ul><li>Asynchronous Servlet </li><ul><li>Support Comet applications </li></ul><li>Security enhancements </li></ul>Servlet 3.0 Features
    136. 136. // web.xml is not needed anymore @WebServlet(urlPatterns=“/foo”, name=”MyServlet”, asyncSupported=true ) public class SimpleSample extends HttpServlet{ public void doGet( HttpServletRequest req, HttpServletResponse res){ // Some code } } Ease of Use: Use of Annotation
    137. 137. public class TestServletContextListener implements ServletContextListener { @Override public void contextInitialized(ServletContextEvent sce) { ServletContext servletConext = sce.getServletContext(); // Servlets/Filters can be added during runtime ServletRegistration.Dynamic dynamic = servletContext. addServlet ( &quot;DynamicServlet&quot;, &quot;com.mycom.MyServlet&quot;); dynamic. addMapping (&quot;/dynamicServlet&quot;); dynamic. setAsyncSupported (true); Dynamic Registration of Servlets/Filters
    138. 138. Demo: Servlet 3.0 Featuers: Annotation, Dynamic Registration (Available from “ glassfish-samples” project)
    139. 139. Pluggability (of 3 rd party Frameworks) <ul><li>Make it possible to use 3rd-party framework and libraries without configuration in web.xml
    140. 140. A framework is provided as a self-contained jar file
    141. 141. All you have to do use the framework is to place the self-contained jar file under /WEB-INF/lib directory </li></ul>
    142. 142. Pluggability: Modularization of web.xml <ul><li>No more tweaking of single web.xml
    143. 143. Each framework defines its own web-fragment.xml </li><ul><li>Declare their own controller servlet
    144. 144. Declare listener and filters </li></ul><li>Container then collects them all
    145. 145. Overridden by main web.xml </li><ul><li>Order of the frameworks/libs can be specified in the web.xml </li></ul></ul>
    146. 146. <ul><li>A self-contained framework is provided as a jar file and placed under WEB-INF/lib </li><ul><li>web.xml (optional)
    147. 147. WEB-INF/lib/ someframework1.jar -> </li></ul></ul>META-INF/web-fragment.xml <ul><ul><li>WEB-INF/lib/ someframework2.jar -> </li></ul></ul>META-INF/web-fragment.xml Pluggability – Modularization of web.xml
    148. 148. Pluggability - web-fragment.xml <web-fragment> <servlet> <servlet-name>MyFramework</servlet-name> <servlet-class>com.mycom.MyFrameworkServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>MyFramework</servlet-name> <url-pattern>/MyFramework</url-pattern> </servlet-mapping> ... </web-fragment>
    149. 149. Demo: Servlet 3.0 Featuers: Pluggability “ absolute-ordering-web-fragments” (Available from “ glassfish-samples” project)
    150. 150. Asynchronous Servlet <ul><li>Async. Servlets are for preventing “thread starvation” in cases such as following in standard (thus portable) fashion </li><ul><li>Waiting for resources (eg JDBC connection)
    151. 151. Waiting for Comet events (eg Published message in Comet-based Chat application)
    152. 152. Waiting for responses (eg web services) </li></ul><li>Better scalability </li></ul>
    153. 153. Asynch. Servlet: Blocked vs. Asynch. Waiting for Web Services Blocking Asynchronous Thread blocked WS request In parallel
    154. 154. import javax.servlet.*; Queue<AsyncContext> usersQueue; BlockingQueue<String> messageQueue; @WebServlet(urlPatterns = {&quot;/chat&quot;}, asyncSupported = true ) public class ChatServlet extends HttpServlet { doGet(...) { AsyncContext ac = req.startAsync(); ac.setTimeout(10 * 60 * 1000); ac.addListener(new AsyncListener() { public void onComplete(AsyncEvent event) { usersQueue.remove(ac); } // deal with more events ... }); usersQueue.add(ac); } ... ChatServlet (1/2)
    155. 155. doPost (...) { // also deal with system (login) messages String message = req.getParameter(&quot;message&quot;); messageQueue.put (message); } init (...) { while (true) { String message = messageQueue.take(); for ( AsyncContext ac : usersQueue) { PrintWriter acWriter = ac.getResponse().getWriter(); acWriter.println(message); } } } } ChatServlet (2/2)
    156. 156. Demo: Servlet 3.0 Featuers: Comet using Asynch. API (Available from “ glassfish-samples” project)
    157. 157. Demo : Add a Servlet
    158. 158. EJB 3.1
    159. 159. <ul><li>Packaging in a war file
    160. 160. Optional Local Interfaces
    161. 161. Singleton
    162. 162. Asynchronous calls
    163. 163. Cron-based Timer Service
    164. 164. Embeddable Container
    165. 165. EJB Lite </li></ul>EJB 3.1
    166. 166. Packaging in a war file <ul><li>EJB components can be packaged directly inside a web application archive (war file) </li></ul>
    167. 167. Demo: EJB 3.1: Simplified Packaging
    168. 168. EJB 3.1: Optional Local Interface <ul><li>One source file for bean </li></ul>@Stateless public class HelloBean { // No interface public String sayHello() { return &quot;Hello Brazil!&quot;; } }
    169. 169. EJB 3.1: Asynchronous calls @Stateless public class OrderBean { public void createOrder() { Order order = persistOrder(); sendEmail(order) ; } public Order persistOrder() {...} @Asynchronous public Future<Long> sendEmail(Order order){ ...} }
    170. 170. EJB 3.1: Timer Service @Stateless public class WakeUpBean { @Schedule(dayOfWeek=&quot;Mon-Fri&quot;, hour=&quot;9&quot;) void wakeUp() { ... } }
    171. 171. Demo : Add an EJB stateless
    172. 172. EJB 3.1: Singleton <ul><li>One single instance per application
    173. 173. Share state
    174. 174. @Singleton
    175. 175. Support for container-managed concurrency and bean-managed concurrency </li><ul><li>@ConcurrencyManagement </li></ul></ul>
    176. 176. EJB 3.1: Singleton @Singleton public class CachingBean { private Map cache; @PostConstruct void init() { cache = ...; } public Map getCache() { return cache; } public void addToCache(Object key, Object val) { cache.put(key, val); } }
    177. 177. Demo : Add a Singleton EJB
    178. 178. EJB 3.1: Embeddable Container <ul><li>API allowing to : </li><ul><li>Initialize a container
    179. 179. Get container ctx </li></ul><li>Can run in any Java SE environment </li><ul><li>Batch processing
    180. 180. Simplifies testing
    181. 181. Just a jar file in your classpath </li></ul></ul>Java SE Transaction manager Security system Messaging engine EJB 3.1 Embedded container
    182. 182. EJB 3.1: Embeddable Container ... public static void main(String[] args){ EJBContainer container = EJBContainer.createEJBContainer(); Context context = container.getContext(); Hello h = (Hello) context .lookup(&quot;java:global/classes/HelloEJB&quot;); h .sayHello; container.close(); } ...
    183. 183. Demo : EJB Container Test
    184. 184. JSF 2.0
    185. 185. JSF 2.0 <ul><li>Annotation based </li><ul><li>faces-config.xml is optional </li></ul><li>Easy navigation
    186. 186. Page description language </li><ul><li>Facelets (preferred)
    187. 187. JSP (still supported) </li></ul><li>Templating
    188. 188. Composite components
    189. 189. Ajax support </li></ul>
    190. 190. General JSF Architecture
    191. 191. JSF 2.0: Managed Bean Annotation <ul><li><h:inputText value=&quot;#{login.name}&quot;/>
    192. 192. JSF 1.0 – in faces-config.xml </li></ul><managed-bean> <managed-bean-name>login</managed-bean> <managed-bean-class>com.corejsf.Login</managed-bean> <managed-bean-scope>session</managed-bean-scope> </managed-bean> <ul><li>JSF 2.0 – faces-config.xml is optional </li></ul>@ManagedBean @SessionScoped public class Login { ... }
    193. 193. JSF 2.0: Easy Navigation <ul><li><h:commandButton value=&quot;Press me!&quot; action=&quot;next&quot;/>
    194. 194. JSF 1.0 – in faces-config.xml </li></ul><navigation-rule> <navigation-case> <from-outcome>next</from-outcome> <to-view-id>/next.jsp</to-view-id> </navigation-case> </navigation-rule> <ul><li>JSF 2.0 </li></ul><h:commandButton value=&quot;Press me!&quot; action=&quot;next&quot;/>
    195. 195. JSF 2.0: Facelets <ul><li>Preferred view handler in JSF </li><ul><li>Addresses problems of using JSP with JSF </li></ul><li>XHTML
    196. 196. Pages are usable from HTML editors
    197. 197. Templating
    198. 198. Composite components </li></ul>
    199. 199. Demo : Add a JSF page
    200. 200. JSF 2.0: Composite Components <ul><li>Made up of simpler components
    201. 201. True JSF component
    202. 202. Much easier to build in JSF 2.0 (than in JSF 1.0) </li><ul><li>Single file, No Java code is needed
    203. 203. NetBeans 6.8 provides “Convert to Composite Component” wizard </li></ul><li>Can attach listeners, validators </li></ul>
    204. 204. JSF 2.0: Composite Component <ul><li>Declare a component </li></ul><composite:interface> <composite:attribute name=&quot;who&quot; required=&quot;true&quot;/> </composite:interface> <composite:implementation> <span>Hello #{cc.attrs.who}</span> </composite:implementation> <ul><li>Use it </li></ul><html xmlns:ez=&quot;http://java.sun.com/jsf/composite/hello&quot;> <ez:hello who=&quot;world&quot; />
    205. 205. Demo : Composite Component
    206. 206. JSF 2.0: Ajax Support – Using tag <ul><li>Very easy to use Ajax with JSF components </li></ul><h:commandButton value=&quot;Create a book&quot; action=&quot;#{itemBean.doCreateBook}&quot;> <f:ajax execute=&quot;bookForm&quot; render=&quot;:booklist&quot;/> </h:commandButton> <ul><li>Partial lifecycle executed for named components </li></ul>
    207. 207. JSF 2.0: Ajax Support – Using JavaScript <ul><li>Use jsf.js JavaScript library </li></ul><h:outputScript name=&quot; jsf.js &quot; library=&quot;javax.faces&quot; target=&quot;head&quot;/> <h:commandButton value=&quot;Create a CD&quot; id=&quot;createButton&quot; onclick= &quot;jsf.ajax.request(this, event, {execute:'cdForm', render:'cdlist'}); return false;&quot; actionListener=&quot;#{itemBean.doCreateCD}&quot;/>
    208. 208. Demo : JSF with Ajax
    209. 209. Bean Validation 1.0
    210. 210. Bean Validation 1.0: What is it? <ul><li>Enable declarative validation in your applications
    211. 211. Constrain Once, Validate Anywhere </li><ul><li>restriction on a bean, field or property
    212. 212. not null, size between 1 and 7, valid email... </li></ul><li>Standard way to validate constraints
    213. 213. Integration with JPA 2.0 & JSF 2.0 </li></ul>
    214. 214. Bean Validation 1.0: Example public class Address { @NotNull @Size(max=30, message=&quot;longer than {max} characters&quot;) private String street1; ... @NotNull @Valid private Country country; } public class Country { @NotNull @Size(max=30) private String name; ... }
    215. 215. Demo : Validation Item/ItemBean
    216. 216. JAX-RS 1.1
    217. 217. JAX-RS 1.1 <ul><li>JAX-RS 1.0 has been released in 2008 </li><ul><li>RESTful Services
    218. 218. POJO and Annotations Based
    219. 219. Maps HTTP verbs (Get, Post, Put, Delete...) </li></ul><li>JAX-RS 1.1 </li><ul><li>Part of Java EE 6
    220. 220. EJB support </li></ul></ul>
    221. 221. JAX-RS 1.1: EJB Support @Path(&quot;/users/{userId}&quot;) @Stateless public class UserResource { @PersistenceContext EntityManage em; @GET @Produces(&quot;text/xml&quot;) public String getUser( @PathParam(&quot;userId&quot; ) String id){ User u = em.find(User.class, id) ... } }
    222. 222. Demo : Add REST service to EJB
    223. 223. Summary & Resources
    224. 224. Summary <ul><li>Java EE 6 is a standard based next generation enterprise application development and deployment platform
    225. 225. Java EE 6 leverages proven best practice ideas </li></ul>
    226. 226. Resources <ul><li>Sun's Java EE homesite </li><ul><li>http://java.sun.com/javaee/ </li></ul><li>Sang Shin's Advanced “Java EE programming” online course </li><ul><li>www.javapassion.com/javaee_advanced/ </li></ul><li>“ Java EE 6 with GlassFish 3” book written by Antonio Goncalves </li></ul>
    227. 227. Acknowledgement <ul><li>Many slides and demos in this presentation is borrowed from “Java EE 6” University session of Devoxx 2009 authored by “Antonio Goncalves” and “Alexis Moussine-Pouchkine” (with their permission)
    228. 228. Many demos are from “glassfish-sample” project </li></ul>
    229. 229. THANK YOU! Carol McDonald
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×