Docstoc

GlassFish

Document Sample
GlassFish Powered By Docstoc
					GlassFish
Developing an Application
Server in Open Source




Santiago Pericas-Geertsen
Sun Microsystems, Inc.
http://weblogs.java.net/blog/spericas/
Santiago.PericasGeertsen@sun.com
                                         1
                                         1
Who am I ?
•   BA from ITBA
•   MA and PhD from Boston University
•   With Sun for over 6 years
•   Part of Glassfish team
    > Worked on numerous projects: XSLTC (XSLT Compiler in JDK),
      JAXP, Fast Web Services, Fast Infoset, JAX-WS, XML
      Performance, Japex, MEP, ...
    > Currently tech lead of JAXP and MEP product




                 GlassFish – The Best Open Source Application Server   2
Part I - Glassfish
Application Server and
Community




                         3
 What is GlassFish?
• A Community
  > Users, Partners, Testers, Developers, ...
  > Started in 2005 on java.net
• Application Server (version 2)
  > Enterprise Quality and Open Source (CDDL & GPL v2)
  > Java EE 5 Reference Implementation
  > Full Commercial Support from Sun
• Growing organically into other Middleware Areas
• Leverages Sun's experience in other Java, Middleware, SDK
• Key part of Sun's Open Source Business Model

                  GlassFish – The Best Open Source Application Server   4
  Glassfish Ecosystem
      Java EE RI & SDK

   Sun GlassFishJava EE RI & SDK
Enterprise Server 2.x


                                                                           Derby         Open Data Sync


                                                                                             Sailfin
                                                                         MQ
                                          Project
                                         GlassFish
                                                                         Portal Server


                                                             Open ESB




                         Users and Other Groups
                   GlassFish – The Best Open Source Application Server                                 5
  Frameworks and Applications
                                                         Quercus PHP
                             OSWorkFlow
                                                        OSCache
                                 Integration ORB                     Project Tango
   Apache Httpd                              CJUG-Classifieds
                                                            BIRT         jBPM
   DOJO
 Facelets                                    MyFaces
     Shale                                   ADF SiteMesh           WebDAV
                                      JSPwiki
                                               SEAM
                                                               Tapestry
                                          MC4J
            StringBeans Portal                                       AJAX
         BlogTrader                                               Wicket Equinox
Java WSDP
     Dalma                                    WebSphere MQ
                 GlassFish – The Best Open Source Application Server       EHCache6
GlassFish v2 Features
•   Java EE 5 compliant
•   Metro: .NET 3.0 web services interoperability
•   Clustering Architecture
•   Support for scripting languages
•   Modular and ultra fast web tier
•   Seamless IDE and tools integration
    > NetBeans, Eclipse, IntelliJ, Ant, Maven
• Support for the latest technologies (e.g., JAX-RS)
• Available as subscription or paid product

                   GlassFish – The Best Open Source Application Server   7
Java EE 5 = (J2EE 1.4).next
• Java EE 5 Theme: Ease of Development
• POJO-based programming
  > More freedom, fewer requirements
• Extensive use of annotations
  > Reduced need for deployment descriptors
  > Annotations are the default
• Resource Injection
• New APIs and frameworks


               GlassFish – The Best Open Source Application Server   8
.NET Interoperability using Metro
•   High level web services stack
•   Fully interoperable with .NET 3.0
•   Security, Reliability and Transactions
•   Fully integrated into Netbeans




                 GlassFish – The Best Open Source Application Server   9
Metro Overview (.NET Interop)


   Security      Reliability       Transactions            ...




              SOAP                    WSDL                             HTTP
                             Web Services Core

      JAXB                  JAXP                    SAAJ                      ...
                              XML Processing

                Metro – GlassFish Web Services Stack
                          metro.dev.java.net


                 GlassFish – The Best Open Source Application Server                10
Clustering Architecture
• Enhances scalability and availability
  > Transparent failures
  > Ability to add more nodes to cluster
• Runtime view of cluster
  > Router/Failover/Load Balancing module
  > Management module
  > Application state repository (ring configuration)




                 GlassFish – The Best Open Source Application Server   11
Clustering Architecture
                HTTP(S)                         JMS                               RMI/IIOP




                 Message Routing / Failover / Load Balancing
   Management




                                                                                      Clustered
                                                                                      Instances
                 AS     AS           AS      AS                        AS    AS
                                                       . . .                AS
                  Node A              Node B                           Node C


                  HA Application State Repository


                      GlassFish – The Best Open Source Application Server                         12
Ajax and Scripting Activities
• Dynamic Languages



  > glassfish-scripting.dev.java.net
• jMaki - http://ajax.dev.java.net
  > Very easily encapsulates Ajax widgets
• DynaFaces - http://jsf-extensions.dev.java.net
  > Ajax and JavaServer Faces




               GlassFish – The Best Open Source Application Server   13
Web Tier
• JSP Container
  > 10x perf. improvement in JSP compilation (JSR-199)
• Grizzly
  > Easy-to-use, highly scalable and customizable HTTP
    Framework
  > Based on java.nio
  > Integrates with current Apache Tomcat HTTP Connector




               GlassFish – The Best Open Source Application Server   14
   World Record Performance                                                                                                              900
                                                                                                                                                  SPECjAppServer 2004 Results
   SpecjAppServer 2004                                                                                                                   800




      > July 2007: #1 score on T2000
                                                                                                                                         700

                                                                                                                                         600




                                                                                                                                                                                            ?
                                                                                                                                         500



               > 883.66 JOPS@Standard for GlassFish v2                                                                                   400

                                                                                                                                         300



               > Improved in areas not covered by benchmark
                                                                                                                                         200

                                                                                                                                         100



               > 10% faster than BEA WebLogic
                                                                                                                                           0
                                                                                                                                                   Sun           BEA           IBM           JBoss




               > 30% faster than IBM WebSphere 6.1




Disclaimers: SPEC and the benchmark name SPECjAppServer 2004 are registered trademarks of the Standard Performance Evaluation Corporation. Competitive benchmark results stated above reflect
results published on www.spec.org as of 11/21/07. The comparison presented is based on GlassFish v2 UR1 run on 6 Sun SPARC Enterprise T5120 (1 chip, 8 cores/chip, 8 threads/core) 1.4GHz 8,439.36
SPECjAppServer2004 JOPS@Standard. For the latest SPECjAppServer 2004 benchmark results, visit http://www.spec.org/.


                                                   GlassFish – The Best Open Source Application Server                                                                                           15
GlassFish Adoption
• Millions of downloads




• Dozens of external committers
• Over 8,000 members
• Excellent analyst reviews
  > Gartner, Forrester, etc...


                   GlassFish – The Best Open Source Application Server   16
 Some Adoption Indicators
                                                • 2.5m+ hits in 13 months
                                                • 310k+ different IPs




• 150k registrations in 7 months
• 4.5m+ downloads in 12 months


               GlassFish – The Best Open Source Application Server          17
After this Presentation ...




           GlassFish – The Best Open Source Application Server   18
Who else is using GlassFish ...




           GlassFish – The Best Open Source Application Server   19
GlassFish Deployment




  blogs.sun.com/stories



        GlassFish – The Best Open Source Application Server   20
How to Save 3 Million Dollars?




          GlassFish – The Best Open Source Application Server   21
So Why GlassFish?
•   Java EE 5 (vs. Tomcat, JBoss, Websphere)
•   Performance! (vs. JBoss)
•   Administration (vs. JBoss, Tomcat)
•   Enterprise-ready (vs. JBoss, Tomcat)
•   Enterprise support (vs. Tomcat)
•   Ecosystem: OpenSSO, OpenESB, etc...
•   Community (vs. Weblogic, Websphere)

      “ Enterprise Features at Open Source price! “

               GlassFish – The Best Open Source Application Server   22
    Reference
•   http://glassfish.org
•   http://blogs.sun.com/theaquarium
•   http://blogs.sun.com/stories
•   http://blogs.sun.com/glassfishforbusiness
•   http://wiki.glassfish.java.net




                                                         Fast, Easy & Reliable
                                                       Modular, Embedable, Extensible

                  GlassFish – The Best Open Source Application Server              23
Part II – Technology
Highlight
JAX-RS and Jersey




                       24
Introduction to REST
• Give everything an ID
• Link things together
• Use standard methods (HTTP)
• Allow for multiple representations
• Stateless communications




             GlassFish – The Best Open Source Application Server   25
Give Everything an ID
• ID is a URI

  > http://mycompany.com/customers/corporationX

  > http://mycompany.com/products/125

  > http://mycompany.com/orders/5455




                GlassFish – The Best Open Source Application Server   26
Link Things Together
• Customer order #5455
  <order self="http://mycompany.com/orders/5455">
   <customer ref="http://mycompany.com/customers/corporationX"/>
   <product ref="http://mycompany.com/products/125"/>
   <amount value="3"/>
  </order>

• New identifiers are created
  http://mycompany.com/orders/5455/customer
  http://mycompany.com/orders/5455/product

                GlassFish – The Best Open Source Application Server   27
Use Standard Methods


Method Purpose
GET    Read, possibly cached
POST Create without a known ID
PUT    Update or create with a known ID
DELETE Remove



         GlassFish – The Best Open Source Application Server   28
Multiple Representations
• Offer data in a variety of formats
  > XML
  > JSON
  > (X)HTML
• Maximize reach
• Support content negotiation
  > Accept header
    GET /foo
    Accept: application/json
  > URI-based
    GET /foo.json

                GlassFish – The Best Open Source Application Server   29
Stateless Communications
• Long lived identifiers
• Avoid sessions
• Self-contained requests




              GlassFish – The Best Open Source Application Server   30
REST using JAX-RS
• Operations such as,
 GET http://mycompany.com/orders/5455
 PUT http://mycompany.com/customers/corporationX
  are mapped to resource class methods
• Mapping is controlled using Java annotations
• Resource classes are deployed as web applications in
  Glassfish


              GlassFish – The Best Open Source Application Server   31
Example Using JAX-RS
@Path("orders/{order_id}")
public class OrderResource {

  @GET
  @ProduceMime(“application/xml”)
  String getOrder(
       @PathParam("order_id") String id) {
    return “<order> ... </order>”;
  }

  ...

           GlassFish – The Best Open Source Application Server   32
Example Using JAX-RS (contd.)

 @GET
 @ProduceMime(“application/html”)
 String getOrderHtml(
      @PathParam("order_id") String id) {
   return “<html><h1>Order id:” + id +
       “</h1>...</html>”;
 }




          GlassFish – The Best Open Source Application Server   33
Example Using JAX-RS (contd.)

    @Path(“customer”)
    CustomerResource getCustomer(
        @PathParam("order_id") String id) {
      return new CustomerResource(
          getOrder(id).getCustomer());
    }

    ...
}



             GlassFish – The Best Open Source Application Server   34
Conclusions
• Glassfish community is growing rapidly
  > And you should be part of it!
• World class performance and J2EE 5.0 compliance
• Glassfish v3 already under way
• All the latest technologies including RESTful web
  services are available in Glassfish and Netbeans
• Download and try it now!




                GlassFish – The Best Open Source Application Server   35
Thank You



Santiago Pericas-Geertsen
Sun Microsystems, Inc.
http://weblogs.java.net/blog/spericas/
Santiago.PericasGeertsen@sun.com
                                         36

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:0
posted:10/17/2013
language:English
pages:36