<Insert Picture Here>




Java EE 6 & GlassFish = Less Code + More Power
Arun Gupta, Java EE & GlassFish Guy
blogs.sun.com/arungupta, @arungupta
The following/preceding is intended to outline our
general product direction. It is intended for
information purposes only, and may not be
incorporated into any contract. It is not a
commitment to deliver any material, code, or
functionality, and should not be relied upon in
making purchasing decisions.
The development, release, and timing of any
features or functionality described for Oracle’s
products remains at the sole discretion of Oracle.



                                                     2
3
Compatible Java EE 5 Impl




http://java.sun.com/javaee/overview/compatibility-javaee5.jsp


                                                                4
Compatible Java EE 6 Impls

Today:




Announced:
                             5
Java EE 6 Themes

                  Flexible                 Embrace open source
Web Profile             &                  frameworks
  Pruning     Lightweight     Extensible
                                           Enables Drag & Drop
                        Java EE
                                           framework installation


                       Developer
                      Productivity

                  More annotations
                 POJO development
               Less XML configuration
                                                                6
Java EE 6 Web Profile 1.0

• Fully functional mid-sized profile
  • Actively discussed in the Java EE 6 Expert
    Group and outside it
  • Technologies
    • Servlets 3.0, JSP 2.2, EL 2.2, Debugging Support for
      Other Languages 1.0, JSTL 1.2, JSF 2.0, Common
      Annotations 1.1, EJB 3.1 Lite, JTA 1.1, JPA 2.0, Bean
      Validation 1.0, Managed Beans 1.0, Interceptors 1.1,
      Context & Dependency Injection 1.0, Dependency
      Injection for Java 1.0




                                                              7
Java EE 6 - Done




                  09
• Specifications approved by the JCP
• Reference Implementation is GlassFish v3




               20
• TCK

       ec
      D

                                             8
Java EE 6 Specifications

• The Platform
• Java EE 6 Web Profile 1.0
• Managed Beans 1.0




                              9
Java EE 6 Specifications
  New

• Contexts and Dependency Injection for
  Java EE (JSR 299)
• Bean Validation 1.0 (JSR 303)
• Java API for RESTful Web Services (JSR 311)
• Dependency Injection for Java (JSR 330)




                                           10
Java EE 6 Specifications
  Extreme Makeover

• Java Server Faces 2.0 (JSR 314)
• Java Servlets 3.0 (JSR 315)
• Java Persistence 2.0 (JSR 317)
• Enterprise Java Beans 3.1 & Interceptors 1.1
  (JSR 318)
• Java EE Connector Architecture 1.6 (JSR 322)




                                             11
Java EE 6 Specifications
   Updates

• Java API for XML-based Web Services 2.2 (JSR 224)
• Java API for XML Binding 2.2 (JSR 222)
• Web Services Metadata MR3 (JSR 181)
• JSP 2.2/EL 2.2 (JSR 245)
• Web Services for Java EE 1.3 (JSR 109)
• Common Annotations 1.1 (JSR 250)
• Java Authorization Contract for Containers 1.3 (JSR 115)
• Java Authentication Service Provider Interface for
 Containers 1.0 (JSR 196)



                                                        12
Java EE 6 Specifications
    As is

•   JDBC 4.0 API
•   Java Naming and Directory Interface 1.2
•   Java Message Service 1.1
•   Java Transaction API 1.1
•   Java Transaction Service 1.0
•   JavaMail API Specification 1.4
•   JavaBeans Activation Framework 1.1
•   Java API for XML Processing 1.3
•   Java API for XML-based RPC 1.1
•   SOAP with Attachments API for Java 1.3
•   Java API for XML Registries 1.0
•   Java EE Management Specification 1.1 (JSR 77)
•   Java EE Deployment Specification 1.2 (JSR 88)
•   Java Management Extensions 1.2
•   Java Authentication and Authorization Service 1.0
•   Debugging Support for Other Languages (JSR 45)
•   Standard Tag Library for JSP 1.2 (JSR 52)
•   Streaming API for XML 1.0 (JSR 173)



                                                        13
Java EE 6 & Ease-of-development

• Continue advancements of Java EE 5
• Primary focus: Web Tier
• General principles
  • Annotation-based programming model
  • Reduce or eliminate need for DD
  • Traditional API for advanced users




                                         14
Servlets in Java EE 5
   At least 2 files

<!--Deployment descriptor      /* Code in Java Class */
  web.xml -->
<web-app>                      package com.sun;
  <servlet>                    public class MyServlet extends
    <servlet-name>MyServlet    HttpServlet {
             </servlet-name>   public void
       <servlet-class>         doGet(HttpServletRequest
         com.sun.MyServlet     req,HttpServletResponse res)
       </servlet-class>        {
  </servlet>
                               ...
  <servlet-mapping>
    <servlet-name>MyServlet    }
       </servlet-name>         ...
    <url-pattern>/myApp/*      }
       </url-pattern>
  </servlet-mapping>
   ...
</web-app>



                                                            15
Servlets 3.0 (JSR 315)
   Annotations-based @WebServlet

package com.sun;
@WebServlet(name=”MyServlet”, urlPatterns={”/myApp/*”})
public class MyServlet extends HttpServlet {
      public void doGet(HttpServletRequest req,
                         HttpServletResponse res)
   {                      <!--Deployment descriptor web.xml -->
                          <web-app>
            ...              <servlet>
                               <servlet-name>MyServlet</servlet-name>
   }                            <servlet-class>
                                                      com.sun.MyServlet
                                                    </servlet-class>
                                               </servlet>
                                               <servlet-mapping>
                                                 <servlet-name>MyServlet</servlet-name>
                                                 <url-pattern>/myApp/*</url-pattern>
                                               </servlet-mapping>
                                                ...
                                             </web-app>

http://blogs.sun.com/arungupta/entry/java_ee_6_glassfish_31
http://blogs.sun.com/arungupta/entry/screencast_31_java_ee_6


                                                                                          16
Servlets 3.0

• @WebServlet, @WebListener, @WebFilter, …
• Asynchronous Servlets
    • @WebServlet(asyncSupported=true)
•   Plugin libraries using web fragments
•   Dynamic registration of Servlets
•   WEB-INF/lib/[*.jar]/META-INF/resources
      accessible in the root
•   Programmatic authentication login/logout
•   Default Error Page
•   ...

                                             17
EJB 3.1 (JSR 318)
   Package & Deploy in a WAR
          Java EE 5                                     Java EE 6
                                                   myApp.war
   myApp.ear
                                                   WEB-INF/classes
      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

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

http://blogs.sun.com/arungupta/entry/java_ee_6_glassfish_31
http://blogs.sun.com/arungupta/entry/screencast_31_java_ee_6


                                                                         18
EJB 3.1 - Sample

@Stateless                             @EJB
public class MySessionBean {           MySessionBean bean;
  @PostConstruct
  public void setupResources() {
    // setup your resources
  }

    @PreDestroy
    public void cleanupResources() {
       // collect them back here
    }

    public String sayHello(String name) {
      return "Hello " + name;
    }
}




                                                             19
EJB 3.1

• No interface view – one source file per bean
• Embeddable API
• @Singleton
  • Initialization in @PostContruct
• Cron-like semantics for Timer
• Asynchronous Session Bean
• Portable Global JNDI Name




                                                 20
EJB 3.1
EJB 3.1 Lite – Feature Comparison




                                    21
Contexts & Dependency Injection
 (JSR 299)
• Standards-based Dependency Injection
• Type-safe – Builds on @Inject API
• Context/Scope management
• Includes ELResolver


            @Inject @LoggedIn User user
Request                          What ?
                  Which one ?
Injection                        (Type)
                   (Qualifier)

                                          22
CDI


• Qualifiers
• Events
• Stereotypes
• Interceptors
• Decorators
• Alternatives
•...



                 23
Java Server Faces 2.0 (JSR 314)

• Facelets as “templating language”
   • Custom components much easier to develop
• Integrated Ajax (with or without JavaScript)
• “faces-config.xml” optional in common cases
• Default navigation rules
• Much more …
 •   Runs on Servlet 2.5+
 •   Bookmarkable URLs
 •   Conditional navigation
 •   ...

                                                 24
Java Persistence API 2 (JSR 317)
• Improved O/R mapping
• Type-safe Criteria API
 • Metamodel
• Expanded and Richer JPQL
• 2nd-level Cache
• New locking modes
 • PESSIMISTIC_READ – grab shared lock
 • PESSIMISTIC_WRITE – grab exclusive lock
 • PESSIMISTIC_FORCE_INCREMENT – update version
• Standard configuration options
 • javax.persistence.jdbc.[driver | url | user | password]
                                                             25
Bean Validation (JSR 303)
• Tier-independent mechanism to define
 constraints for data validation
  • Represented by annotations
  • javax.validation.* package
• Integrated with JSF and JPA
  • JSF: f:validateRequired, f:validateRegexp
  • JPA: pre-persist, pre-update, and pre-remove
• @NotNull(message=”...”), @Max, @Min,
  @Size
• Fully Extensible
  • @Email String recipient;


                                                   26
JAX-RS 1.1 (JSR 311)


• Java API for building RESTful Web Services
• POJO based
• Annotation-driven
• Server-side API
• HTTP-centric




                                           27
JAX-RS 1.1
Code Sample - Simple

@Path("helloworld")
public class HelloWorldResource {

    @GET
    @Produces("text/plain")
    public String sayHello() {
        return "Hello World";
    }

    @GET
    @Path("morning")
    public String morning() {
         return “Good Morning!”;
    }
}




                                    28
IDE Support for Java EE 6




                            29
Books on GlassFish




                     30
What is GlassFish ?

• A community
  • Users, Partners, Testers, Developers, ...
  • Started in 2005 on java.net
• Application Server
  • Open Source (CDDL & GPL v2)
  • Java EE Reference Implementation




                                                31
GlassFish Server Chronology

2006    2007       2008      2009      2010                  …


GlassFish v1
Java EE 5, Single Instance

               GlassFish v2
               Java EE 5, High Availability

                       GlassFish Server 3
                       Java EE 6, Single Instance

                                    GlassFish Server 3.1
                                    Java EE 6, High Availability


                                                                   32
GlassFish Distributions
Distribution              License      Features

GlassFish Open Source     CDDL &       • Java EE 6 Compatibility
Edition 3.0.1             GPLv2        • No Clustering
                                       • Clustering planned in 3.1
                                       • mod_jk for load balancing

GlassFish Open Source     CDDL &       • Java EE 5 Compatibility
Edition 2.1.1             GPLv2        • In memory replication
                                       • mod_loadbalancer
Oracle GlassFish Server   Commercial   • GlassFish Open Source Edition 3.0.1
3.0.1                                  • GlassFish Server Control            Clustering
                                       • Clustering planned in 3.1            Coming
                                                                                Soon!
Oracle GlassFish Server   Commercial   • GlassFish Open Source Edition 2.1.1
2.1.1                                  • Enterprise Manager
                                       • HADB
GlassFish 3

• Modular
  • Maven 2 – Build & Module description
  • Felix – OSGi runtime (200+ bundles)
  • Allow any type of Container to be plugged
    • Start Container and Services on demand

• Embeddable: runs in-VM
• Extensible
  • Rails, Grails, Django, ...
  • Administration, Monitoring, Logging, Deployment, ...



                                                       34
GlassFish 3.0.1
   • First Oracle-branded release of GlassFish
   • Additional platform support
       •   Oracle Enterprise Linux 4 & 5 (32 & 64-bit)
       •   Red Hat Enterprise Linux 64-bit
       •   Window 2008 R2 (32 & 64-bit)
       •   HP-UX 11i, (32 & 64-bit)
       •   JRockit 6 Update 17
   • 100+ bugfixes


http://www.oracle.com/technetwork/middleware/glassfish/overview/index.html



                                                                             35
36
Boost your productivity
   Retain session across deployment
asadmin redeploy –properties keepSessions=true helloworld.war




                                                                37
Boost your productivity
Deploy-on-Save




                          38
GlassFish Server OSE 3.1
• Combine benefits from versions 2.1.1 and 3.0
  • Clustering, replication and centralized admin (2.1.1)
  • OSGi modularity and Java EE 6 from (3.x)
• Other ...
  • Application Versioning
  • Application-Scoped resources
  • SSH-based remote management & monitoring
  • Various Enterprise OSGi specs
  • Embedded (extensive)
  • Admin Console based on RESTful API

http://wikis.sun.com/display/glassfish/GlassFishv3.1



                                                            39
GlassFish and WebLogic together
•
    Best open source application server with    •
                                                    Best commercial application server for
    support from Oracle                             transactional Java EE applications
•
    Open source platform of choice for light-   •
                                                    Platform of choice for standardization
    weight Web applications                     •
                                                    Focus on lowest operational cost and mission
•
    Focus on latest Java EE standards and           critical applications
    community driven innovation                 •
                                                    integration with Oracle Database, Fusion
•
    Certified interoperability with Fusion          Middleware & Fusion Applications
    Middleware
•
    Differentiated innovation, scout thread




                  Production Java                                Production Java
               Application Deployment                         Application Deployment


               GlassFish Server                               WebLogic Server


                                                                                               40
What does Java EE offer to Cloud ?

●
    Containers
●
    Injectable services
●
    Scale to large clusters
●
    Security model
●
    ...




                                         41
What can Java EE do for Clouds ?

●
    Tighter requirements for resource and state
    management
●
    Better isolation between applications
●
    Potential standard APIs for NRDBMS, Caching, …
●
    HTML5
●
    Common management and monitoring interfaces
●
    Better packaging
    ●
        Apps/Data are (multiple) versioned, Upgrades,
        Expose/Connect to services, QoS attributes, ...
●
    Evolution, not revolution

                                                          42
What else is coming in JavaEE.next?
• Modularity
  •   Build on Java SE work
  •   Applications made of modules
  •   Dependencies are explicit
  •   Versioning is built-in
• Web socket support
• Standard JSON API
• HTML5 support
• NIO.2-based web container




                                      43
References


• glassfish.org
• oracle.com/goto/glassfish
• blogs.sun.com/theaquarium
• glassfish.org/roadmap
• youtube.com/user/GlassFishVideos
• Follow @glassfish




                                     44
<Insert Picture Here>




Java EE 6 & GlassFish = Less Code + More Power
Arun Gupta, Java EE & GlassFish Guy
blogs.sun.com/arungupta, @arungupta

More Related Content

PDF
Deep Dive Hands-on in Java EE 6 - Oredev 2010
PDF
Java EE 6 & GlassFish v3 @ DevNexus
PDF
Java EE 6 & GlassFish v3 at Vancouver JUG, Jan 26, 2010
PDF
Java EE 6 & GlassFish v3: Paving the path for the future - Spark IT 2010
PDF
TDC 2011: The Java EE 7 Platform: Developing for the Cloud
PDF
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...
PDF
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
PDF
Understanding the nuts & bolts of Java EE 6
Deep Dive Hands-on in Java EE 6 - Oredev 2010
Java EE 6 & GlassFish v3 @ DevNexus
Java EE 6 & GlassFish v3 at Vancouver JUG, Jan 26, 2010
Java EE 6 & GlassFish v3: Paving the path for the future - Spark IT 2010
TDC 2011: The Java EE 7 Platform: Developing for the Cloud
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
Understanding the nuts & bolts of Java EE 6

What's hot (20)

PDF
Java EE 6 and GlassFish v3: Paving the path for future
PDF
GIDS 2012: PaaSing a Java EE Application
PDF
GIDS 2012: Java Message Service 2.0
PDF
Java EE 6 - Deep Dive - Indic Threads, Pune - 2010
ODP
Java EE 6 = Less Code + More Power (Tutorial) [5th IndicThreads Conference O...
PDF
Overview of Java EE 6 by Roberto Chinnici at SFJUG
PDF
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
PDF
Java EE 6 & GlassFish 3
PDF
Running your Java EE applications in the Cloud
PDF
Java EE 6 and GlassFish v3: Paving the path for future
PDF
Java EE 6 : Paving The Path For The Future
PDF
Java EE 6 Component Model Explained
PDF
Andrei Niculae - JavaEE6 - 24mai2011
PDF
Java EE 6 = Less Code + More Power
PDF
JavaEE 6 and GlassFish v3 at SFJUG
PDF
Java EE 6 workshop at Dallas Tech Fest 2011
PDF
Sun Java EE 6 Overview
PDF
Java EE 6 & GlassFish v3: Paving the path for the future - Tech Days 2010 India
PDF
Glass Fishv3 March2010
PDF
Java EE6 CodeCamp16 oct 2010
Java EE 6 and GlassFish v3: Paving the path for future
GIDS 2012: PaaSing a Java EE Application
GIDS 2012: Java Message Service 2.0
Java EE 6 - Deep Dive - Indic Threads, Pune - 2010
Java EE 6 = Less Code + More Power (Tutorial) [5th IndicThreads Conference O...
Overview of Java EE 6 by Roberto Chinnici at SFJUG
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
Java EE 6 & GlassFish 3
Running your Java EE applications in the Cloud
Java EE 6 and GlassFish v3: Paving the path for future
Java EE 6 : Paving The Path For The Future
Java EE 6 Component Model Explained
Andrei Niculae - JavaEE6 - 24mai2011
Java EE 6 = Less Code + More Power
JavaEE 6 and GlassFish v3 at SFJUG
Java EE 6 workshop at Dallas Tech Fest 2011
Sun Java EE 6 Overview
Java EE 6 & GlassFish v3: Paving the path for the future - Tech Days 2010 India
Glass Fishv3 March2010
Java EE6 CodeCamp16 oct 2010

Similar to Java EE 6 & GlassFish = Less Code + More Power at CEJUG (16)

PDF
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...
PDF
Boston 2011 OTN Developer Days - Java EE 6
PDF
Java Enterprise Edition 6 Overview
PDF
Java EE 6 and GlassFish v3: Paving the path for future
PDF
Java EE 6 Aquarium Paris
PDF
Java EE6 Overview
PDF
Java EE 6 Hands-on Workshop at Dallas Tech Fest 2010
PDF
Java E
PDF
Java EE 6 and GlassFish portfolio
PDF
Spark IT 2011 - Java EE 6 Workshop
ODP
OTN Developer Days - Java EE 6
PDF
The Java Ee 6 Platform Normandy Jug
PDF
GlassFish Tool Bundle for Eclipse
PDF
JavaOne India 2011 - Servlets 3.0
PDF
Introduction to java servlet 3.0 api javaone 2009
PDF
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...
Boston 2011 OTN Developer Days - Java EE 6
Java Enterprise Edition 6 Overview
Java EE 6 and GlassFish v3: Paving the path for future
Java EE 6 Aquarium Paris
Java EE6 Overview
Java EE 6 Hands-on Workshop at Dallas Tech Fest 2010
Java E
Java EE 6 and GlassFish portfolio
Spark IT 2011 - Java EE 6 Workshop
OTN Developer Days - Java EE 6
The Java Ee 6 Platform Normandy Jug
GlassFish Tool Bundle for Eclipse
JavaOne India 2011 - Servlets 3.0
Introduction to java servlet 3.0 api javaone 2009
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010

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
Docker, Kubernetes, and Mesos recipes for Java developers
PDF
Thanks Managers!
PDF
Migrate your traditional VM-based Clusters to Containers
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
Docker, Kubernetes, and Mesos recipes for Java developers
Thanks Managers!
Migrate your traditional VM-based Clusters to Containers

Recently uploaded (20)

PDF
IT-ITes Industry bjjbnkmkhkhknbmhkhmjhjkhj
PPTX
Rise of the Digital Control Grid Zeee Media and Hope and Tivon FTWProject.com
PDF
Transform-Your-Supply-Chain-with-AI-Driven-Quality-Engineering.pdf
PDF
EIS-Webinar-Regulated-Industries-2025-08.pdf
PDF
The-Future-of-Automotive-Quality-is-Here-AI-Driven-Engineering.pdf
PPTX
How to Convert Tickets Into Sales Opportunity in Odoo 18
PPTX
Blending method and technology for hydrogen.pptx
PDF
Streamline Vulnerability Management From Minimal Images to SBOMs
PDF
Introduction to MCP and A2A Protocols: Enabling Agent Communication
PDF
Data Virtualization in Action: Scaling APIs and Apps with FME
PDF
Identification of potential depression in social media posts
PDF
Transform-Quality-Engineering-with-AI-A-60-Day-Blueprint-for-Digital-Success.pdf
PPTX
AI-driven Assurance Across Your End-to-end Network With ThousandEyes
PPTX
Build automations faster and more reliably with UiPath ScreenPlay
PDF
Transform-Your-Factory-with-AI-Driven-Quality-Engineering.pdf
PDF
Rapid Prototyping: A lecture on prototyping techniques for interface design
PDF
Lung cancer patients survival prediction using outlier detection and optimize...
PDF
Build Real-Time ML Apps with Python, Feast & NoSQL
PDF
Launch a Bumble-Style App with AI Features in 2025.pdf
PDF
Altius execution marketplace concept.pdf
IT-ITes Industry bjjbnkmkhkhknbmhkhmjhjkhj
Rise of the Digital Control Grid Zeee Media and Hope and Tivon FTWProject.com
Transform-Your-Supply-Chain-with-AI-Driven-Quality-Engineering.pdf
EIS-Webinar-Regulated-Industries-2025-08.pdf
The-Future-of-Automotive-Quality-is-Here-AI-Driven-Engineering.pdf
How to Convert Tickets Into Sales Opportunity in Odoo 18
Blending method and technology for hydrogen.pptx
Streamline Vulnerability Management From Minimal Images to SBOMs
Introduction to MCP and A2A Protocols: Enabling Agent Communication
Data Virtualization in Action: Scaling APIs and Apps with FME
Identification of potential depression in social media posts
Transform-Quality-Engineering-with-AI-A-60-Day-Blueprint-for-Digital-Success.pdf
AI-driven Assurance Across Your End-to-end Network With ThousandEyes
Build automations faster and more reliably with UiPath ScreenPlay
Transform-Your-Factory-with-AI-Driven-Quality-Engineering.pdf
Rapid Prototyping: A lecture on prototyping techniques for interface design
Lung cancer patients survival prediction using outlier detection and optimize...
Build Real-Time ML Apps with Python, Feast & NoSQL
Launch a Bumble-Style App with AI Features in 2025.pdf
Altius execution marketplace concept.pdf

Java EE 6 & GlassFish = Less Code + More Power at CEJUG

  • 1. <Insert Picture Here> Java EE 6 & GlassFish = Less Code + More Power Arun Gupta, Java EE & GlassFish Guy blogs.sun.com/arungupta, @arungupta
  • 2. The following/preceding is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. 2
  • 3. 3
  • 4. Compatible Java EE 5 Impl http://java.sun.com/javaee/overview/compatibility-javaee5.jsp 4
  • 5. Compatible Java EE 6 Impls Today: Announced: 5
  • 6. Java EE 6 Themes Flexible Embrace open source Web Profile & frameworks Pruning Lightweight Extensible Enables Drag & Drop Java EE framework installation Developer Productivity More annotations POJO development Less XML configuration 6
  • 7. Java EE 6 Web Profile 1.0 • Fully functional mid-sized profile • Actively discussed in the Java EE 6 Expert Group and outside it • Technologies • Servlets 3.0, JSP 2.2, EL 2.2, Debugging Support for Other Languages 1.0, JSTL 1.2, JSF 2.0, Common Annotations 1.1, EJB 3.1 Lite, JTA 1.1, JPA 2.0, Bean Validation 1.0, Managed Beans 1.0, Interceptors 1.1, Context & Dependency Injection 1.0, Dependency Injection for Java 1.0 7
  • 8. Java EE 6 - Done 09 • Specifications approved by the JCP • Reference Implementation is GlassFish v3 20 • TCK ec D 8
  • 9. Java EE 6 Specifications • The Platform • Java EE 6 Web Profile 1.0 • Managed Beans 1.0 9
  • 10. Java EE 6 Specifications New • Contexts and Dependency Injection for Java EE (JSR 299) • Bean Validation 1.0 (JSR 303) • Java API for RESTful Web Services (JSR 311) • Dependency Injection for Java (JSR 330) 10
  • 11. Java EE 6 Specifications Extreme Makeover • Java Server Faces 2.0 (JSR 314) • Java Servlets 3.0 (JSR 315) • Java Persistence 2.0 (JSR 317) • Enterprise Java Beans 3.1 & Interceptors 1.1 (JSR 318) • Java EE Connector Architecture 1.6 (JSR 322) 11
  • 12. Java EE 6 Specifications Updates • Java API for XML-based Web Services 2.2 (JSR 224) • Java API for XML Binding 2.2 (JSR 222) • Web Services Metadata MR3 (JSR 181) • JSP 2.2/EL 2.2 (JSR 245) • Web Services for Java EE 1.3 (JSR 109) • Common Annotations 1.1 (JSR 250) • Java Authorization Contract for Containers 1.3 (JSR 115) • Java Authentication Service Provider Interface for Containers 1.0 (JSR 196) 12
  • 13. Java EE 6 Specifications As is • JDBC 4.0 API • Java Naming and Directory Interface 1.2 • Java Message Service 1.1 • Java Transaction API 1.1 • Java Transaction Service 1.0 • JavaMail API Specification 1.4 • JavaBeans Activation Framework 1.1 • Java API for XML Processing 1.3 • Java API for XML-based RPC 1.1 • SOAP with Attachments API for Java 1.3 • Java API for XML Registries 1.0 • Java EE Management Specification 1.1 (JSR 77) • Java EE Deployment Specification 1.2 (JSR 88) • Java Management Extensions 1.2 • Java Authentication and Authorization Service 1.0 • Debugging Support for Other Languages (JSR 45) • Standard Tag Library for JSP 1.2 (JSR 52) • Streaming API for XML 1.0 (JSR 173) 13
  • 14. Java EE 6 & Ease-of-development • Continue advancements of Java EE 5 • Primary focus: Web Tier • General principles • Annotation-based programming model • Reduce or eliminate need for DD • Traditional API for advanced users 14
  • 15. Servlets in Java EE 5 At least 2 files <!--Deployment descriptor /* Code in Java Class */ web.xml --> <web-app> package com.sun; <servlet> public class MyServlet extends <servlet-name>MyServlet HttpServlet { </servlet-name> public void <servlet-class> doGet(HttpServletRequest com.sun.MyServlet req,HttpServletResponse res) </servlet-class> { </servlet> ... <servlet-mapping> <servlet-name>MyServlet } </servlet-name> ... <url-pattern>/myApp/* } </url-pattern> </servlet-mapping> ... </web-app> 15
  • 16. Servlets 3.0 (JSR 315) Annotations-based @WebServlet package com.sun; @WebServlet(name=”MyServlet”, urlPatterns={”/myApp/*”}) public class MyServlet extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse res) { <!--Deployment descriptor web.xml --> <web-app> ... <servlet> <servlet-name>MyServlet</servlet-name> } <servlet-class> com.sun.MyServlet </servlet-class> </servlet> <servlet-mapping> <servlet-name>MyServlet</servlet-name> <url-pattern>/myApp/*</url-pattern> </servlet-mapping> ... </web-app> http://blogs.sun.com/arungupta/entry/java_ee_6_glassfish_31 http://blogs.sun.com/arungupta/entry/screencast_31_java_ee_6 16
  • 17. Servlets 3.0 • @WebServlet, @WebListener, @WebFilter, … • Asynchronous Servlets • @WebServlet(asyncSupported=true) • Plugin libraries using web fragments • Dynamic registration of Servlets • WEB-INF/lib/[*.jar]/META-INF/resources accessible in the root • Programmatic authentication login/logout • Default Error Page • ... 17
  • 18. EJB 3.1 (JSR 318) Package & Deploy in a WAR Java EE 5 Java EE 6 myApp.war myApp.ear WEB-INF/classes 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 beans.jar com.sun.FooBean web.xml ? com.sun.FooHelper http://blogs.sun.com/arungupta/entry/java_ee_6_glassfish_31 http://blogs.sun.com/arungupta/entry/screencast_31_java_ee_6 18
  • 19. EJB 3.1 - Sample @Stateless @EJB public class MySessionBean { MySessionBean bean; @PostConstruct public void setupResources() { // setup your resources } @PreDestroy public void cleanupResources() { // collect them back here } public String sayHello(String name) { return "Hello " + name; } } 19
  • 20. EJB 3.1 • No interface view – one source file per bean • Embeddable API • @Singleton • Initialization in @PostContruct • Cron-like semantics for Timer • Asynchronous Session Bean • Portable Global JNDI Name 20
  • 21. EJB 3.1 EJB 3.1 Lite – Feature Comparison 21
  • 22. Contexts & Dependency Injection (JSR 299) • Standards-based Dependency Injection • Type-safe – Builds on @Inject API • Context/Scope management • Includes ELResolver @Inject @LoggedIn User user Request What ? Which one ? Injection (Type) (Qualifier) 22
  • 23. CDI • Qualifiers • Events • Stereotypes • Interceptors • Decorators • Alternatives •... 23
  • 24. Java Server Faces 2.0 (JSR 314) • Facelets as “templating language” • Custom components much easier to develop • Integrated Ajax (with or without JavaScript) • “faces-config.xml” optional in common cases • Default navigation rules • Much more … • Runs on Servlet 2.5+ • Bookmarkable URLs • Conditional navigation • ... 24
  • 25. Java Persistence API 2 (JSR 317) • Improved O/R mapping • Type-safe Criteria API • Metamodel • Expanded and Richer JPQL • 2nd-level Cache • New locking modes • PESSIMISTIC_READ – grab shared lock • PESSIMISTIC_WRITE – grab exclusive lock • PESSIMISTIC_FORCE_INCREMENT – update version • Standard configuration options • javax.persistence.jdbc.[driver | url | user | password] 25
  • 26. Bean Validation (JSR 303) • Tier-independent mechanism to define constraints for data validation • Represented by annotations • javax.validation.* package • Integrated with JSF and JPA • JSF: f:validateRequired, f:validateRegexp • JPA: pre-persist, pre-update, and pre-remove • @NotNull(message=”...”), @Max, @Min, @Size • Fully Extensible • @Email String recipient; 26
  • 27. JAX-RS 1.1 (JSR 311) • Java API for building RESTful Web Services • POJO based • Annotation-driven • Server-side API • HTTP-centric 27
  • 28. JAX-RS 1.1 Code Sample - Simple @Path("helloworld") public class HelloWorldResource { @GET @Produces("text/plain") public String sayHello() { return "Hello World"; } @GET @Path("morning") public String morning() { return “Good Morning!”; } } 28
  • 29. IDE Support for Java EE 6 29
  • 31. What is GlassFish ? • A community • Users, Partners, Testers, Developers, ... • Started in 2005 on java.net • Application Server • Open Source (CDDL & GPL v2) • Java EE Reference Implementation 31
  • 32. GlassFish Server Chronology 2006 2007 2008 2009 2010 … GlassFish v1 Java EE 5, Single Instance GlassFish v2 Java EE 5, High Availability GlassFish Server 3 Java EE 6, Single Instance GlassFish Server 3.1 Java EE 6, High Availability 32
  • 33. GlassFish Distributions Distribution License Features GlassFish Open Source CDDL & • Java EE 6 Compatibility Edition 3.0.1 GPLv2 • No Clustering • Clustering planned in 3.1 • mod_jk for load balancing GlassFish Open Source CDDL & • Java EE 5 Compatibility Edition 2.1.1 GPLv2 • In memory replication • mod_loadbalancer Oracle GlassFish Server Commercial • GlassFish Open Source Edition 3.0.1 3.0.1 • GlassFish Server Control Clustering • Clustering planned in 3.1 Coming Soon! Oracle GlassFish Server Commercial • GlassFish Open Source Edition 2.1.1 2.1.1 • Enterprise Manager • HADB
  • 34. GlassFish 3 • Modular • Maven 2 – Build & Module description • Felix – OSGi runtime (200+ bundles) • Allow any type of Container to be plugged • Start Container and Services on demand • Embeddable: runs in-VM • Extensible • Rails, Grails, Django, ... • Administration, Monitoring, Logging, Deployment, ... 34
  • 35. GlassFish 3.0.1 • First Oracle-branded release of GlassFish • Additional platform support • Oracle Enterprise Linux 4 & 5 (32 & 64-bit) • Red Hat Enterprise Linux 64-bit • Window 2008 R2 (32 & 64-bit) • HP-UX 11i, (32 & 64-bit) • JRockit 6 Update 17 • 100+ bugfixes http://www.oracle.com/technetwork/middleware/glassfish/overview/index.html 35
  • 36. 36
  • 37. Boost your productivity Retain session across deployment asadmin redeploy –properties keepSessions=true helloworld.war 37
  • 39. GlassFish Server OSE 3.1 • Combine benefits from versions 2.1.1 and 3.0 • Clustering, replication and centralized admin (2.1.1) • OSGi modularity and Java EE 6 from (3.x) • Other ... • Application Versioning • Application-Scoped resources • SSH-based remote management & monitoring • Various Enterprise OSGi specs • Embedded (extensive) • Admin Console based on RESTful API http://wikis.sun.com/display/glassfish/GlassFishv3.1 39
  • 40. GlassFish and WebLogic together • Best open source application server with • Best commercial application server for support from Oracle transactional Java EE applications • Open source platform of choice for light- • Platform of choice for standardization weight Web applications • Focus on lowest operational cost and mission • Focus on latest Java EE standards and critical applications community driven innovation • integration with Oracle Database, Fusion • Certified interoperability with Fusion Middleware & Fusion Applications Middleware • Differentiated innovation, scout thread Production Java Production Java Application Deployment Application Deployment GlassFish Server WebLogic Server 40
  • 41. What does Java EE offer to Cloud ? ● Containers ● Injectable services ● Scale to large clusters ● Security model ● ... 41
  • 42. What can Java EE do for Clouds ? ● Tighter requirements for resource and state management ● Better isolation between applications ● Potential standard APIs for NRDBMS, Caching, … ● HTML5 ● Common management and monitoring interfaces ● Better packaging ● Apps/Data are (multiple) versioned, Upgrades, Expose/Connect to services, QoS attributes, ... ● Evolution, not revolution 42
  • 43. What else is coming in JavaEE.next? • Modularity • Build on Java SE work • Applications made of modules • Dependencies are explicit • Versioning is built-in • Web socket support • Standard JSON API • HTML5 support • NIO.2-based web container 43
  • 44. References • glassfish.org • oracle.com/goto/glassfish • blogs.sun.com/theaquarium • glassfish.org/roadmap • youtube.com/user/GlassFishVideos • Follow @glassfish 44
  • 45. <Insert Picture Here> Java EE 6 & GlassFish = Less Code + More Power Arun Gupta, Java EE & GlassFish Guy blogs.sun.com/arungupta, @arungupta