The GlassFish Community: An Overview              The GlassFish Community       Delivering a Java EE Application Server   ...
At JavaOne 2005, Sun announced ProjectGlassFish, an initiative to open source itsApplication Server and the Java EEReferen...
platform: J2EE 1.2 - the versionnumber was chosen to match the           Application Servers at Sunaccompanying J2SE. Addi...
wide distribution releases like the J2EE 1.4 SDK.The SJS AS 8.x products were still available in 3 different versions: a P...
The Java PlatformsThe Java EE specification is an umbrella specification that builds on thecorresponding Java SE specifica...
to CDDL and became dual-licensed.Dual license means that either license                  Resource Injectioncan be used, an...
community, TmaxSoft had early access and ensured that a number of componentswere well suited to their needs. This meant th...
community to try the specifications earlier.We are just starting to learn how to use annotations. For example, the JAXB 2....
GlassFish v2GlassFish v2 was released in September 2007. The main and most importantfeature of this release is clustering ...
Web Tier Java SpecificationsGlassFish includes support for the latest JCP specs: JSP 2.1, JSF 1.2, Servlet 2.5and JSTL 1.2...
Clearly you no longer have to choose between Open Source and EnterpriseFeatures: you can have both.Disclaimers: SPEC and t...
Phobos (phobos.dev.java.net) is a lightweight, scripting-friendly, web applicationenvironment running on the Java platform...
GrizzlyThe lower layers of the Web Tier in GlassFish are implemented through theGrizzly Framework (grizzly.dev.java.net). ...
Web Services – MetroThe Web Services stack in GlassFish is called Metro. GlassFish v1 delivered a bigimprovement in Ease o...
Performance is a moving target and the JAX-WS 2.0 implementation doubles theperformance of the (once highly performant and...
works transparently; the developers can use the standard JAX-WS developmentmodel and declaratively add WS-* attributes usi...
leads to an inversion of control where state must be updated in response to events.A pull parser has the performance chara...
GlassFish Integration TechnologiesTopLink Essentials and JPAOne of the big functional improvements in the Java EE 5 specif...
OpenMQ MessagingGlassFish includes a production-quality        Message     Queue      implementation(mq.dev.java.net) that...
this implementation is used in other enterprise-level products at Sun. OpenESBintegrates into GlassFish through the JavaEE...
ToolsGlassFish has been collaborating with the NetBeans community through thedevelopment and implementationof the Java EE ...
Installation ExperienceAs mentioned earlier, GlassFish v2 has a single Installer that can be installed in anyof 3 differen...
Update CenterUpdate Center to deliver GlassFish add-on components, updates and to provide amechanism to enable community c...
This mechanism can be used for deploying new GlassFish features, frameworklibraries, and even entire web applications. You...
Future DirectionsGlassFish is a work in progress. We expect the community and the product tocontinue to evolve. The commun...
specification (JSR 316).Jersey (http://jersey.dev.java.net) is the reference implementation for JSR 311 andis closely foll...
Getting StartedA good place where to track the activities of the GlassFish community isTheAquarium (blogs.sun.com/theaquar...
Table of ContentsWhat is GlassFish ..........................................................................................
Getting Started......................................................................................................... 2...
Upcoming SlideShare
Loading in …5
×

GlassFish Article September 07

1,890 views

Published on

Oldies but goodies (GlassFish v2)

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,890
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
14
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

GlassFish Article September 07

  1. 1. The GlassFish Community: An Overview The GlassFish Community Delivering a Java EE Application Server Eduardo Pelegri-Llopart Yutaka Yoshida Alexis Moussine-Pouchkine Sun Microsystems, Inc. http://blogs.sun.com/theaquarium Last Updated September 2007The GlassFish Community 1
  2. 2. At JavaOne 2005, Sun announced ProjectGlassFish, an initiative to open source itsApplication Server and the Java EEReference Implementation (see inset:Project GlassFish). This was the first stepof open sourcing all the Java platform, but italso had other effects. Project GlassFish Project GlassFishaccelerated the adoption of Java EE 5,added a new enterprise-quality App Server Sun launched Project GlassFishto the options available to the Open Source in June 2005, during JavaOne, tocommunity, and has lead to a Open Source the Referencetransformation of how Suns AppServer is Implementation for Java EE 5 anddeveloped, tested, made available, and Suns Application Server.evolved, in the process creating a much The first release followed lessbetter product. than a year after, at JavaOne 2006A year and a half after the initial launch, the (May 2006).GlassFish community has already delivered The second release was releasedits first final release and is on its way to its in September 2007.second. In this article we will provide anoverview of all the aspects of the GlassFish The focus is now on GlassFish v3,Community and the GlassFish AppServer. the modular and lightweight application server (see HK2).What is GlassFishGlassFish is a Community and an Application Server. The communitys maindeliverables are a Java EE 5 compatible Application Server, the GlassFishAppServer, and the Reference Implementation for the Java Persistence API,TopLink Essentials.The GlassFish Community also delivers many other useful components includingreusable modules for JCP technologies included in Java EE 5, like JAXB, JAX-WS,JAXP, StAX, JSP and JSF. GlassFish also includes several popular Web.Nextprojects like jMaki, Phobos and DynaFaces, many tools, like the ContinuousIntegration tool Hudson, and useful infrastructure like Grizzly the NIO-based serverframework. The GlassFish community also maintains a Maven repository for allthese components.Java Platforms and Application ServersSun released Java in 1995 and the next year the Java Servlet API was presentedduring the first JavaOne(tm) conference. In 1999, Java Server Pages and EnterpriseJavaBeans were combined with Java Servlets into the first enterprise JavaThe GlassFish Community 2
  3. 3. platform: J2EE 1.2 - the versionnumber was chosen to match the Application Servers at Sunaccompanying J2SE. Addition releases Sun has used several brands for itsfollowed in 2001 (J2EE 1.3) and 2003 Application Servers. The most recent(J2EE 1.4) and then, in a name change, releases are:Java EE 5 in 2006. ● iPlanet AS 6.0 – Originally fromThe Java EE specifications have been Netscape (Netscape AS) J2EE 1.2adopted widely by both vendors and compatibleenterprises and many software ● SunOne AppServer 7.0 – First releasevendors, Sun included, have including J2EE 1.3 RIimplemented them in their Application ● Sun Java System AppServer 8.0 –Servers. For a number of years, Sun J2EE 1.4 compatibleused to distribute both a Reference ● Sun Java System AppServer 9.0 –Implementation (see inset: What is a Java EE 5 compatible. GlassFish v1.Reference Implementations) and a ● Sun Java System AppServer 9.1 –Commercial Application Server,marketed under different brands. Java EE 5 compatible. GlassFish v2. These two offerings had different What is a Reference properties: the RI was focused on Implementation development and teaching the Specifications created through the Java specifications and was free for Community Process (JCP) are the outcome development but could not be of an Expert Group (EG) coordinated used in deployments, while the through an EG Lead. Commercial product was for The Expert Group delivers: revenue and was focused on Deployers. The two offerings ● A Specification Document have converged over time, ● A Technology Compatibility Kit (TCK) starting with the 7.0 release ● A Reference Implementation (RI) where the commercial product (then under the Sun One brand) The RI implements the Specification and included for the first time the passes the TCK. functionality from the J2EE 1.3 The quality of the RI can vary from a proof SDK and continuing through the of concept to a production-quality 8.x and 9.x releases under the implementation. GlassFish is production Sun Java System brand (see inset: quality, Java EE 5 compliant, Application Java AppServers at Sun). Server. By J2EE 1.4, the RI was identical Strictly speaking, the Java EE 5 RI is a to the SJS AS 8.0 PE, was free specific snapshot of the GlassFish code base for development and that has been declared as such. deployments, and was included inThe GlassFish Community 3
  4. 4. wide distribution releases like the J2EE 1.4 SDK.The SJS AS 8.x products were still available in 3 different versions: a PlatformEdition (PE) which was identical to the RI, a Standard Edition (SE) that includedsome enterprise-quality features likeClustering and Failover, and an Open Source LicensesEnterprise Edition (EE) version that wastargeted to the high-availability (99.999% The Open Source Initiative (OSI)availability) market. Starting with the 9.x recognizes a diverse set of licenses.releases, all these features are being Licenses often have a lineage fromincorporated into a single version which which they inherit some of theiris being developed transparently by the properties.GlassFish community under an Open The ASL license is in the lineage ofSource license. The user is free to BSD and the MIT license. ASL isconfigure GlassFish using profiles: quite flexible in usage.developer, cluster, and enterprise. GPL, LGPL, GPLv2 and GPL+CPE are all GNU licenses. GNU licensesThe GlassFish AppServer emphasize preserving the “freedom”Sun announced Project GlassFish in June of the code base. The GPL licenses2005, during JavaOne 2005. Less than a are project based.year after that, at the next JavaOne in The CDDL license is a derivativeMay 2006, the first release was made from MPL, the Mozilla Publicavailable to the public and the Java EE 5 License. Unlike the GPL licenses,specification went final . This AppServer these licenses are file-based.was made available at Suns downloadsites under the Sun Java System 9.0 PE A good place to learn about openname and at the community site under the source licenses is the OSIGlassFish v1 name but both are identical foundation (opensource.org).except for the choice of installer.GlassFish v1 focused on implementing the Java EE 5 specification and some of theenterprise-level features were not included in the first release. To reflect this, theAppServer was labeled PE in the Sun distribution. GlassFish v2 adds back all thesefeatures and drops the PE label altogether because the features have been fullyintegrated: the same executable can be installed in a developer, an enterprise or acluster profile, depending on the intended use.GlassFish v2 is from Suns sites under the Sun Java System AS 9.1 name. It wasreleased in September 2007.The GlassFish Community 4
  5. 5. The Java PlatformsThe Java EE specification is an umbrella specification that builds on thecorresponding Java SE specification (e.g. Java EE 5 requires Java SE 5) andincludes many other JCP specs; the GlassFish community reflects this and includesa number of subprojects that are the official reference implementation for most ofthese specifications. Using separate subprojects has several benefits, includingmaking it easier to reuse the implementation by other groups and projects. Forexample, the JAXB implementation is used in many projects, most of them notrelated to Sun.The Java standard APIs are developed in Expert Groups using the Java CommunityProcess and many Expert Group leaders are members of the GlassFish community.The GlassFish community implements these specs and also provides feedbackduring the review process and submits requests towards future releases.The work on Java EE 6 has started with JSR 316 which is an umbrella projectgrouping together specifications such as EJB 3.1, JPA 2.0, etc... GlassFish v3 willimplement Java EE 6.Open Source and GlassFishOne of the first widely adopted server-side Java projects was Tomcat. Tomcat wasstarted at Apache by a group that included Sun and the JServ developers andbecame the Reference Implementation for the early versions of the Java Servletsand Java Server Pages specifications (the RI for the latest specs is GlassFish).Tomcat was critical to the early adoption of server-side Java, was available underan Open Source license and contributed to the popularity of Open Source softwarewithin enterprise organizations.There are many different licenses (see inset: Open Source Licenses) and we willnot try to characterize them in detail in this article. Different licenses have differentproperties that attract different communities: what one community perceives as abenefit in one license may be perceived as a drawback by another; for example, theApache community uses ASL licenses while the GNU community uses GPLlicenses.When GlassFish was launched, it used only the Common Development andDistribution License (CDDL) but, for the open sourcing of Java SE and Java ME inNovember 2006, Sun reevaluated the requirements of the different communitiesand decided to use the GPLv2 license for Java ME and GPLv2 with the ClassPathException (GPLv2+CPE) for Java SE. Using a GPL license provided more synergywith the GNU ClassPath and Kaffe communities, and CPE enables linking againstnon-GPL artifacts. At that moment, the GlassFish community added GPLv2+CPEThe GlassFish Community 5
  6. 6. to CDDL and became dual-licensed.Dual license means that either license Resource Injectioncan be used, and thus we can maintain J2EE 1.4 requires a fair amount ofthe benefits that CDDL provides to the template code. The following isGlassFish commercial partners and add typical for EJB References:synergies with the GNU, Java SE and Context initial = new InitialContext();Java ME communities. In any case, Context myEnv = (Context)initial....there is no binary license in the Object objref = myEnv.lookup(“...”);GlassFish distribution. ConverterHome home = (ConverterHome) PortableRemoteObject.narrow(...); Converter currentConverter = home.create();GlassFish and Java EE 5Adoption In Java EE 5, through convention and resource injection, we can justThe presence of an Open Sourced, say:production quality, implementation ofJava EE 5 has accelerated the adoption @EJB Converter currencyConverter;of the Java EE 5 platform by creatingdemand and providing supply. As of this writing, there have been WS Endpoints in Java EE 5 over 3.5 million downloads of GlassFish and these developers and The following code snippet shows a WS deployers (see insert: Going to end point: Production) have been exposed to the import javax.jws.WebService; benefits of Java EE 5 and has @WebService increased demand for its support. The public class MySimpleWS { GlassFish AppServer has satisfied public String sayHello(String s) { some of that demand but it has also return “Hello” +s; helped other Java vendors as } GlassFishs production-quality } components can be used to complete a Java EE 5 compliant This can be converted into a (transactional) implementation more quickly and/or Stateless Session Bean as follows: more cost-effectively. import javax.jws.WebService; Vendors using GlassFish include import javax.ejb.Stateless; TmaxSoft, Oracle, BEA, JBoss, Jetty @WebService and Geronimo. TmaxSoft is a leading @Stateless Java EE licensee in Korea and their public class MySimpleWS { latest relese JEUS 6 uses JAXB, public String sayHello(String s) { JAX-WS, Fast Infoset, JSP, JSF and return “Hello” +s; TopLink Essentials Through its } participation in the GlassFish }The GlassFish Community 6
  7. 7. community, TmaxSoft had early access and ensured that a number of componentswere well suited to their needs. This meant that TmaxSofts JEUS 6 became thefirst Java EE 5 certified AppServer after Suns own AppServer.Oracle has not yet released a full Java EE 5 AppServer but they are a maincontributor to the TopLink Essentials project in the GlassFish community andOracle is including this implementation in their products. Of the vendorsmentioned above, BEA uses JAXB and JAX-WS, JBoss uses JAXB and JSF, Jettyuses JSP and Grizzly and Geronimo uses JAXB.Overview of JavaEE 5The main theme of Java EE 5 is Ease of Development and a main tool toaccomplish this is the use of annotations from Java SE 5 to enable programmingbased on POJOs – Plain Old Java Objects. Annotations are used in many waysincluding indicating properties of methods and classes (see inset: Endpoints inJava EE 5), resource injection (see inset: Resource Injection), and as portabledescriptions of behavior (see inset: Annotations Are the Default).The main Java EE 5 specifications are: ● JAX-WS 2.0 & JAXB 2.0 ● EJB 3.0 & Java Persistence API ● JSF 1.2 & JSP 2.1 ● StAXA number of other specifications (like JAXP and Servlet) have also had smaller,maintenance, releases. The overall effect of all these changes in the developerexperience has been very substantial.Java EE 5 and GlassFish have hada very symbiotic relationship: the Annotations are the Defaultstrength of the Java EE 5specification has increased the This is a typical JAXB 2.0 generated code.value of GlassFish and the @XmlAccessorType(FIELD)availability of GlassFish has @XmlType(name=””,propOrder={“x”,”y”})validated Java EE 5. We expect @XmlRootElement(name=”point”)this relationship to continue in public class Point {future versions of the Java EE protected float x, y;platform with an even more public float getX() {return x; }effective feedback loop in the public setX(float value){ this.x = value; }evolution of the specifications public float getY() {return y; }themselves, as the early availability public void setY(float value) { this.y = value;}of the implementations enable the }The GlassFish Community 7
  8. 8. community to try the specifications earlier.We are just starting to learn how to use annotations. For example, the JAXB 2.0specification is structured in two parts. One part describes how to map betweenXML Schema into annotations; the other describes the semantics of thoseannotations. This means it is possible to change the generated code and it will stillrun portably in any conformant AppServer. In particular, we take the codedescribed in the insert and add code that will perform side-effects on setters andgetters, and it will be portable.GlassFish ReleasesThere are three versions of GlassFish at different phases of development: v1, v2and v3. With the caveat that these are the early days of the community and we arestill creating the process, so far, the cycle for a GlassFish release is as follows:● Concept Creation – Collecting key features, rough time-frame, prototyping● Active Development – Implementation leading to usable Milestones and a final release.● Maintenance – Bug fixing of final releases, creating Update Releases.GlassFish v1 is in maintenance mode, GlassFish v2 was very recently released andthus has entered a maintenance mode. GlassFish v3 is currently moving from aconcept creation phase to active development. It will most likely be released inphases given its modular approach.GlassFish v1GlassFish v1 is in maintenance mode. The final v1 release was on May 2006, rightbefore JavaOne 2006 and was followed by a bug-fixing v1 UR1 in October 2006and a second, smaller, v1 UR1p1 release in December 2006. There are no moremaintenance releases scheduled at this time, as the development has moved to v2.A distinguished release of GlassFish v1 was named as the official Java EE 5 RI.GlassFish v1 is also distributed by Sun under the name Sun Java System AS 9.0 PEand it is included in a number of downloads distributed by Sun, including the JavaEE SDK, the Java Application Platform SDK and the NetBeans 5.5 Tools Bundle.The only difference between GlassFish v1 and SJS AS 9.0 PE is the installer. Sunprovides different levels of commercial support for final versions of GlassFish v1(and SJS AS 9.0 PE), and the community provides best-effort, but good, support.The GlassFish Community 8
  9. 9. GlassFish v2GlassFish v2 was released in September 2007. The main and most importantfeature of this release is clustering (grouping, load-balancing, data replication).GlassFish v2 includes all the enterprise-quality features from the SJS AS 8.2SE/EE releases and will be tested against all the products in the Java EnterpriseSystem set of middleware offerings. GlassFish v2 supports the concept of profilesand the same executable can be configured in a developer, enterprise or clusterprofile. The enterprise profile can also be configured to use HADB (HighAvailability Data Base) for very high (99.999%) availability.GlassFish v2 is also distributed by Sun under the Sun Java System AS 9.1 label andincluded in a number of bundles (such as Java ES 5.1). Community andCommercial support are provided.GlassFish v3GlassFish v3 was presented at JavaOne 2007 and drew quite a bit of interest. Itsarchitecture is modular by default, its kernel is extremely small (under 100Kbwhich makes it suitable for desktop and even mobile use), and its startup time isunder a second. Containers supported by the modular kernel are multiple and so farJava Web, PHP (via Cauchos Quercus), jRuby on Rails, Phobos JavaScript areintegrated. More will follow and you are encouraged to write your own.A preview version of GlassFish v3 is available from http://glassfish.java.net anddocumentation is available from http://wiki.glassfish.java.net andhttp://hk2.dev.java.net.Active development on GlassFish v3 is starting right now. Planning is still ongoingbut the modular nature of the development will likely enable phased releases up toa full Highly-Available Java EE 6 product.GlassFish v2 FeaturesThis section describes the features in GlassFish v2 as that release should be in betaby the time of publication. There are many features and will just provide a briefoverview of each of them; more information is available online (see inset: UsefulLinks).The Web Tier is the workhorse of most Enterprise Applications and GlassFishprovides very rich Web Tier support.The GlassFish Community 9
  10. 10. Web Tier Java SpecificationsGlassFish includes support for the latest JCP specs: JSP 2.1, JSF 1.2, Servlet 2.5and JSTL 1.2.Java Server Faces (JSF, the next-generation standards-based MVC framework) wasadded to the platform in Java EE 5 and provides a component model for the Javapresentation layer. JSF can be used with JavaServer Pages (JSP) or with othertechnologies like facelets. JSF 1.2 has a number of improvements over the earlierreleases, most notably the unified expression language that is now shared betweenJSF and JSP. JSF 1.2 also has several improvements targeted at the request cycle,including improved AJAX support.The main change in JSP 2.1 has been the unified EL; Servlet 2.5 and JSTL 1.2 havealso received some changes but not as deeper.GlassFish also has a number of substantial improvements beyond the spec changes.The JSF implementation has had substantial improvements on the performance andit a few key bugs have been addressed. The JSF implementation is also used byJBoss and a few other groups. The Servlet container still has its origins in Tomcatbut it is now maintained separately for stability and performance.Another noteworthy change in GlassFish is Jasper, the JSP compiler, which cannow take advantage of the compiler APIs (JSR-199) in Java SE 6 to avoid file IOand compile much faster (informally 10x faster). Jasper can also be configured touse the Eclipse JDT compiler, although it is not as fast as when using JSR-199. TheJSF implementation has also been improved substantially although we do not havebenchmark results handy at the moment.GlassFish recently also started using the high quality JSF components from ProjectWoodstock, which should be of interest to many developers on their own right. Thecomponents have been open sourced at http://woodstock.dev.java.netPerformance ImprovementsThere are many areas where the performance of GlassFish v2 has improved. Apartial list includes JSF, JSP and Grizzly in the web tier, JAXB and JAX-WS inWeb Services, CORBA and EJB.The net result of all these efforts are simply a world record in SPECjAppServer2004 numbers. In July 2007, Sun announced a the #1 result on a T2000 machinewith 883.66 JOPS@Standard. This is 60% faster than GlassFish V1/SJSAS 9.0,10% faster than BEA WebLogic and 30% faster than IBM WebSphere 6.1!Another benchmark result (813.73 JOPS@Standard using the PostgreSQLdatabase) shows a 3x price/perf ration versus an Oracle on HP score.The GlassFish Community 10
  11. 11. Clearly you no longer have to choose between Open Source and EnterpriseFeatures: you can have both.Disclaimers: SPEC and the benchmark name SPECjAppServer 2004 are registeredtrademarks of the Standard Performance Evaluation Corporation. Sun Fire T2000(1 chips, 8 cores) 1.4ghz 883.66 SPECjAppServer2004 JOPS@Standard.Competitive benchmark results stated above reflect results published onwww.spec.org as of 07/10/06. For the latest SPECjAppServer 2004 benchmarkresults, visit http://www.spec.org/.A separate effort has been made to improve start-up performance. The startup andshutdown architecture has been simplified substantially and all start-updependencies have been analyzed to minimized unneeded service initializations.The result is substantial reductions of start-up and shutdown times of both simpleinstances or entire clusters.Compatibility With Popular FrameworksOne of the core strengths of the Java community over the years has been itsdiversity and this diversity is particularly visible in the Web Tier in the form ofmany frameworks. These frameworks improve substantially the productivity of thedevelopers and one of the explicit goals in the GlassFish Community has been toensure that these frameworks work well, out of the box, with the differentGlassFish releases. A similar approach has been taken with popular applications.The list of frameworks is large and always growing; a small subset includesAppFuse, DWR, Facelets, IBATIS, JBoss Seam, Shale, Spring, Struts, Tapestry,WebWork, Wicket... etc.AJAX SupportThe GlassFish Community is pursuing a number of projects in the area of AJAX.In most of these cases, the projects are not GlassFish-specific, a few may dependon extensions specific to GlassFish.jMaki (ajax.dev.java.net) is a framework that provides a lightweight model forcreating JavaScript centric AJAX-enabled web applications using Java, PHP, andPhobos. The model is based on JavaScript, HTML and CSS and can be modifiedeasily. jMaki works with a number of AJAX widget libraries, including Dojo,Yahoo, Scriptaculous, Google and Spry and it is very easy to add new ones. jMakihas shallow dependencies on the server model and it is easy to adopt andincorporate.The GlassFish Community 11
  12. 12. Phobos (phobos.dev.java.net) is a lightweight, scripting-friendly, web applicationenvironment running on the Java platform, aimed at addressing emerging developerrequirements. The initial focus of Phobos is on the use of JavaScript but the designsupports the use of other dynamic languages as well. Phobos is a more ambitiousproject than jMaki and it is at an earlier stage of development but it is showinginteresting synergies. Using JavaScript on the server and the client side simplifiestransfering content through JSON as well as reusing some code. The Java scriptingengine Rhino is also very solid and extensions such as E4X and bytecodecompilation are also available. Phobos ArchitectureGlassFish also have several JSF-specific projects related to AJAX, includingWoodstock, a collection of JSF components that include AJAX components, andDynamic Faces which explores high-quality integration of AJAX into JSF. AJAXis also supported through projects like DWR and AJAX4JSF.The GlassFish Community 12
  13. 13. GrizzlyThe lower layers of the Web Tier in GlassFish are implemented through theGrizzly Framework (grizzly.dev.java.net). The framework is written in Java takingadvantage of the NIO APIs (scalable network and file I/O) to provide scalabilityand is also highly customizable, and fairly general. The role of the Grizzly HTTPconnector is similar to that of the Java-based Coyote connector used in Tomcat andthat of the C-based Apache Portable Runtime (APR). Informal initial tests haveshown very good scalability.Grizzly has generated a fair amount of interest because it makes it much easier totake advantage of NIO; for example, both AsyncWeb and Jetty have prototypedintegrations with it. Grizzly is in the process of being generalized further to provideadditional functionalities and better address the needs of other groups, inside andoutside the GlassFish community.Grizzly can be used separately from GlassFish, and that is how it is for instanceused in the NetBeans plugins for Phobos and Ruby. Grizzlys flexibility can beused to provide efficient support for “long-lasting HTTP connections”, also knownas Comet, which can be used in applications like Chat, online calendaring ordocument sharing, and continuously updated content.Alternatives in the Presentation LayerA common theme in the GlassFish community is to embrace diversity. There aremany reasons for this, from “competition fosters quality” to “one size does not fitall” to “innovation happens everywhere”. This applies specially to the presentationlayer where GlassFish enables the typical frameworks based on the Java platformas well as several newer alternatives. In some cases these alternatives layer directlyon the GlassFish AppServer; in some, they live alongside it.As indicated, server-side JavaScript is supported via the Phobos project. In thiscase, the JavaScript server-side code is executed on GlassFish using the Rhinointerpreter.Ruby-based applications, most notably Rails, can be executed in two differentapproaches. In one, Rails executes on jRuby, on top of the Java Platform. In theother Rails executes on the native Ruby interpreter, which communicates withGlassFish via the CGI interface. Rails on GlassFish is a particularly attractivearrangement and is being explored aggressively, so stay tuned for futuredevelopments.PHP can also be used with GlassFish and the Quercus PHP 5 implementationdeveloped by Caucho in Java. The Caucho and GlassFish communities are workingtogether to make Quercus work on GlassFish.The GlassFish Community 13
  14. 14. Web Services – MetroThe Web Services stack in GlassFish is called Metro. GlassFish v1 delivered a bigimprovement in Ease of Development through the new JAX-WS 2.0 API (jax-ws.dev.java.net). GlassFish v2 refines that slightly into JAX-WS 2.1 but the majorchange is in the implementation which is the result of several years of evolutionand several redesigns. The Metro implementation is very sophisticated, fullyfeatured and has high performance as shown in our benchmarks with 30%-100%performance improvement over the AXIS 2 stack (see image below) we believe itis industry-leading technology. JAX-WS 2.0 is also available in Suns Java SE 6 RIand it can be upgraded to JAX-WS 2.1.SJS AS 8.2 had an implementation of JAX-RPC 1.1. The initial implementation ofJAX-WS 2.0, used in GlassFish v1, was loosely based on that but it has gonethrough two sets of changes since then two address two major challenges. The firstchallenge is driven by the new specification: unlike JAX-RPC 1.1, JAX-WS 2.0delegates all data binding decisions to JAXB 2.0 and also carefully enables non-HTTP protocols. On top of this, Sun recognized a while ago the performance costof XML textual encodings and has been participating in different standard bodiesinvolved in efficient XML encodings (see inset: Fast Infoset).The result was a rearchitecture of the JAX-WS implementation that clearlyseparated Transport, Encoding, and Data Binding. This new Metro architecture hasbeen integrated into GlassFish v2 and supports: ● Multiple Transports – HTTP, JMS and TCP/IP have been implemented and SMTP has been designed. ● Multiple Encodings – Textual XML, MTOM, and Fast Infoset are supported ● Data Binding – Data Binding is handled by JAXB and the handover is done very carefully to avoid copying data around.The architecture is designed to support multiple, stackable, processing entities,each implementing one of the WS-* specifications, without incurring data copies.The structure is as shown below.The GlassFish Community 14
  15. 15. Performance is a moving target and the JAX-WS 2.0 implementation doubles theperformance of the (once highly performant and competitive) older JAX-RPC 1.1stack. The performance results of recent Metro (JAX-WS 2.1) stack compared toAxis 2 show the intent of the GlassFish team to provide the best stack in theindustry.Throughput is not the only important performance metric; in some contextsscalability is even more important and the Business Integration group wanted to beable to process thousands of transactions, some of them fairly long-lived. Theimplementation does this through an execution model where tasks share a pool ofexecution threads so very few threads are needed to efficiently execute a very largenumber of transactions.WSIT and Project TangoOne of the appeals of Web Services is as an interoperability vehicle between theJava and the Microsoft platforms. Project Tango is the initiative within theGlassFish Community that is delivering that interoperability, and WSIT (WebServices Interoperability Technologies) is the formal name (wsit.dev.java.net). Thisis a subset of Metro (metro.dev.java.net).A detailed description of the Project Tango feature in Metro is available in thiscomplete overview article: http://wsit.dev.java.net/docs/tango-overview.pdfWSIT takes advantage of the new WS architecture in GlassFish v2 and thedifferent WS-* standards are processed by elements in the WS pipeline. WSITThe GlassFish Community 15
  16. 16. works transparently; the developers can use the standard JAX-WS developmentmodel and declaratively add WS-* attributes using NetBeans (a NBs plugin isincluded). The standards are to ensure interoperability with other vendors, mostnotably Microsoft. The interoperability has been tested in a number of WSPlugfests.The following standards arecurrently supported: Fast Infoset ● Boostrapping: WS- XML documents can be quite verbose MetadataExchange, WS- which hinders their applicability in some MetadataExchange WSDL, areas, not just because of size but also due WS-Transfer to transmission cost. An encoding like Gzip reduces size but it does so at the ● Reliable Messaging: WS- expense of encoding time, and the Fast ReliableMessaging, WS- Infoset ANSI/ISO standard provides a ReliableMessaging Policy better overall trade-off. ● Atomic Transactions: WS- As of this writing there are 4 different Coordination and WS- commercial implementations of Fast Atomic Transaction Infoset but other standards may also gain ● Security: WS-Security, WS- traction (for instance the W3C EXI SecurityPolicy, WS-Trust, Working Group is also looking into this WS-SecureConversation area), so the GlassFish Web Services stack is designed to support multiple ● Policy: WS-Policy, WS- encodings. It currently supports the PolicyAttachment MTOM and Fast Infoset encodings – in addition to textual encodings – but it willXML Processing also support other standards as they appear.GlassFish includes support for theJAXP and the StAX APIs for XML Fast Infoset can be used with WSIT. Theprocessing. Windows Communication Foundation (WCF) also provides encoding isolationThe Streaming API for XML and some vendors exploit it for FI support(StAX) is a new XML parsing APIthat was lead by BEA and it is anew addition to the Java Platform; it is included in the Java EE 5 and Java SE 6platforms. StAX can be used as an alternative to SAX and DOM and has differentperformance and API characteristics. DOM is an in-memory, document-centeredAPI. The result of parsing a document is a collection of objects than can then benavigated in any order, but this flexibility is has substantial performanceimplications both in memory consumption and in parsing performance. SAX is anevent-driven API where callbacks can be invoked as new elements in the XMLdocument are parsed. SAX has better performance characteristics than DOM but itThe GlassFish Community 16
  17. 17. leads to an inversion of control where state must be updated in response to events.A pull parser has the performance characteristics of SAX but the main coderemains in control as it pulls the events when / if it needs them. Recent GlassFishdevelopment include working with the Woodstox community (a highly optimizedStAX implementation from Codehaus.org).The latest JAXP specification is JAXP 1.4. JAXP 1.4 is a maintenance release fromJAXP 1.3; JAXP 1.4 includes a number of improvements and cleanups but itsmajor change is that it incorporates StAX (by reference). JAXP 1.4 is included inJava SE 6 while J2SE 5.0 only includes JAXP 1.3. GlassFish can be used withJ2SE 5 or Java SE 6.The JAXP 1.4 implementation delivers both JAXP 1.4 and StAX, but the StAXimplementation is also available separately. All implementations are done withinthe GlassFish community and are delivered through the different release vehicles.XML Data BindingXML Data Binding in Java EE is done through the JAXB API; the version requiredby Java EE 5 is JAXB 2.0 (jaxb.dev.java.net) which, like in the case of JAX-WS,provides a substantial improvement over the corresponding J2EE 1.4 specification.This improvement has been recognized by the Java community and we are seeing avery fast switch to the new specification.The JAXB 2.0 implementation is very high quality, fast, and fully featured. TheJAXB developers have also been very receptive towards other communities and theresult has been that many groups are using the JAXB implementation, includingJBoss, Apache Axis, Apache XFire, TmaxSoft, ServiceMix, and ActiveSOAP.Newer than Java EE 5The Java EE 5 specification requires JAXB 2.0 and JAX-WS 2.0 and those are thespecifications implemented by GlassFish v1 and Java SE 6. Experience with theseimplementations in multiple use cases, including Web Services Interoperabilitywith Microsofts Windows Communication Framework, has lead to compatiblerefinements to these specifications in the form of JAXB 2.1 and JAX-WS 2.1.x.These are the specifications implemented by GlassFish v2.The GlassFish Community 17
  18. 18. GlassFish Integration TechnologiesTopLink Essentials and JPAOne of the big functional improvements in the Java EE 5 specification is theaddition of the Java Persistence API (JPA) and the new version of the EnterpriseJavaBeans Specification, EJB 3.0. These APIs evolve from the earlier EJB 2.1 buttake advantage of new Java language features like Java annotations and incorporatethe experiences from communities like Hibernate, Oracle TopLink and JDO.The two APIs can be used separately. JPA provides a simple programming modelfor entity persistence and it is available separately of Java EE 5 and can be usedwith J2EE 1.4 and even Java SE; it also includes an API for plugging differentpersistence providers. The rest of the EJB specification has gone through extensivecleanup and simplification and uses JPA. Both specifications have been very wellreceived and are gaining wide adoption.TopLink Essentials (TLE) is the JPA implementation in the GlassFish Community.It was started with a big contribution from Oracle Corporation, building on theirlong experience with the Top Link products, and since then it has been a jointproject with Sun. The initial implementation of TLE like GlassFish v1, was drivenby spec compliance, but TLE is intended to be a fully featured implementation andOracles plan is to continuously enhance its features drawing on the capabilities inTopLink and contributions from the wider community. TopLink Essentials is usedin a number of Oracle commercial products, including their AppServer, in Sunsdistributions of GlassFish and in NetBeans, and in several other containersincluding Apache Tomcat, TmaxSofts JEUS, Spring 2.0 and EasyBeans.The pluggability feature also means that it is quite easy to take other JPAimplementations and plug them into the GlassFish AppServer. This has beensuccessfully done for Apache OpenJPA and Hibernate and is very popular.CORBAGlassFish includes a fully featured CORBA implementation. This implementationhas been improved consistently for a number of years, for instance in GlassFish v2it now generates stubs and skeletons dynamically and it is exploiting the NIOframework. GlassFish v2 will also include a number of key performanceimprovements.The GlassFish Community 18
  19. 19. OpenMQ MessagingGlassFish includes a production-quality Message Queue implementation(mq.dev.java.net) that provides: ● Message buffering between enterprise system components ● Scalable distribution of message servers (broker clustering) ● Integrated SOAP / HTTP messaging ● Java and C Client API ● Scalable JCA 1.5 compliant Resource Adapter ● Enterprise Administration Features ● Extensive JMX supportGlassFish also includes the Generic Resource Adaptor for JMS which can be usedwith a number of different Messaging Solutions, including: Tibco, WebSphere MQ6, Active MQ and JBoss Messaging.Java Business IntegrationGlassFish v2 also includes support for the Java Business Integration (JBI) API.This JCP specification (JSR-208) defines the core of a service oriented integrationbus and component architecture for integration. JBI standardizes the commonmessage routing architecture, plug-in interfaces for service engines and bindings,and a mechanism to combine multiple services into a single executable andauditable unit of work.The implementation included in GlassFish v2 is that from Project OpenESB andThe GlassFish Community 19
  20. 20. this implementation is used in other enterprise-level products at Sun. OpenESBintegrates into GlassFish through the JavaEE Service Engine, and this sameinterface can be used to use other implementations like ServiceMix. There is alsofirst-class tooling provided by the Enterprise Pack of NetBeans (Service Assemblyeditor, graphical WSDL and XSLT editors, and an Intelligent Event Processor.)Clustering and State ReplicationGlassFish v2 includes clustering support with dynamic clustering and memoryreplication. Dynamic clustering is provided through Project Shoal(shoal.dev.java.net) a generic framework that takes advantage of JXTA to enablean application to dynamically become a member of a predefined cluster, and assuch, is subscribed to cluster events, such as: ● Member join, planned shutdown, failures ● Recovery member selection ● Automated delegated recovery initiationGlassFish v2 also provides In-Memory Replication for a light-weight, low-costsolution for HTTP Session persistence and Stateful (EJB) Session Beanpersistence. This is sufficient for most applications but, for those requiring99.999% availability, it is still possible to use the High Availability Data Base(HADB) persistence solution.The GlassFish Community 20
  21. 21. ToolsGlassFish has been collaborating with the NetBeans community through thedevelopment and implementationof the Java EE 5 specification andNetBeans was the first IDE tosupport GlassFish. Since thelaunch, IntelliJ, JBuilder andMyEclipse have also addedsupport for GlassFish. Morerecently a plugin for Eclipse 3.3(Europa) was also released.In a different angle, the GlassFishcommunity includes a number oftools and some of them havebecome quite popular. on theirown right.One tool worth mentioning here is Hudson, a Continuous Integration tool that isbeing used to perform builds, execute tests, and more. Hudson is simple to setup,supports multiple slave machines and has a plug-in architecture that can be used toextend its functionality.AdministrationOne of the strengths of GlassFish v2 is its administration. It includes a fullyfeatured task-driven GUI Administration, as well as a command-line interface witha complete TCL interpreter and such niceties as a do what I mean mechanism forcorrecting typos. GlassFish also includes JMX-based management, as well asmanagement for Clusters and Load Balancing.The GlassFish Community 21
  22. 22. Installation ExperienceAs mentioned earlier, GlassFish v2 has a single Installer that can be installed in anyof 3 different user profiles: developer, cluster or enterprise. The install processusing the bits from http://glassfish.java.net is an easy two-step command-lineprocess: install, then configure. Note that it is possible to upgrade from a developerprofile to a cluster profile.The bundle itself is substantially smaller (around 55 MB) than in the past thanks toits use of the Pack200 compression technology (also used in the Java SE 6installation bundle).In its Sun Java System Application Server incarnation, the installer is a little moresophisticated and graphical.On Ubuntu, the installation is, as expected, available through apt-get.Sun Java System Application Server 9.1 is also available and supported as part ofJava Enterprise System 5 Update 1.The GlassFish Community 22
  23. 23. Update CenterUpdate Center to deliver GlassFish add-on components, updates and to provide amechanism to enable community contributions. Various different add-oncomponents are delivered through Update Center today.The GlassFish Update Center is an open source project hosted onhttp://updatecenter.dev.java.net. The initial release with GlassFish V2 is focusingon providing simple download and installation experience of additionalapplications for GlassFish.The Update Center functionality in GlassFish is implemented across two tiers. Onthe server side, we have Update Center modules and corresponding catalog XMLfile. The client side is part of GlassFish V2 installation. When started, UpdateCenter client (located in the /updatecenter directory of the GlassFishdistribution) connects to a predefined Update Center server URL. It thendownloads available catalog file, compares it to local installed component registryand uses catalog information to show components available for installation orupdate. Afterwards, based on users selection, components are downloaded andinstalled.The GlassFish Community 23
  24. 24. This mechanism can be used for deploying new GlassFish features, frameworklibraries, and even entire web applications. You can create your own update centeradd-on module, package it, test it and made it available by simply adding additionalUpdate Center definitions to the client software.GlassFish in ProductionA common property of Open Source projects is an accelerated adoption cycle asusers can decide when to use the technology based on their assessment of thereadiness of the technology and their own feature/risk status. In the case ofGlassFish we are seeing this accelerated adoption on GlassFish v1, and even onGlassFish v2. Deployment stories are just the last stage of feedback loop that iscritical to the success of GlassFish, and we are collecting them athttp://blogs.sun.com/stories.An adoption example is Peerflix (peerflix.com), the media-sharing community,which recently re-architected their infrastructure and switched from a Microsoftinfrastructure to GlassFish v1. The newer site uses JSF with Facelets and ApacheShale for the presentation layer and Kodo JDO for persistence on an MySQLdatabase, all running on Solaris 10. Initial experience with the site has been verypositive. Another great example is the high-volume (Australias third largestcommercial site in Australia) wotif.com website choosing GlassFish over JBoss.Developing GlassFishGlassFish is developed in a transparent manner with community participation andcooperating with other communities. The community and the development processhave had a core impact on the result and have created a product that, whencompared with one created through our earlier, traditional, development process, isbetter suited to the needs of the customers, has higher quality through a faster andmore accurate feedback loop, and goes through a faster and more agiledevelopment cycle.Some of the impact has been unexpected; for instance, the use of externalcommunication vehicles (web sites, blogs, mailing lists, etc) enables the use oftools like external search engines, blog readers and mailing list archives, andleverages on the activities of the users in the Web. The result is that informationflows better across the heterogeneous GlassFish community than across ahomogeneous group within a single company even when the group is distributedgeographically and across diverse time zones company.The GlassFish Community 24
  25. 25. Future DirectionsGlassFish is a work in progress. We expect the community and the product tocontinue to evolve. The community is formalizing its governance (the interimgovernance board should be announced by the time you read this) and will continueto expand. We also expect the fabric of the community to continue to strengthen inmultiple ways such as through GlassFish Days (like the one before JavaOne 2007)and we want to start some GlassFish Users Groups. Note that if the Sun TechDaysconference (http://developers.sun.com/events/techdays/) is coming to a city nearyou, chances are there will be a GlassFish Day as well.Now that the community has delivered high-quality version 2 features, the short-term goal is to increase adoption and deployments. GlassFish projects such asJersey and Sailfin (see paragraphs below) are important incremental additions. Wealso want to see more applications and frameworks working with GlassFish, andincrease the relationships with other groups and communities.The medium term is v3, a highly modular container code-named HK2 that will startup very quickly and will use few resources, only activating the services needed toexecute the application it is managing. Such a container would be suitable in manyscenarios, from very light-weight uses to high-availability ones. Early builds ofHK2 are available at http://hk2.dev.java.net.Jersey – RESTful Web ServicesJAX-RS is a new technology beingdeveloped within the JCP (JSR JAX-RS annotations and POJOs311) to define a POJO-basedprogramming model for RESTful This is a typical JAX-RS resource using aWeb Services. Resources are POJO:simple annotated POJOs and HTTP @UriTemplate("/helloworld")verbs are mapped to java methods public class HelloWorldResource {(see “JAX-RS annotations and @HttpMethod("GET")POJOs” inset). Consumer and @ProduceMime("text/plain")producer annotations further public String getMessage() {simplify the manipulation of return "Hello World";MIME types. }The specification work is going on }at http://jsr311.dev.java.net/ (early Once deployed, the resource will bedrafts available there). JAX-RS is available using the "/helloworld" URIlisted as a potential component of path.the upcoming Java EE 6The GlassFish Community 25
  26. 26. specification (JSR 316).Jersey (http://jersey.dev.java.net) is the reference implementation for JSR 311 andis closely following the evolution of the specification. The Jersey runtime can bedeployed in a variety of environments: GlassFish servlet container, Metro JAX-WSendpoint, Grizzly, Java 6 (using its lightweight web server), Tomcat, etc...Jersey is really a set of libraries and the installation in GlassFish can be trivialusing the Update Center. NetBeans 6.0 is set to support the creation of resourcesfrom POJOs as well as the creation of test AJAX-based clients for JAX-RSresources..Sailfin – SIP Servlets technology for GlassFishProject SailFin (http://sailfin.dev.java.net) is based on robust and scalable SIPServlets Technology contributed by Ericsson and the GlassFish v2 applicationserver.SIP (Session Initiation Protocol) and SIP Servlets are behind many popular servicessuch as Voice-over-IP (VoIP) phone services, instant messaging, presence andbuddy list management, and web conferencing. SIP Servlets are expected to playan even bigger part in building the next generation of Telecommunicationsservices.Combined with Java EE, SIP Servlets can be used to add rich media interactions toEnterprise applications. SIP Servlet 1.1 (JSR 289) updates the SIP Servlets API anddefines a standard application programming model to mix SIP Servlets and JavaEE components. Leveraging Java EE services like web services, persistence,security and transactions, would enable faster development of smartercommunications-enabled applications. Project Sailfins objective is to implementJSR 289 in its first release.The daily and milestone builds available from the SailFin website(http://sailfin.dev.java.net) are self-contained and install just like a GlassFishapplication server. The web site also provides sample documented applications.The first release of SailFin is scheduled towards the middle of 2008.The GlassFish Community 26
  27. 27. Getting StartedA good place where to track the activities of the GlassFish community isTheAquarium (blogs.sun.com/theaquarium). This group blog provides dailyspotlights of the most important activity in the community. A related blog isStories (blogs.sun.com/stories) a collection of GlassFish adoption stories related.The home page for the GlassFish Community is at java.net (glassfish.java.net);documentation, mailing lists, forums, Wikis are all available there. All GlassFishbuilds are also available there.GlassFish builds come in different forms: Nightly and Weekly builds are regularbuilds from the sources; Milestone builds go through a stabilization cycle andusually include new features – the specific details are described in the associatedHighlight notes; Final builds are the most stable and are the ones we encourage fordeployment. Sun provides support for these final builds.Stay in Touch About the AuthorsWe hope this article has succeeded Eduardo Pelegri-Llopart isin sketching the benefits of the a Distinguished Engineer atGlassFish community and Sun Microsystems and theApplication Server. We hope you overall lead for thewill give it a try and find it useful... GlassFish Community.and we are always very interested in Eduardo has worked in a number of Openany feedback you may have. See Source projects and has participated inyou at: http://glassfish.java.net/ and the Java Community since 1995. Hehttp://blogs.sun.com/theaquarium. resides in the San Francisco Bay Area. Yutaka Yoshida is a GlassFish engineer. Alexis Moussine-Pouchkine is a GlassFish evangelist based in Paris, France.The GlassFish Community 27
  28. 28. Table of ContentsWhat is GlassFish ......................................................................................................2 Java Platforms and Application Servers .......................................................... 2 The GlassFish AppServer................................................................................. 4The Java Platforms.....................................................................................................5 Open Source and GlassFish.............................................................................. 5 GlassFish and Java EE 5 Adoption...................................................................6Overview of JavaEE 5................................................................................................7 GlassFish Releases................................................................................................ 8 GlassFish v1..................................................................................................... 8 GlassFish v2..................................................................................................... 9 GlassFish v3..................................................................................................... 9GlassFish v2 Features................................................................................................ 9 Web Tier Java Specifications......................................................................... 10 Performance Improvements............................................................................10 Compatibility With Popular Frameworks.......................................................11 AJAX Support................................................................................................ 11 Grizzly............................................................................................................ 13 Alternatives in the Presentation Layer............................................................13 Web Services – Metro......................................................................................... 14 WSIT and Project Tango................................................................................ 15 XML Processing............................................................................................. 16 XML Data Binding......................................................................................... 17 Newer than Java EE 5.....................................................................................17 GlassFish Integration Technologies.................................................................... 18 TopLink Essentials and JPA...........................................................................18 CORBA.......................................................................................................... 18 OpenMQ Messaging.......................................................................................19 Java Business Integration............................................................................... 19 Clustering and State Replication......................................................................... 20 Tools....................................................................................................................21 Administration.....................................................................................................21 Installation Experience................................................................................... 22 Update Center................................................................................................. 23 GlassFish in Production.......................................................................................24Developing GlassFish.............................................................................................. 24Future Directions......................................................................................................25 Jersey – RESTful Web Services..........................................................................25 Sailfin – SIP Servlets technology for GlassFish................................................. 26The GlassFish Community 28
  29. 29. Getting Started......................................................................................................... 27Stay in Touch........................................................................................................... 27The GlassFish Community 29

×