SlideShare a Scribd company logo
<Insert Picture Here>




Java EE 6 application development, OSGi and Eclipse users
Roberto Chinnici
Java EE 6 Specification Lead
Ludovic Champenois, GlassFish Tools Architect
JAVA EE 6
  FINAL RELEASE
DECEMBER 10, 2009
What's New?


•   Several new APIs
•   Web Profile
•   Pluggability/extensibility
•   Dependency injection
•   Lots of improvements to existing APIs
New and updated components


•   EJB 3.1               •   Managed Beans 1.0
•   JPA 2.0               •   Interceptors 1.1
•   Servlet 3.0           •   JAX-WS 2.2
•   JSF 2.0               •   JSR-109 1.3
•   JAX-RS 1.1            •   JSP 2.2
•   Connectors 1.6        •   EL 2.2
•   Bean Validation 1.0   •   JSR-250 1.1
•   DI 1.0                •   JASPIC 1.1
•   CDI 1.0               •   JACC 1.5
Web Profile


• First Java EE profile to be defined
• A fully-functional, mid-size stack for modern web
  application development
• Complete, but not the kitchen sink
Java EE 6 Web Profile Contents


                       JSF 2.0

      JSP 2.2 · EL 2.2 · JSTL 1.2 · JSR-45 1.0

                     Servlet 3.0

EJB 3.1 Lite · DI 1.0 · CDI 1.0 · Managed Beans 1.0

 Bean Validation 1.0 · Interceptors 1.1 · JSR-250 1.1

                  JPA 2.0 · JTA 1.1
Pluggability/Extensibility


• Focus on the web tier in this release
• Create a level playing field for third-party frameworks
• Simplify packaging of web applications
Modular Web Applications


•   Libraries can contain /META-INF/web-fragment.xml
•   web.xml is optional
•   @WebServlet, @WebFilter annotations
•   ServletContainerInitializer interface
•   Programmatic registration of components
•   Resource jars containing /META-INF/resources
Sample Web Fragment Descriptor

<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>
JAX-RS 1.1


•   RESTful web services API
•   Already widely adopted
•   Really a general, high-level HTTP API
•   Annotation-based programming model
•   Programmatic API when needed
JAX-RS Sample


@Path(“widgets/{id}”)
@Produces(“application/widgets+xml”)
public class WidgetResource {
  public WidgetResource(@PathParam(“id”)
                        String id) {…}

    @GET
    public Widget getWidget() {…}

    @PUT
    public void putWidget(Widget widget){…}
}
Bean Validation 1.0


• Integrated with JSF, JPA
• Declarative constraints using annotations
   @NotNull
   @Size(max=40) String address;
• Fully extensible: define your own constraints
   @Email String recipient;
• Validator API for programmatic validation
   validator.validate(obj) → Set<ConstraintViolation>
EJB 3.1


• @Singleton beans
• @Startup beans
• @Asynchronous invocations
   @Asynchronous public Future<Integer> compute();
• Define EJBs directly inside a web application
• EJBContainer API works on Java SE
Adding an EJB to a Web Application

           Before                       Now


BuyBooks.war     ShoppingCart        ShoppingCart
                  EJB Class           EJB Class




               ShoppingCart.jar




        BuyBooks.ear                 BuyBooks.war
Dependency Injection


• DI + CDI (JSR-330 + JSR-299)
• @Resource still around
   @Resource DataSource myDB;
• Added @Inject annotation for typesafe injection
   @Inject @LoggedIn User user;
• Automatic scope management (request, session, etc.)
• No configuration: beans discovered at startup
• Extensible via the BeanManager API
Dependency Injection Sample


@ApplicationScoped
public class CheckoutHandler {
  @Inject
  public CheckoutHandler(
          @LoggedIn User user,
          @Reliable @PayBy(CREDIT_CARD)
          PaymentProcessor processor,
          @Default ShoppingCart cart) {…}
}


Injection points identified by Qualifier + Type
@Default can be omitted
JSF 2.0


•   Facelet as a standard view declaration language
•   Composite components
•   Automatic discovery of component libraries
•   Programmatic and declarative Ajax support
•   System events
•   Validation out-of-the-box
Java EE 6 Platform


•   More powerful
•   More flexible
•   More extensible
•   Easier to use




        http://java.sun.com/javaee
What is GlassFish


• A Community
  – Users, Partners, Testers, Developers
  – Started in 2005 on http://java.net
• Application Server
  – Enterprise Quality and Open Source (CDDL & GPL v2)
  – Java EE 5 / 6 Reference Implementation
• Full Commercial Support from Oracle
  – Not only a Reference Implementation
  – Roadmap announced tomorrow regarding HA, Clustering...
GlassFish v3...


• The Java EE 6 spec, of course, and...
• Beyond the spec
  – Fast, very fast, small, very small
  – restart, btrace/dtrace, embedded, modularity, OSGi, RESTful
    Admin,...
  – Scripting: jRoR, Grails, and now Django
• Update Center: repository of new/updated bundles
• Tooling: Netbeans 6.8, IntelliJ,vi, and
  – Eclipse 3.5, 3.6Mx
Modular and Dynamic


• Modular : OSGi: Equinox and Apache Felix
• But also Equinox or Static mode, thanks to HK2
  – Yet very Fast !
• Painless Java EE 6 development
  –   Via the new/easier APIs
  –   Via better tools integration
  –   Ultra fast Auto-deploy of all Java EE and static artifacts
  –   Application runner
       • java -jar glassfish.jar foo.war
Web Session Retention


• Deployment option to maintain stateful sessions across re-
  deployments
  – $ asadmin redeploy --properties keepSessions=true myapp.war
  – Enabled by Default in Eclipse IDE
• For All sessions:
  – Servlets, CDIs, Stateful EJBs,...
• Greatly simplifies the development paradigm
GlassFish and OSGi


• GlassFish runs on top of OSGi (Felix and Equinox)
  – GlassFish ships with 200+ bundles
• Can use OSGi management tools (CLI or Web)
• Any OSGi bundle will run in GlassFish v3
  – Drop it in domain1/autodeploy/bundles
  – Can also asadmin deploy it using --type osgi
• Consume OSGi services via @Resource
  @Resource (mappedName="MYPUREOSGISERVICE")   HelloService   myOSGiService;

• Web Application Bundle (WAB Support)
Demo


• GlassFish Java EE dev in Eclipse
Integration with maven 2


• Java EE 6 APIs in Maven repository
  – http://download.java.net/maven/2/javax/javaee-api/
  – Stripped jars: very small <1Mb
  – Not to be used for Testing
• GlassFish Embbeded can run via Maven
  – mvn gf:run
Update Center: Add/Remove/Update Bundles
Thanks for your attention!


• http://java.sun.com/javaee
• http://glassfish.org

More Related Content

What's hot

SHARE 2014, Pittsburgh CICS and Liberty applications
SHARE 2014, Pittsburgh CICS and Liberty applicationsSHARE 2014, Pittsburgh CICS and Liberty applications
SHARE 2014, Pittsburgh CICS and Liberty applications
nick_garrod
 
Writing Java EE microservices using WildFly Swarm
Writing Java EE microservices using WildFly SwarmWriting Java EE microservices using WildFly Swarm
Writing Java EE microservices using WildFly Swarm
Comsysto Reply GmbH
 
WebLogic in Practice: SSL Configuration
WebLogic in Practice: SSL ConfigurationWebLogic in Practice: SSL Configuration
WebLogic in Practice: SSL Configuration
Simon Haslam
 
Scala play-framework
Scala play-frameworkScala play-framework
Scala play-framework
Abdhesh Kumar
 
WildFly BOF and V9 update @ Devoxx 2014
WildFly BOF and V9 update @ Devoxx 2014WildFly BOF and V9 update @ Devoxx 2014
WildFly BOF and V9 update @ Devoxx 2014
Dimitris Andreadis
 
Java EE 8 Web Frameworks: A Look at JSF vs MVC
Java EE 8 Web Frameworks: A Look at JSF vs MVCJava EE 8 Web Frameworks: A Look at JSF vs MVC
Java EE 8 Web Frameworks: A Look at JSF vs MVC
Josh Juneau
 
Andrei Niculae - glassfish - 24mai2011
Andrei Niculae - glassfish - 24mai2011Andrei Niculae - glassfish - 24mai2011
Andrei Niculae - glassfish - 24mai2011Agora Group
 
High performance java ee with j cache and cdi
High performance java ee with j cache and cdiHigh performance java ee with j cache and cdi
High performance java ee with j cache and cdi
Payara
 
GlassFish OSGi Server
GlassFish OSGi ServerGlassFish OSGi Server
GlassFish OSGi Server
Artur Alves
 
Devoxx 2013, WildFly BOF
Devoxx 2013, WildFly BOFDevoxx 2013, WildFly BOF
Devoxx 2013, WildFly BOF
Dimitris Andreadis
 
IIS7 For Non IIS PFEs
IIS7 For Non IIS PFEsIIS7 For Non IIS PFEs
IIS7 For Non IIS PFEs
Kenny Abdiel Maita
 
Understanding iis part2
Understanding iis part2Understanding iis part2
Understanding iis part2
Om Vikram Thapa
 
Running your Java EE applications in the Cloud
Running your Java EE applications in the CloudRunning your Java EE applications in the Cloud
Running your Java EE applications in the Cloud
Arun Gupta
 
Faster Java EE Builds with Gradle
Faster Java EE Builds with GradleFaster Java EE Builds with Gradle
Faster Java EE Builds with Gradle
Ryan Cuprak
 
50 New Features of Java EE 7 in 50 minutes
50 New Features of Java EE 7 in 50 minutes50 New Features of Java EE 7 in 50 minutes
50 New Features of Java EE 7 in 50 minutes
Arun Gupta
 
SSO 5.1 start-up issues
SSO 5.1 start-up issuesSSO 5.1 start-up issues
SSO 5.1 start-up issues
fbuechsel
 
Spring Boot. Boot up your development. JEEConf 2015
Spring Boot. Boot up your development. JEEConf 2015Spring Boot. Boot up your development. JEEConf 2015
Spring Boot. Boot up your development. JEEConf 2015
Strannik_2013
 
Mini-Training Owin Katana
Mini-Training Owin KatanaMini-Training Owin Katana
Mini-Training Owin Katana
Betclic Everest Group Tech Team
 

What's hot (18)

SHARE 2014, Pittsburgh CICS and Liberty applications
SHARE 2014, Pittsburgh CICS and Liberty applicationsSHARE 2014, Pittsburgh CICS and Liberty applications
SHARE 2014, Pittsburgh CICS and Liberty applications
 
Writing Java EE microservices using WildFly Swarm
Writing Java EE microservices using WildFly SwarmWriting Java EE microservices using WildFly Swarm
Writing Java EE microservices using WildFly Swarm
 
WebLogic in Practice: SSL Configuration
WebLogic in Practice: SSL ConfigurationWebLogic in Practice: SSL Configuration
WebLogic in Practice: SSL Configuration
 
Scala play-framework
Scala play-frameworkScala play-framework
Scala play-framework
 
WildFly BOF and V9 update @ Devoxx 2014
WildFly BOF and V9 update @ Devoxx 2014WildFly BOF and V9 update @ Devoxx 2014
WildFly BOF and V9 update @ Devoxx 2014
 
Java EE 8 Web Frameworks: A Look at JSF vs MVC
Java EE 8 Web Frameworks: A Look at JSF vs MVCJava EE 8 Web Frameworks: A Look at JSF vs MVC
Java EE 8 Web Frameworks: A Look at JSF vs MVC
 
Andrei Niculae - glassfish - 24mai2011
Andrei Niculae - glassfish - 24mai2011Andrei Niculae - glassfish - 24mai2011
Andrei Niculae - glassfish - 24mai2011
 
High performance java ee with j cache and cdi
High performance java ee with j cache and cdiHigh performance java ee with j cache and cdi
High performance java ee with j cache and cdi
 
GlassFish OSGi Server
GlassFish OSGi ServerGlassFish OSGi Server
GlassFish OSGi Server
 
Devoxx 2013, WildFly BOF
Devoxx 2013, WildFly BOFDevoxx 2013, WildFly BOF
Devoxx 2013, WildFly BOF
 
IIS7 For Non IIS PFEs
IIS7 For Non IIS PFEsIIS7 For Non IIS PFEs
IIS7 For Non IIS PFEs
 
Understanding iis part2
Understanding iis part2Understanding iis part2
Understanding iis part2
 
Running your Java EE applications in the Cloud
Running your Java EE applications in the CloudRunning your Java EE applications in the Cloud
Running your Java EE applications in the Cloud
 
Faster Java EE Builds with Gradle
Faster Java EE Builds with GradleFaster Java EE Builds with Gradle
Faster Java EE Builds with Gradle
 
50 New Features of Java EE 7 in 50 minutes
50 New Features of Java EE 7 in 50 minutes50 New Features of Java EE 7 in 50 minutes
50 New Features of Java EE 7 in 50 minutes
 
SSO 5.1 start-up issues
SSO 5.1 start-up issuesSSO 5.1 start-up issues
SSO 5.1 start-up issues
 
Spring Boot. Boot up your development. JEEConf 2015
Spring Boot. Boot up your development. JEEConf 2015Spring Boot. Boot up your development. JEEConf 2015
Spring Boot. Boot up your development. JEEConf 2015
 
Mini-Training Owin Katana
Mini-Training Owin KatanaMini-Training Owin Katana
Mini-Training Owin Katana
 

Viewers also liked

The Phone Interview
The Phone InterviewThe Phone Interview
The Phone Interview
Barry Davis
 
Leading through conflict
Leading through conflictLeading through conflict
Leading through conflict
Barry Davis
 
Rules For the New Workplace
Rules For the New WorkplaceRules For the New Workplace
Rules For the New Workplace
Barry Davis
 
2012 Extension 2 Resisted Motion
2012 Extension 2 Resisted Motion2012 Extension 2 Resisted Motion
2012 Extension 2 Resisted MotionBrett Bujeya
 
SENSE MAKING & SYSTEMS THINKING
SENSE MAKING & SYSTEMS THINKINGSENSE MAKING & SYSTEMS THINKING
SENSE MAKING & SYSTEMS THINKING
Switch On | Thrive Your Future
 

Viewers also liked (6)

The Phone Interview
The Phone InterviewThe Phone Interview
The Phone Interview
 
Leading through conflict
Leading through conflictLeading through conflict
Leading through conflict
 
Rules For the New Workplace
Rules For the New WorkplaceRules For the New Workplace
Rules For the New Workplace
 
Park tabor katalog
Park tabor katalogPark tabor katalog
Park tabor katalog
 
2012 Extension 2 Resisted Motion
2012 Extension 2 Resisted Motion2012 Extension 2 Resisted Motion
2012 Extension 2 Resisted Motion
 
SENSE MAKING & SYSTEMS THINKING
SENSE MAKING & SYSTEMS THINKINGSENSE MAKING & SYSTEMS THINKING
SENSE MAKING & SYSTEMS THINKING
 

Similar to Java EE 6, Eclipse @ EclipseCon

Java EE 6, Eclipse, GlassFish @EclipseCon 2010
Java EE 6, Eclipse, GlassFish @EclipseCon 2010Java EE 6, Eclipse, GlassFish @EclipseCon 2010
Java EE 6, Eclipse, GlassFish @EclipseCon 2010Ludovic Champenois
 
Overview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUGOverview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUG
Marakana Inc.
 
Andrei Niculae - JavaEE6 - 24mai2011
Andrei Niculae - JavaEE6 - 24mai2011Andrei Niculae - JavaEE6 - 24mai2011
Andrei Niculae - JavaEE6 - 24mai2011Agora Group
 
OTN Developer Days - Java EE 6
OTN Developer Days - Java EE 6OTN Developer Days - Java EE 6
OTN Developer Days - Java EE 6
glassfish
 
Java EE 7 Soup to Nuts at JavaOne 2014
Java EE 7 Soup to Nuts at JavaOne 2014Java EE 7 Soup to Nuts at JavaOne 2014
Java EE 7 Soup to Nuts at JavaOne 2014
Arun Gupta
 
Java EE 8: On the Horizon
Java EE 8:  On the HorizonJava EE 8:  On the Horizon
Java EE 8: On the Horizon
Josh Juneau
 
Java ee 8 + security overview
Java ee 8 + security overviewJava ee 8 + security overview
Java ee 8 + security overview
Rudy De Busscher
 
Contextual Dependency Injection for Apachecon 2010
Contextual Dependency Injection for Apachecon 2010Contextual Dependency Injection for Apachecon 2010
Contextual Dependency Injection for Apachecon 2010Rohit Kelapure
 
Java EE8 - by Kito Mann
Java EE8 - by Kito Mann Java EE8 - by Kito Mann
Java EE8 - by Kito Mann
Kile Niklawski
 
AAI-1713 Introduction to Java EE 7
AAI-1713 Introduction to Java EE 7AAI-1713 Introduction to Java EE 7
AAI-1713 Introduction to Java EE 7
WASdev Community
 
AAI 1713-Introduction to Java EE 7
AAI 1713-Introduction to Java EE 7AAI 1713-Introduction to Java EE 7
AAI 1713-Introduction to Java EE 7
Kevin Sutter
 
Utilizing JSF Front Ends with Microservices
Utilizing JSF Front Ends with MicroservicesUtilizing JSF Front Ends with Microservices
Utilizing JSF Front Ends with Microservices
Josh Juneau
 
JavaEE 6 tools coverage
JavaEE 6 tools coverageJavaEE 6 tools coverage
JavaEE 6 tools coverage
Ludovic Champenois
 
InterConnect 2016 Java EE 7 Overview (PEJ-5296)
InterConnect 2016 Java EE 7 Overview (PEJ-5296)InterConnect 2016 Java EE 7 Overview (PEJ-5296)
InterConnect 2016 Java EE 7 Overview (PEJ-5296)
Kevin Sutter
 
What’s new in Java SE, EE, ME, Embedded world & new Strategy
What’s new in Java SE, EE, ME, Embedded world & new StrategyWhat’s new in Java SE, EE, ME, Embedded world & new Strategy
What’s new in Java SE, EE, ME, Embedded world & new Strategy
Mohamed Taman
 
LatJUG. JSF2.0 - The JavaEE6 Standard
LatJUG. JSF2.0 - The JavaEE6 StandardLatJUG. JSF2.0 - The JavaEE6 Standard
LatJUG. JSF2.0 - The JavaEE6 Standard
denis Udod
 
S313557 java ee_programming_model_explained_dochez
S313557 java ee_programming_model_explained_dochezS313557 java ee_programming_model_explained_dochez
S313557 java ee_programming_model_explained_dochezJerome Dochez
 
Deep Dive Hands-on in Java EE 6 - Oredev 2010
Deep Dive Hands-on in Java EE 6 - Oredev 2010Deep Dive Hands-on in Java EE 6 - Oredev 2010
Deep Dive Hands-on in Java EE 6 - Oredev 2010
Arun Gupta
 
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...
Arun Gupta
 
Java EE 與 雲端運算的展望
Java EE 與 雲端運算的展望 Java EE 與 雲端運算的展望
Java EE 與 雲端運算的展望 javatwo2011
 

Similar to Java EE 6, Eclipse @ EclipseCon (20)

Java EE 6, Eclipse, GlassFish @EclipseCon 2010
Java EE 6, Eclipse, GlassFish @EclipseCon 2010Java EE 6, Eclipse, GlassFish @EclipseCon 2010
Java EE 6, Eclipse, GlassFish @EclipseCon 2010
 
Overview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUGOverview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUG
 
Andrei Niculae - JavaEE6 - 24mai2011
Andrei Niculae - JavaEE6 - 24mai2011Andrei Niculae - JavaEE6 - 24mai2011
Andrei Niculae - JavaEE6 - 24mai2011
 
OTN Developer Days - Java EE 6
OTN Developer Days - Java EE 6OTN Developer Days - Java EE 6
OTN Developer Days - Java EE 6
 
Java EE 7 Soup to Nuts at JavaOne 2014
Java EE 7 Soup to Nuts at JavaOne 2014Java EE 7 Soup to Nuts at JavaOne 2014
Java EE 7 Soup to Nuts at JavaOne 2014
 
Java EE 8: On the Horizon
Java EE 8:  On the HorizonJava EE 8:  On the Horizon
Java EE 8: On the Horizon
 
Java ee 8 + security overview
Java ee 8 + security overviewJava ee 8 + security overview
Java ee 8 + security overview
 
Contextual Dependency Injection for Apachecon 2010
Contextual Dependency Injection for Apachecon 2010Contextual Dependency Injection for Apachecon 2010
Contextual Dependency Injection for Apachecon 2010
 
Java EE8 - by Kito Mann
Java EE8 - by Kito Mann Java EE8 - by Kito Mann
Java EE8 - by Kito Mann
 
AAI-1713 Introduction to Java EE 7
AAI-1713 Introduction to Java EE 7AAI-1713 Introduction to Java EE 7
AAI-1713 Introduction to Java EE 7
 
AAI 1713-Introduction to Java EE 7
AAI 1713-Introduction to Java EE 7AAI 1713-Introduction to Java EE 7
AAI 1713-Introduction to Java EE 7
 
Utilizing JSF Front Ends with Microservices
Utilizing JSF Front Ends with MicroservicesUtilizing JSF Front Ends with Microservices
Utilizing JSF Front Ends with Microservices
 
JavaEE 6 tools coverage
JavaEE 6 tools coverageJavaEE 6 tools coverage
JavaEE 6 tools coverage
 
InterConnect 2016 Java EE 7 Overview (PEJ-5296)
InterConnect 2016 Java EE 7 Overview (PEJ-5296)InterConnect 2016 Java EE 7 Overview (PEJ-5296)
InterConnect 2016 Java EE 7 Overview (PEJ-5296)
 
What’s new in Java SE, EE, ME, Embedded world & new Strategy
What’s new in Java SE, EE, ME, Embedded world & new StrategyWhat’s new in Java SE, EE, ME, Embedded world & new Strategy
What’s new in Java SE, EE, ME, Embedded world & new Strategy
 
LatJUG. JSF2.0 - The JavaEE6 Standard
LatJUG. JSF2.0 - The JavaEE6 StandardLatJUG. JSF2.0 - The JavaEE6 Standard
LatJUG. JSF2.0 - The JavaEE6 Standard
 
S313557 java ee_programming_model_explained_dochez
S313557 java ee_programming_model_explained_dochezS313557 java ee_programming_model_explained_dochez
S313557 java ee_programming_model_explained_dochez
 
Deep Dive Hands-on in Java EE 6 - Oredev 2010
Deep Dive Hands-on in Java EE 6 - Oredev 2010Deep Dive Hands-on in Java EE 6 - Oredev 2010
Deep Dive Hands-on in Java EE 6 - Oredev 2010
 
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...
 
Java EE 與 雲端運算的展望
Java EE 與 雲端運算的展望 Java EE 與 雲端運算的展望
Java EE 與 雲端運算的展望
 

Java EE 6, Eclipse @ EclipseCon

  • 1. <Insert Picture Here> Java EE 6 application development, OSGi and Eclipse users Roberto Chinnici Java EE 6 Specification Lead Ludovic Champenois, GlassFish Tools Architect
  • 2. JAVA EE 6 FINAL RELEASE DECEMBER 10, 2009
  • 3. What's New? • Several new APIs • Web Profile • Pluggability/extensibility • Dependency injection • Lots of improvements to existing APIs
  • 4. New and updated components • EJB 3.1 • Managed Beans 1.0 • JPA 2.0 • Interceptors 1.1 • Servlet 3.0 • JAX-WS 2.2 • JSF 2.0 • JSR-109 1.3 • JAX-RS 1.1 • JSP 2.2 • Connectors 1.6 • EL 2.2 • Bean Validation 1.0 • JSR-250 1.1 • DI 1.0 • JASPIC 1.1 • CDI 1.0 • JACC 1.5
  • 5. Web Profile • First Java EE profile to be defined • A fully-functional, mid-size stack for modern web application development • Complete, but not the kitchen sink
  • 6. Java EE 6 Web Profile Contents JSF 2.0 JSP 2.2 · EL 2.2 · JSTL 1.2 · JSR-45 1.0 Servlet 3.0 EJB 3.1 Lite · DI 1.0 · CDI 1.0 · Managed Beans 1.0 Bean Validation 1.0 · Interceptors 1.1 · JSR-250 1.1 JPA 2.0 · JTA 1.1
  • 7. Pluggability/Extensibility • Focus on the web tier in this release • Create a level playing field for third-party frameworks • Simplify packaging of web applications
  • 8. Modular Web Applications • Libraries can contain /META-INF/web-fragment.xml • web.xml is optional • @WebServlet, @WebFilter annotations • ServletContainerInitializer interface • Programmatic registration of components • Resource jars containing /META-INF/resources
  • 9. Sample Web Fragment Descriptor <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>
  • 10. JAX-RS 1.1 • RESTful web services API • Already widely adopted • Really a general, high-level HTTP API • Annotation-based programming model • Programmatic API when needed
  • 11. JAX-RS Sample @Path(“widgets/{id}”) @Produces(“application/widgets+xml”) public class WidgetResource { public WidgetResource(@PathParam(“id”) String id) {…} @GET public Widget getWidget() {…} @PUT public void putWidget(Widget widget){…} }
  • 12. Bean Validation 1.0 • Integrated with JSF, JPA • Declarative constraints using annotations @NotNull @Size(max=40) String address; • Fully extensible: define your own constraints @Email String recipient; • Validator API for programmatic validation validator.validate(obj) → Set<ConstraintViolation>
  • 13. EJB 3.1 • @Singleton beans • @Startup beans • @Asynchronous invocations @Asynchronous public Future<Integer> compute(); • Define EJBs directly inside a web application • EJBContainer API works on Java SE
  • 14. Adding an EJB to a Web Application Before Now BuyBooks.war ShoppingCart ShoppingCart EJB Class EJB Class ShoppingCart.jar BuyBooks.ear BuyBooks.war
  • 15. Dependency Injection • DI + CDI (JSR-330 + JSR-299) • @Resource still around @Resource DataSource myDB; • Added @Inject annotation for typesafe injection @Inject @LoggedIn User user; • Automatic scope management (request, session, etc.) • No configuration: beans discovered at startup • Extensible via the BeanManager API
  • 16. Dependency Injection Sample @ApplicationScoped public class CheckoutHandler { @Inject public CheckoutHandler( @LoggedIn User user, @Reliable @PayBy(CREDIT_CARD) PaymentProcessor processor, @Default ShoppingCart cart) {…} } Injection points identified by Qualifier + Type @Default can be omitted
  • 17. JSF 2.0 • Facelet as a standard view declaration language • Composite components • Automatic discovery of component libraries • Programmatic and declarative Ajax support • System events • Validation out-of-the-box
  • 18. Java EE 6 Platform • More powerful • More flexible • More extensible • Easier to use http://java.sun.com/javaee
  • 19.
  • 20. What is GlassFish • A Community – Users, Partners, Testers, Developers – Started in 2005 on http://java.net • Application Server – Enterprise Quality and Open Source (CDDL & GPL v2) – Java EE 5 / 6 Reference Implementation • Full Commercial Support from Oracle – Not only a Reference Implementation – Roadmap announced tomorrow regarding HA, Clustering...
  • 21. GlassFish v3... • The Java EE 6 spec, of course, and... • Beyond the spec – Fast, very fast, small, very small – restart, btrace/dtrace, embedded, modularity, OSGi, RESTful Admin,... – Scripting: jRoR, Grails, and now Django • Update Center: repository of new/updated bundles • Tooling: Netbeans 6.8, IntelliJ,vi, and – Eclipse 3.5, 3.6Mx
  • 22. Modular and Dynamic • Modular : OSGi: Equinox and Apache Felix • But also Equinox or Static mode, thanks to HK2 – Yet very Fast ! • Painless Java EE 6 development – Via the new/easier APIs – Via better tools integration – Ultra fast Auto-deploy of all Java EE and static artifacts – Application runner • java -jar glassfish.jar foo.war
  • 23. Web Session Retention • Deployment option to maintain stateful sessions across re- deployments – $ asadmin redeploy --properties keepSessions=true myapp.war – Enabled by Default in Eclipse IDE • For All sessions: – Servlets, CDIs, Stateful EJBs,... • Greatly simplifies the development paradigm
  • 24. GlassFish and OSGi • GlassFish runs on top of OSGi (Felix and Equinox) – GlassFish ships with 200+ bundles • Can use OSGi management tools (CLI or Web) • Any OSGi bundle will run in GlassFish v3 – Drop it in domain1/autodeploy/bundles – Can also asadmin deploy it using --type osgi • Consume OSGi services via @Resource @Resource (mappedName="MYPUREOSGISERVICE") HelloService myOSGiService; • Web Application Bundle (WAB Support)
  • 25. Demo • GlassFish Java EE dev in Eclipse
  • 26. Integration with maven 2 • Java EE 6 APIs in Maven repository – http://download.java.net/maven/2/javax/javaee-api/ – Stripped jars: very small <1Mb – Not to be used for Testing • GlassFish Embbeded can run via Maven – mvn gf:run
  • 28. Thanks for your attention! • http://java.sun.com/javaee • http://glassfish.org