SlideShare a Scribd company logo
Java EE 6 and GlassFish v3:
Paving the path for future



Arun Gupta, GlassFish Guy
Sun Microsystems, Inc.
blogs.sun.com/arungupta
Java EE: Past & Present
                                                                                                       Right Sizing
                                                                                       Ease of
                                                                                     Development       Java EE 6
                                                                                                       EJB Lite
                                                          Web                        Java EE 5         Restful WS
                                                        Services                     Ease of
                                                                                                       Web Beans
                                                                                     Development
                                                                                                       Extensibility
                                                         J2EE 1.4                    Annotations
                           Robustness                  Web Services,                 EJB 3.0
           Enterprise                                  Management,                   Persistence API
          Java Platform     J2EE 1.3                   Deployment,                   New and
                                  CMP,
                                                       Async.                        Updated
                               Connector
                                                 `     Connector                     Web Services      Java EE 6
            J2EE 1.2          Architecture

           Servlet, JSP,                                                                               Web Profile
 JPE        EJB, JMS
Project     RMI/IIOP

                            Java EE 6 and GlassFish v3: Paving path for the future                                Slide 2
Compatible Java EE 5 Implementations




             Java EE 6 and GlassFish v3: Paving path for the future   Slide 3
Goals for the Java EE 6 Platform

• Right Sizing the Platform
    > Flexible, lighter weight
• Extensible
    >Embrace Open Source Frameworks
• Easier to use, develop on
    > Continue on path set by Java EE 5




                   Java EE 6 and GlassFish v3: Paving path for the future   Slide 4
Right Sizing the Platform: Profiles
• Make platform flexible
  > Decouple specifications to allow more
    combinations
  > Expands potential licensee ecosystem
  > Profiles
     >Targeted technology bundles
     >Defined through the JCP
     >First profile: Web Profile
         – Defined by         the Java EE 6 Expert Group


               Java EE 6 and GlassFish v3: Paving path for the future   Slide 5
Web Profile
• Fully functional mid-sized profile
  > Actively discussed in Java EE Expert Group
    and outside it
  > Technologies
    > Servlet 3.0, EJB Lite 3.1, JPA 2.0, JSP 2.2, EL 1.2, JSTL 1.2,
      JSF 2.0, JTA 1.1, JSR-45, JSR-250




                    Java EE 6 and GlassFish v3: Paving path for the future   Slide 6
Right Sizing the Platform: Pruning
• Make platform lighter
  > Makes some technologies optional
  > Pruned today, means
    > optional in the next release
    > Deleted in the subsequent release
  > Pruned Technologies will be marked in the
    javadocs
  > Current pruning list
    > JAX-RPC, EJB 2.X Entity Beans, JAXR, JSR-88



                   Java EE 6 and GlassFish v3: Paving path for the future   Slide 7
Extensibility
• Embrace open source libraries and
  frameworks
• Zero-configuration, drag-and-drop for web
  frameworks
  > Servlets, servlet filters, context listeners for a
    framework get discovered and registered
    automatically
• Plugin library jars using web fragments




                   Java EE 6 and GlassFish v3: Paving path for the future   Slide 8
<web-fragment>
   <filter>
         <filter-name>wicket.helloworld</filter-name>
         <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
         <init-param>
              <param-name>applicationClassName</param-name>
              <param-value>...</param-value>
         </init-param>
   </filter>
    <filter-mapping>
          <filter-name>wicket.helloworld</filter-name>
          <url-pattern>/*</url-pattern>
    </filter-mapping>
</web-fragment>



http://blogs.sun.com/arungupta/entry/totd_91_applying_java_ee
                                              Java EE 6 and GlassFish v3: Paving path for the future   Slide 9
<web-fragment>
  <filter>
     <filter-name>LiftFilter</filter-name>
      <display-name>Lift Filter</display-name>
      <description>The Filter that intercepts lift calls</description>
      <filter-class>net.liftweb.http.LiftFilter</filter-class>
   </filter>
  <filter-mapping>
    <filter-name>LiftFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
</web-fragment>




http://blogs.sun.com/arungupta/entry/totd_101_applying_servlet_3
                                             Java EE 6 and GlassFish v3: Paving path for the future   Slide
Ease of Development
•   Continue advancements of Java EE 5
•   Primary focus: Web Tier
•   Multiple Areas easier to use: EJB 3.1
•   General principles
    > Annotation-based programming model
    > Reduce or eliminate need for deployment
      descriptors
    > Traditional API for advanced users




                   Java EE 6 and GlassFish v3: Paving path for the future   Slide
Java EE 6: Ease of Development (EJB.Lite)
                  Java EE 5                                                                 Java EE 6
       foo.ear                                                                 foo.war
                                                                               WEB-INF/classes
          foo_web.war                                                           com.sun.FooServlet
                                                                                com.sun.TickTock
          WEB-INF/web.xml                                                       com.sun.FooBean
          WEB-INF/classes                                                       com.sun.FooHelper
            com.sun.FooServlet
            com.sun.TickTock


          foo_ejb.jar
          com.sun.FooBean
          com.sun.FooHelper
                                                                                         web.xml ?

http://blogs.sun.com/arungupta/entry/totd_95_ejb_3_1
                                             Java EE 6 and GlassFish v3: Paving path for the future     Slide
EoD Example - Servlets
Servlet in Java EE 5: Create two source files
<!--Deployment descriptor                        /* Code in Java Class */
  web.xml -->
<web-app>                                        package com.foo;
  <servlet>                                      public class MyServlet
    <servlet-name>MyServlet                      extends HttpServlet {
      </servlet-name>                            public void
       <servlet-class>                           doGet(HttpServletRequest
         com.foo.MyServlet
       </servlet-class>                          req,HttpServletResponse res)
  </servlet>                                     {
  <servlet-mapping>
    <servlet-name>MyServlet                      ...
       </servlet-name>
    <url-pattern>/myApp/*                        }
       </url-pattern>
  </servlet-mapping>
   ...                                           ...
</web-app>
                                                 }



                   Java EE 6 and GlassFish v3: Paving path for the future   Slide
EoD Example - Servlets
Servlet in Java EE 6: In many cases a single source file

package com.foo;
@WebServlet(name=”MyServlet”, urlPattern=”/myApp/*”)
public class MyServlet extends HttpServlet {
   public void doGet(HttpServletRequest req,
             HttpServletResponse res)
   {
      ...
   }




http://blogs.sun.com/arungupta/entry/totd_81_getting_started_with
                                              Java EE 6 and GlassFish v3: Paving path for the future   Slide
Java EE 6 Status
• Public reviews completed
• JSF 2.0 is final, majority of the specs are in
  Proposed Final Draft
• Reference Implementation is GlassFish V3
• Final release later this year – almost there!
• Download weekly builds
  > http://download.java.net/glassfish/v3/promoted/




                  Java EE 6 and GlassFish v3: Paving path for the future   Slide
What is GlassFish ?
• A Community
         > Users, Partners, Testers, Developers, ...
         > Started in 2005 on java.net
• Application Server
         > Enterprise Quality and Open Source (CDDL & GPL v2)
         > Java EE 5/6 Reference Implementation
         > Full Commercial Support from Sun
• Leverages Sun's experience in other Java,
Middleware, SDK

http://glassfish.org
                       Java EE 6 and GlassFish v3: Paving path for the future   Slide
Sun GlassFish Enterprise Server

                               Enterprise Manager



            Customer
            Advocate                                                           eLearning
                                                                               Credit



 Customer Focused                                                                   24x7 Support
 Support Team

                                   GlassFish
   Sun VIP                         Open Source
                                   Application Server                               Patches &
   Interoperability
                                                                                    Upgrades
   Support
                      Java EE 6 and GlassFish v3: Paving path for the future                       Slide
GlassFish v3
• Modular
        > Maven 2 – Build & Module description
        > Felix – OSGi runtime
        > Allow any type of Container to be plugged
               –   Start Container and Services on demand
• Embeddable: runs in-VM
• Extensible: pluggable containers
   > Rails, Grails, Django, ...
• Java EE 6 Reference Implementation
• Support for upcoming Java EE 6 profiles
 http://glassfish.org/v3
                              Java EE 6 and GlassFish v3: Paving path for the future   Slide
Dynamic Languages & Frameworks




http://glassfish-scripting.dev.java.net
                                Java EE 6 and GlassFish v3: Paving path for the future   Slide
Rails Deployment Choices




                                                                     Credits: http://birdwatchersdigest.com




            Java EE 6 and GlassFish v3: Paving path for the future                                            Slide
Demo
  NetBeans/Eclipse and Java EE 6

http://blogs.sun.com/arungupta/entry/screencast_27_simple_web_application
http://blogs.sun.com/arungupta/entry/screencast_28_simple_web_application
http://blogs.sun.com/arungupta/entry/screencast_26_develop_run_debug/
http://blogs.sun.com/arungupta/entry/totd_93_getting_started_with/
http://blogs.sun.com/arungupta/entry/totd_94_a_simple_java
http://blogs.sun.com/arungupta/entry/totd_95_ejb_3_1
http://blogs.sun.com/arungupta/entry/totd_102_java_ee_6
http://blogs.sun.com/arungupta/entry/totd_99_creating_a_java
http://blog.arungupta.me/2008/11/screencast-28-simple-web-application-using-eclipse-and-glassfish-v3-prelude/

                                                          Java EE 6 and GlassFish v3: Paving path for the future   Slide
Embeddable GlassFish
public void testServlet() throws Exception {
    int port = 9999;
    GlassFish glassfish = newGlassFish(port);
    URL url = new URL("http://localhost:" + port + "/" +
  NAME + "/SimpleServlet");
    BufferedReader br = new BufferedReader(
          new InputStreamReader(
          url.openConnection().getInputStream()));
    assertEquals("Wow, I'm embedded!", br.readLine());
    glassfish.stop();
  }


                    Java EE 6 and GlassFish v3: Paving path for the future   Slide
... Embeddable GlassFish
        private GlassFish newGlassFish(int port) throws Exception {
           GlassFish glassfish = new GlassFish(port);
           ScatteredWar war = new ScatteredWar(NAME,
                new File("src/main/resources"),
                new File("src/main/resources/WEB-INF/web.xml"),
                Collections.singleton(new
        File("target/classes").toURI().toURL()));
           glassfish.deploy(war);
           System.out.println("Ready ...");
           return glassfish;
        }

http://blogs.sun.com/arungupta/entry/embeddable_glassfish_in_action_servlet
                                                Java EE 6 and GlassFish v3: Paving path for the future   Slide
Extending GlassFish ... 1, 2, 3.
    @Service(name="mycommand")
    @Scoped(PerLookup.class)
    public class CLIPluggabilityCommand implements AdminCommand {
    ...
    }

    ...
    // this value can be either runtime or os for our demo
    @Param(primary=true)
    String inParam;
    ...

   public void execute(AdminCommandContext context) {
   ...
   }


http://java.net/blog/2008/11/07/extending-glassfish-v3-prelude-easy-1-2-3



                                                           Java EE 6 and GlassFish v3: Paving path for the future   Slide
Light-weight & On-demand Monitoring
• Event-driven light-weight and non-intrusive
  monitoring
• Modules provide domain specific probes
  (monitoring events)
  > EJB, Web, Connector, JPA, Jersey, Orb, Ruby
• End-to-end monitoring on Solaris using DTrace
• 3rd party scripting clients
  > JavaScript to begin with




                    Java EE 6 and GlassFish v3: Paving path for the future   Slide
Demo
    GlassFish v3 Monitoring




http://blogs.sun.com/arungupta/entry/totd_104_glassfish_v3_monitoring

                                                           Java EE 6 and GlassFish v3: Paving path for the future   Slide
REST Interface
• REST interface to management and
  monitoring data
  > Configuration data, Commands invocation (start/stop
    instance, deploy, undeploy, ...), CRUD resources (JMS,
    JDBC, ...)
  > localhost:4848/management/domain
  > localhost:4848/monitoring/domain
• GET, POST, DELETE methods
• XML, JSON, HTML reps



                   Java EE 6 and GlassFish v3: Paving path for the future   Slide
Demo
  GlassFish v3 REST Interface



http://blogs.sun.com/arungupta/entry/totd_113_javafx_front_end
http://blogs.sun.com/arungupta/entry/totd_96_glassfish_v3_rest
                                                          Java EE 6 and GlassFish v3: Paving path for the future   Slide
Java EE 6 and GlassFish v3:
Paving the path for future



Arun Gupta, GlassFish Guy
Sun Microsystems, Inc.
blogs.sun.com/arungupta

More Related Content

PDF
Java EE 6 : Paving The Path For The Future
PDF
Java EE 6 & GlassFish v3: Paving the path for the future - Spark IT 2010
PDF
Java EE 6 and GlassFish v3: Paving the path for future
PDF
Java EE 6 & GlassFish v3 at Vancouver JUG, Jan 26, 2010
PDF
Java EE 6 & GlassFish v3: Paving the path for the future - Tech Days 2010 India
PDF
Java EE 6 & GlassFish v3 @ DevNexus
PDF
Java EE 6 and GlassFish v3: Paving the path for future
PDF
TDC 2011: The Java EE 7 Platform: Developing for the Cloud
Java EE 6 : Paving The Path For The Future
Java EE 6 & GlassFish v3: Paving the path for the future - Spark IT 2010
Java EE 6 and GlassFish v3: Paving the path for future
Java EE 6 & GlassFish v3 at Vancouver JUG, Jan 26, 2010
Java EE 6 & GlassFish v3: Paving the path for the future - Tech Days 2010 India
Java EE 6 & GlassFish v3 @ DevNexus
Java EE 6 and GlassFish v3: Paving the path for future
TDC 2011: The Java EE 7 Platform: Developing for the Cloud

What's hot (20)

PDF
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...
PDF
Java EE 6 and GlassFish portfolio
PDF
Understanding the nuts & bolts of Java EE 6
PDF
GIDS 2012: Java Message Service 2.0
PDF
GIDS 2012: PaaSing a Java EE Application
PDF
JavaEE 6 and GlassFish v3 at SFJUG
PDF
Java EE 6 Hands-on Workshop at Dallas Tech Fest 2010
PDF
Java EE 6 & GlassFish = Less Code + More Power at CEJUG
PDF
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
PDF
ICEfaces EE - Enterprise-ready JSF Ajax Framework
PDF
Java EE 6 Component Model Explained
PDF
Java EE 6 & GlassFish 3
PDF
Java EE 6 workshop at Dallas Tech Fest 2011
PDF
Java EE6 CodeCamp16 oct 2010
PDF
Sun Java EE 6 Overview
PDF
Creating Quick and Powerful Web applications with Oracle, GlassFish and NetBe...
PDF
Overview of Java EE 6 by Roberto Chinnici at SFJUG
PDF
The Java EE 7 Platform: Developing for the Cloud (FISL 12)
PDF
Server Day 2009: JBoss 5.0 by Alessio Soldano
PDF
Glassfish Overview Fontys 20090520
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...
Java EE 6 and GlassFish portfolio
Understanding the nuts & bolts of Java EE 6
GIDS 2012: Java Message Service 2.0
GIDS 2012: PaaSing a Java EE Application
JavaEE 6 and GlassFish v3 at SFJUG
Java EE 6 Hands-on Workshop at Dallas Tech Fest 2010
Java EE 6 & GlassFish = Less Code + More Power at CEJUG
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
ICEfaces EE - Enterprise-ready JSF Ajax Framework
Java EE 6 Component Model Explained
Java EE 6 & GlassFish 3
Java EE 6 workshop at Dallas Tech Fest 2011
Java EE6 CodeCamp16 oct 2010
Sun Java EE 6 Overview
Creating Quick and Powerful Web applications with Oracle, GlassFish and NetBe...
Overview of Java EE 6 by Roberto Chinnici at SFJUG
The Java EE 7 Platform: Developing for the Cloud (FISL 12)
Server Day 2009: JBoss 5.0 by Alessio Soldano
Glassfish Overview Fontys 20090520
Ad

Viewers also liked (6)

PPT
2011 LAE Legislative Outlook
PDF
Java EE / GlassFish Strategy & Roadmap @ JavaOne 2011
PPTX
La filosofia com a racionalitat teòrica
PDF
T hodge the right stuff with transitions
PPTX
C sink passport #1
PDF
Docker, Kubernetes, and Mesos recipes for Java developers
2011 LAE Legislative Outlook
Java EE / GlassFish Strategy & Roadmap @ JavaOne 2011
La filosofia com a racionalitat teòrica
T hodge the right stuff with transitions
C sink passport #1
Docker, Kubernetes, and Mesos recipes for Java developers
Ad

Similar to Java EE 6 and GlassFish v3: Paving the path for future (19)

PDF
Java EE 6 = Less Code + More Power
PDF
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnition
PDF
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...
PDF
Java Enterprise Edition 6 Overview
PDF
Boston 2011 OTN Developer Days - Java EE 6
PDF
GlassFish Tool Bundle for Eclipse
PDF
Java EE6 Overview
PDF
Java EE 6 Aquarium Paris
PDF
Glass Fishv3 March2010
PDF
Spark IT 2011 - Java EE 6 Workshop
PDF
Java E
ODP
Java EE 6 = Less Code + More Power (Tutorial) [5th IndicThreads Conference O...
PDF
Java EE 6 - Deep Dive - Indic Threads, Pune - 2010
PDF
The Java Ee 6 Platform Normandy Jug
PDF
Java EE 7: the Voyage of the Cloud Treader
PDF
GlassFish v3 at JavaZone 09
PDF
Andrei Niculae - JavaEE6 - 24mai2011
PDF
JUG Darmstadt - Java EE 7 - Auf in die Wolken!
Java EE 6 = Less Code + More Power
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnition
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...
Java Enterprise Edition 6 Overview
Boston 2011 OTN Developer Days - Java EE 6
GlassFish Tool Bundle for Eclipse
Java EE6 Overview
Java EE 6 Aquarium Paris
Glass Fishv3 March2010
Spark IT 2011 - Java EE 6 Workshop
Java E
Java EE 6 = Less Code + More Power (Tutorial) [5th IndicThreads Conference O...
Java EE 6 - Deep Dive - Indic Threads, Pune - 2010
The Java Ee 6 Platform Normandy Jug
Java EE 7: the Voyage of the Cloud Treader
GlassFish v3 at JavaZone 09
Andrei Niculae - JavaEE6 - 24mai2011
JUG Darmstadt - Java EE 7 - Auf in die Wolken!

More from Arun Gupta (20)

PDF
5 Skills To Force Multiply Technical Talents.pdf
PPTX
Machine Learning using Kubernetes - AI Conclave 2019
PDF
Machine Learning using Kubeflow and Kubernetes
PPTX
Secure and Fast microVM for Serverless Computing using Firecracker
PPTX
Building Java in the Open - j.Day at OSCON 2019
PPTX
Why Amazon Cares about Open Source
PDF
Machine learning using Kubernetes
PDF
Building Cloud Native Applications
PDF
Chaos Engineering with Kubernetes
PDF
How to be a mentor to bring more girls to STEAM
PDF
Java in a World of Containers - DockerCon 2018
PPTX
The Serverless Tidal Wave - SwampUP 2018 Keynote
PDF
Introduction to Amazon EKS - KubeCon 2018
PDF
Mastering Kubernetes on AWS - Tel Aviv Summit
PDF
Top 10 Technology Trends Changing Developer's Landscape
PDF
Container Landscape in 2017
PDF
Java EE and NoSQL using JBoss EAP 7 and OpenShift
PDF
Thanks Managers!
PDF
Migrate your traditional VM-based Clusters to Containers
PDF
NoSQL - Vital Open Source Ingredient for Modern Success
5 Skills To Force Multiply Technical Talents.pdf
Machine Learning using Kubernetes - AI Conclave 2019
Machine Learning using Kubeflow and Kubernetes
Secure and Fast microVM for Serverless Computing using Firecracker
Building Java in the Open - j.Day at OSCON 2019
Why Amazon Cares about Open Source
Machine learning using Kubernetes
Building Cloud Native Applications
Chaos Engineering with Kubernetes
How to be a mentor to bring more girls to STEAM
Java in a World of Containers - DockerCon 2018
The Serverless Tidal Wave - SwampUP 2018 Keynote
Introduction to Amazon EKS - KubeCon 2018
Mastering Kubernetes on AWS - Tel Aviv Summit
Top 10 Technology Trends Changing Developer's Landscape
Container Landscape in 2017
Java EE and NoSQL using JBoss EAP 7 and OpenShift
Thanks Managers!
Migrate your traditional VM-based Clusters to Containers
NoSQL - Vital Open Source Ingredient for Modern Success

Recently uploaded (20)

PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Encapsulation theory and applications.pdf
PDF
Modernizing your data center with Dell and AMD
PDF
cuic standard and advanced reporting.pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Chapter 3 Spatial Domain Image Processing.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Mobile App Security Testing_ A Comprehensive Guide.pdf
Network Security Unit 5.pdf for BCA BBA.
The Rise and Fall of 3GPP – Time for a Sabbatical?
Reach Out and Touch Someone: Haptics and Empathic Computing
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Building Integrated photovoltaic BIPV_UPV.pdf
Understanding_Digital_Forensics_Presentation.pptx
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Diabetes mellitus diagnosis method based random forest with bat algorithm
Advanced methodologies resolving dimensionality complications for autism neur...
Spectral efficient network and resource selection model in 5G networks
Unlocking AI with Model Context Protocol (MCP)
Encapsulation theory and applications.pdf
Modernizing your data center with Dell and AMD
cuic standard and advanced reporting.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication

Java EE 6 and GlassFish v3: Paving the path for future

  • 1. Java EE 6 and GlassFish v3: Paving the path for future Arun Gupta, GlassFish Guy Sun Microsystems, Inc. blogs.sun.com/arungupta
  • 2. Java EE: Past & Present Right Sizing Ease of Development Java EE 6 EJB Lite Web Java EE 5 Restful WS Services Ease of Web Beans Development Extensibility J2EE 1.4 Annotations Robustness Web Services, EJB 3.0 Enterprise Management, Persistence API Java Platform J2EE 1.3 Deployment, New and CMP, Async. Updated Connector ` Connector Web Services Java EE 6 J2EE 1.2 Architecture Servlet, JSP, Web Profile JPE EJB, JMS Project RMI/IIOP Java EE 6 and GlassFish v3: Paving path for the future Slide 2
  • 3. Compatible Java EE 5 Implementations Java EE 6 and GlassFish v3: Paving path for the future Slide 3
  • 4. Goals for the Java EE 6 Platform • Right Sizing the Platform > Flexible, lighter weight • Extensible >Embrace Open Source Frameworks • Easier to use, develop on > Continue on path set by Java EE 5 Java EE 6 and GlassFish v3: Paving path for the future Slide 4
  • 5. Right Sizing the Platform: Profiles • Make platform flexible > Decouple specifications to allow more combinations > Expands potential licensee ecosystem > Profiles >Targeted technology bundles >Defined through the JCP >First profile: Web Profile – Defined by the Java EE 6 Expert Group Java EE 6 and GlassFish v3: Paving path for the future Slide 5
  • 6. Web Profile • Fully functional mid-sized profile > Actively discussed in Java EE Expert Group and outside it > Technologies > Servlet 3.0, EJB Lite 3.1, JPA 2.0, JSP 2.2, EL 1.2, JSTL 1.2, JSF 2.0, JTA 1.1, JSR-45, JSR-250 Java EE 6 and GlassFish v3: Paving path for the future Slide 6
  • 7. Right Sizing the Platform: Pruning • Make platform lighter > Makes some technologies optional > Pruned today, means > optional in the next release > Deleted in the subsequent release > Pruned Technologies will be marked in the javadocs > Current pruning list > JAX-RPC, EJB 2.X Entity Beans, JAXR, JSR-88 Java EE 6 and GlassFish v3: Paving path for the future Slide 7
  • 8. Extensibility • Embrace open source libraries and frameworks • Zero-configuration, drag-and-drop for web frameworks > Servlets, servlet filters, context listeners for a framework get discovered and registered automatically • Plugin library jars using web fragments Java EE 6 and GlassFish v3: Paving path for the future Slide 8
  • 9. <web-fragment> <filter> <filter-name>wicket.helloworld</filter-name> <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class> <init-param> <param-name>applicationClassName</param-name> <param-value>...</param-value> </init-param> </filter> <filter-mapping> <filter-name>wicket.helloworld</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> </web-fragment> http://blogs.sun.com/arungupta/entry/totd_91_applying_java_ee Java EE 6 and GlassFish v3: Paving path for the future Slide 9
  • 10. <web-fragment> <filter> <filter-name>LiftFilter</filter-name> <display-name>Lift Filter</display-name> <description>The Filter that intercepts lift calls</description> <filter-class>net.liftweb.http.LiftFilter</filter-class> </filter> <filter-mapping> <filter-name>LiftFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> </web-fragment> http://blogs.sun.com/arungupta/entry/totd_101_applying_servlet_3 Java EE 6 and GlassFish v3: Paving path for the future Slide
  • 11. Ease of Development • Continue advancements of Java EE 5 • Primary focus: Web Tier • Multiple Areas easier to use: EJB 3.1 • General principles > Annotation-based programming model > Reduce or eliminate need for deployment descriptors > Traditional API for advanced users Java EE 6 and GlassFish v3: Paving path for the future Slide
  • 12. Java EE 6: Ease of Development (EJB.Lite) Java EE 5 Java EE 6 foo.ear foo.war WEB-INF/classes foo_web.war com.sun.FooServlet com.sun.TickTock WEB-INF/web.xml com.sun.FooBean WEB-INF/classes com.sun.FooHelper com.sun.FooServlet com.sun.TickTock foo_ejb.jar com.sun.FooBean com.sun.FooHelper web.xml ? http://blogs.sun.com/arungupta/entry/totd_95_ejb_3_1 Java EE 6 and GlassFish v3: Paving path for the future Slide
  • 13. EoD Example - Servlets Servlet in Java EE 5: Create two source files <!--Deployment descriptor /* Code in Java Class */ web.xml --> <web-app> package com.foo; <servlet> public class MyServlet <servlet-name>MyServlet extends HttpServlet { </servlet-name> public void <servlet-class> doGet(HttpServletRequest com.foo.MyServlet </servlet-class> req,HttpServletResponse res) </servlet> { <servlet-mapping> <servlet-name>MyServlet ... </servlet-name> <url-pattern>/myApp/* } </url-pattern> </servlet-mapping> ... ... </web-app> } Java EE 6 and GlassFish v3: Paving path for the future Slide
  • 14. EoD Example - Servlets Servlet in Java EE 6: In many cases a single source file package com.foo; @WebServlet(name=”MyServlet”, urlPattern=”/myApp/*”) public class MyServlet extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse res) { ... } http://blogs.sun.com/arungupta/entry/totd_81_getting_started_with Java EE 6 and GlassFish v3: Paving path for the future Slide
  • 15. Java EE 6 Status • Public reviews completed • JSF 2.0 is final, majority of the specs are in Proposed Final Draft • Reference Implementation is GlassFish V3 • Final release later this year – almost there! • Download weekly builds > http://download.java.net/glassfish/v3/promoted/ Java EE 6 and GlassFish v3: Paving path for the future Slide
  • 16. What is GlassFish ? • A Community > Users, Partners, Testers, Developers, ... > Started in 2005 on java.net • Application Server > Enterprise Quality and Open Source (CDDL & GPL v2) > Java EE 5/6 Reference Implementation > Full Commercial Support from Sun • Leverages Sun's experience in other Java, Middleware, SDK http://glassfish.org Java EE 6 and GlassFish v3: Paving path for the future Slide
  • 17. Sun GlassFish Enterprise Server Enterprise Manager Customer Advocate eLearning Credit Customer Focused 24x7 Support Support Team GlassFish Sun VIP Open Source Application Server Patches & Interoperability Upgrades Support Java EE 6 and GlassFish v3: Paving path for the future Slide
  • 18. GlassFish v3 • Modular > Maven 2 – Build & Module description > Felix – OSGi runtime > Allow any type of Container to be plugged – Start Container and Services on demand • Embeddable: runs in-VM • Extensible: pluggable containers > Rails, Grails, Django, ... • Java EE 6 Reference Implementation • Support for upcoming Java EE 6 profiles http://glassfish.org/v3 Java EE 6 and GlassFish v3: Paving path for the future Slide
  • 19. Dynamic Languages & Frameworks http://glassfish-scripting.dev.java.net Java EE 6 and GlassFish v3: Paving path for the future Slide
  • 20. Rails Deployment Choices Credits: http://birdwatchersdigest.com Java EE 6 and GlassFish v3: Paving path for the future Slide
  • 21. Demo NetBeans/Eclipse and Java EE 6 http://blogs.sun.com/arungupta/entry/screencast_27_simple_web_application http://blogs.sun.com/arungupta/entry/screencast_28_simple_web_application http://blogs.sun.com/arungupta/entry/screencast_26_develop_run_debug/ http://blogs.sun.com/arungupta/entry/totd_93_getting_started_with/ http://blogs.sun.com/arungupta/entry/totd_94_a_simple_java http://blogs.sun.com/arungupta/entry/totd_95_ejb_3_1 http://blogs.sun.com/arungupta/entry/totd_102_java_ee_6 http://blogs.sun.com/arungupta/entry/totd_99_creating_a_java http://blog.arungupta.me/2008/11/screencast-28-simple-web-application-using-eclipse-and-glassfish-v3-prelude/ Java EE 6 and GlassFish v3: Paving path for the future Slide
  • 22. Embeddable GlassFish public void testServlet() throws Exception { int port = 9999; GlassFish glassfish = newGlassFish(port); URL url = new URL("http://localhost:" + port + "/" + NAME + "/SimpleServlet"); BufferedReader br = new BufferedReader( new InputStreamReader( url.openConnection().getInputStream())); assertEquals("Wow, I'm embedded!", br.readLine()); glassfish.stop(); } Java EE 6 and GlassFish v3: Paving path for the future Slide
  • 23. ... Embeddable GlassFish private GlassFish newGlassFish(int port) throws Exception { GlassFish glassfish = new GlassFish(port); ScatteredWar war = new ScatteredWar(NAME, new File("src/main/resources"), new File("src/main/resources/WEB-INF/web.xml"), Collections.singleton(new File("target/classes").toURI().toURL())); glassfish.deploy(war); System.out.println("Ready ..."); return glassfish; } http://blogs.sun.com/arungupta/entry/embeddable_glassfish_in_action_servlet Java EE 6 and GlassFish v3: Paving path for the future Slide
  • 24. Extending GlassFish ... 1, 2, 3. @Service(name="mycommand") @Scoped(PerLookup.class) public class CLIPluggabilityCommand implements AdminCommand { ... } ... // this value can be either runtime or os for our demo @Param(primary=true) String inParam; ... public void execute(AdminCommandContext context) { ... } http://java.net/blog/2008/11/07/extending-glassfish-v3-prelude-easy-1-2-3 Java EE 6 and GlassFish v3: Paving path for the future Slide
  • 25. Light-weight & On-demand Monitoring • Event-driven light-weight and non-intrusive monitoring • Modules provide domain specific probes (monitoring events) > EJB, Web, Connector, JPA, Jersey, Orb, Ruby • End-to-end monitoring on Solaris using DTrace • 3rd party scripting clients > JavaScript to begin with Java EE 6 and GlassFish v3: Paving path for the future Slide
  • 26. Demo GlassFish v3 Monitoring http://blogs.sun.com/arungupta/entry/totd_104_glassfish_v3_monitoring Java EE 6 and GlassFish v3: Paving path for the future Slide
  • 27. REST Interface • REST interface to management and monitoring data > Configuration data, Commands invocation (start/stop instance, deploy, undeploy, ...), CRUD resources (JMS, JDBC, ...) > localhost:4848/management/domain > localhost:4848/monitoring/domain • GET, POST, DELETE methods • XML, JSON, HTML reps Java EE 6 and GlassFish v3: Paving path for the future Slide
  • 28. Demo GlassFish v3 REST Interface http://blogs.sun.com/arungupta/entry/totd_113_javafx_front_end http://blogs.sun.com/arungupta/entry/totd_96_glassfish_v3_rest Java EE 6 and GlassFish v3: Paving path for the future Slide
  • 29. Java EE 6 and GlassFish v3: Paving the path for future Arun Gupta, GlassFish Guy Sun Microsystems, Inc. blogs.sun.com/arungupta