JUGTourOnGlassFish42
Transcript of JUGTourOnGlassFish42
-
7/29/2019 JUGTourOnGlassFish42
1/42
Page 1Speaker Presentation Name
Java TechnologyJava TechnologyCommunity Development:Community Development:
Peabody (JDKPeabody (JDKCollaboration) andCollaboration) andGlassFish ProjectsGlassFish Projects
Sang ShinSang ShinJava Technology EvangelistJava Technology EvangelistSun Microsystems, Inc.Sun Microsystems, Inc.
[email protected]@sun.com
Tonight's Presentation isTonight's Presentation isavailable fromavailable from
www.javapassion.comwww.javapassion.com
? Sun and Open * Computing? java.net? The Future of Java SE - Mustang? The Future of Java EE GlassFish? Resources, Summary, and Call For
Action
Agenda
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
2/42
Page 2Speaker Presentation Name
SSun and Open * computingun and Open * computing
:
5
Open * Computing
Innovation Happens Elsewhere!-Bill Joy
:
6
Massive Community Growth
Java.sun.com
Sun Developer Network (SDN)
NetBeans.org Java.net
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
3/42
Page 3Speaker Presentation Name
:
7
Java.sun.com
The home for Java developers> 130M+ page views a month
> 1.2M+ J2EE Application Server downloads> 400K+ J2SE SDK downloads a month> 1M+ Wireless Toolkit downloads> 68k+ China eCommunity members
:
8
Sun Developer Network
www.sun.com/developers? Content
Developer portal Cool stuff White papers Code samples
? Training Classes Seminars Webinars
? Support Knowledge base Forums (5000+ active) User Groups (537 and growing)
? Software Electronic download Quarterly freeware mailing
? 769,000 unique registrations? 112,000 members of SDN Mobility Progr am
:
9
NetBeans.org
? Center for Innovation, News andSupport
? 3.5 Million Downloads ofNetBeans tool
? 100 add-ons and extensions? 27,000 registered users? Visitors from 160 countries?Active Community supporting
developers in English, French,Russian, Japanese, and simplifiedChinese
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
4/42
Page 4Speaker Presentation Name
:
10
? 60 million downloads and growing? 100,000 community members? Over 40 community localisations? 15 local-language mail lists for self-help? Community ports to virtually every known
platform? Archival document formats!? Conversion to and from Microsoft Office formats? No virus problems? Open APIs? StarOffice has enterprise-level support &
warranty
OpenOffice.org
Java.netJava.net
:
12
Shared vision, goals
Agreed sharing
(license) Agreed relationships
(governance)
Committed members
Not Just Open Source; One Size Doesn't Fit All!
Building Open Communities
Open Communities
Acc ess to
Technology
and Ideas
OpenDevelopment
BroadParticipation
InclusiveProcess
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
5/42
Page 5Speaker Presentation Name
:
13
Java.net Goal is to stimulate the expansion of Java by building
a web-based community where developers,educators, researchers, and others to learn, share,
and collaborate The Single Source for Java Technology Collaboration
> Unifying Community of other Java communities> 50K+ members> 917 Projects
:
14
Java Community (diverse and rich)
JCP determines
change to Java Platform
Va lu e Cha i n
applications
solutions services
products
CoreJava
java.sun.com? downloads? information
End-use
consumers of
Java Technology
Disparate online
resources, tools,
ISV sites, code, etc.
ContentSites
Opensourcetools
CodeGaming
Community
StandardsBody
Academia/Research ISV
Community
:
15
Tools
Code
Content
Opensource
JCP determines
change to Java Platform
java.net willfacilitate multiple
Java communities,
with collaborationtools for development
communityA
community
B
communit
yC
communit
yD c o m m u n
i t y
E
F e
d e r a t e
d
c
o m m u n
i t y
F
Fed
erated
c
ommunit
yG
Fede
rated
c
ommunity
H
CoreJava
java.sun.com? downloads? information
End-use
consumers of
Java Technology
applications
solutions services
products
Va lu e Cha in
java.net (collaboration is key)
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
6/42
Page 6Speaker Presentation Name
:
16
:
17
Key java.net FeaturesCollaboration
WeblogsWikis Collaborative Web PagesMailing ListsForums Project/Community Discussion Forums
InformationRSS Content Syndication NewsfeedsNews Relevant Project/ Community InformationJavapedia (an encyclopedia of everything Java related)
DevelopmentCVS Source Trees Source Repository, VersioningIssuezilla Bugs & Issues TrackingHelp Wanted to match projects and developers
:
18
Communities on java.net
Java Web Services & XMLJava DesktopJava ToolsJava Patterns
...
Mustang (Java SE 6.0)GlassFish (Java EE 5.0)Many more ...
Java CommunicationsJAINJava Games...
NetBeansJiniProject JXTALinux...
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
7/42
Page 7Speaker Presentation Name
:
19
The Future of Java SEThe Future of Java SEMustangMustang
? JDK Collaboration ProjectJDK Collaboration Project
? How to Get StartedHow to Get Started
? How to Build MustangHow to Build Mustang
? How to Submit Bug FixesHow to Submit Bug Fixes
?
New features in MustangNew features in Mustang
:
21
1.4.0 Merlin 2002/2/131.4.1 Hopper 2002/10/16
1.4.2 Mantis 2003/5/2915.0 Tiger 2004/9/301.6.0 Mustang 2006/Q31.7.0 Dolphin 2008/Q1
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
8/42
Page 8Speaker Presentation Name
2005 JavaOneSM
Conference | Session 7264 | 22
:
23
Why Make Java Technology MoreTransparent?
We listened
Developer mindshare is vital
Build grassroots support
Channel enthusiasm forcommunity development
...all while retaining compatibility
:
24
What Java Developers Ask For:
?Prese
rvetheJava
technology
compatibilit
ypromise
?Fixbu
gsthemselv
es? Contribu
tefixesand
features
? Seethesou
rcecode
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
9/42
Page 9Speaker Presentation Name
:
25
Licenses for JDK
Java Research License (JRL)
Java Internal Use License (JIUL) Java Distribution License (JDL)
:
26
Java Research License (JRL)
For academics, researchers,the curious, contributors
Greatly simplified:> Simple 2-pager, click-through> Allows very broad use for research
> Residual knowledge does not preventnon-Sun work
> No copyright or patent rights> No compatibility, TCK requirements
No commercial use, redistribution
Contribution agreement for givingcode back must be compatible
JCP remains steward of Java APIs
http://java.net/jrl.html
:
27
Enterprise customers can deploytheir own bugfixes> Sun can enforce compatibility but doesn't
require running TCK
> Honor system - At the customers own risk> Some guidelines: no API changes
For internal use> Includes software powering public websites> Excludes external distribution
Allows sharing of bugfixes> Encourages but doesn't require returning fixes
All about peace of mind
Java Internal Use License (JIUL)
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
10/42
Page 10Speaker Presentation Name
:
28
Java Distribution License (JDL)
Commercial redistributionlicense> Principal successor to SCSL> Simplified (more readable)
commercial use license
Includes main commercialterms from SCSL> Requires passing the TCK> Includes TCK license> Optional support agreement> Requires trademark agreement
No surprises
:
29
What Java Developers Get WithProject Peabody:
? Preservecom
patibility: m
ustpass
TCK,JDLforcomm
ercialuse,
redistributio
n
? Fixbugs: JIU
Llicense? Co
ntribute: jd
k.contributo
rrole?
See: source
codeposte
d,JRL
? ?
? ?? ?
?
?
:
30
People Are Already Actively Partipating:Contributions Integrated
6207243: Non-varargs warnings during Andy Trippbuild, should be cleaned up b34
6257449: Concurrency bug in sound Jesse SterrUlawCodec with tempBuffer b34
4238932: A JTextField in gridBagLayout Swen Meierdoes not p roper ly s et MinimumSize b42
THANK YOU!
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
11/42
Page 11Speaker Presentation Name
:
31
Contributions In Process
4094886: java.io: Need a way to convert Readers into InputStreams
4306897: Add java.util.Arrays.binarySearch(a, key, fromIndex, toIndex)
4346256: Provide an AbstractTreeModel for the TreeModel hierarchy
5015163: String merge/join facility that would be the inverse ofjava.l ang.St rin g.sp lit ()
5025230: Creating thread local variables from within ThreadLocal.initialValue()
6176992: Add support to java.lang.Class for wrapper type conversions
6182942: JButton.isEnabled() return false however the button is enabled
6197726: IdentityHashMap.EntrySet.toArray(T[] a) is incorrectly implemented
6205522: Javadoc warnings for GregorianCalendar
6232484: ArrayList made from IdentityHashMap.entrySet() fails to create properly
6245410: javax.swing.text.html.CSS.Attribute: BACKGROUND_POSITION,TEXT_DECORATION is not w3c spec compli ant
6246565: File descriptor leak when using DatagramChannel.socket()
6248507: AbstractStringBuilder.replace does not handle count < start < end
6254531: ThreadLocal leak when value references ThreadLocal
:
32
Contributions In Process
4094886: java.io: Need a way to convert Readers into InputStreams
4306897: Add java.util.Arrays.binarySearch(a, key, fromIndex, toIndex)
4346256: Provide an AbstractTreeModel for the TreeModel hierarchy
5015163: String merge/join facility that would be the inverse ofjava.l ang.St rin g.sp lit ()
5025230: Creating thread local variables from within ThreadLocal.initialValue()
6176992: Add support to java.lang.Class for wrapper type conversions
6182942: JButton.isEnabled() return false however the button is enabled
6197726: IdentityHashMap.EntrySet.toArray(T[] a) is incorrectly implemented
6205522: Javadoc warnings for GregorianCalendar
6232484: ArrayList made from IdentityHashMap.entrySet() fails to create properly
6245410: javax.swing.text.html.CSS.Attribute: BACKGROUND_POSITION,TEXT_DECORATION is not w3c spec compli ant
6246565: File descriptor leak when using DatagramChannel.socket()
6248507: AbstractStringBuilder.replace does not handle count < start < end6254531: ThreadLocal leak when value references ThreadLocal
XXXXXX: YOUR FAVORITE BUG OR RFE HERE
2005 JavaOneSM
Conference | Session 7264 | 33
http://mustang.dev.java.net
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
12/42
Page 12Speaker Presentation Name
The Future of Java SEThe Future of Java SEMustangMustang
? JDK Collaboration ProjectJDK Collaboration Project
? How to Get StartedHow to Get Started
? How to Build MustangHow to Build Mustang
? How to Submit Bug FixesHow to Submit Bug Fixes
? New features in MustangNew features in Mustang
:
35
How to Get Started
1)Sign up onjava.net, click thruJRL, sign, return contribution agreement
2)Download, explore, get it to build on your system
3)Check bug parade or try fixing that bug you really hate
4)Start simple, pick something self-contained,learn the process
5)Submit your fix:https://jdk-collaboration.dev.java.net/
6)Work with the Sun engineer on that module totest, validate, and integrate your fix
7)Feel good about what you've done!
Some other things to try: test your app on Mustang, use the source tounderstand and optimize, check out the lab, post to forums, use code
in research/academia
:
36
How To Tutorials People Wrote
Building JDK 6.0 on Windows XP> http://blogs.sun.com/roller/page/kto?entry=building_the_jdk_6_0
Java and "Open Source": Good News and Bad News -
By Andy Tripp> http://www.javalobby.org/articles/fixing-the-jdk/
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
13/42
Page 13Speaker Presentation Name
The Future of Java SEThe Future of Java SEMustangMustang
? JDK Collaboration ProjectJDK Collaboration Project
? How to Get StartedHow to Get Started
? How to Build MustangHow to Build Mustang
? How to Submit Bug FixesHow to Submit Bug Fixes
? New features in MustangNew features in Mustang
:
38
Introduction
Machine setup (one time procedure)
Source trees
Binary files needed
Common build procedures
Common build problems
:
39
Machine Setup: Common Needs
Disk Space Needs: 2G minimum
CPU/RAM considerations: 650MHz 512Mbminimum
Common Build Tools Needed> ZIP & UNZIP> GNU Make (gnumake)
Unix tools (On Windows, use mksorcygwin)
Native compilers
Misc SDK's and/or components
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
14/42
Page 14Speaker Presentation Name
:
40
Machine Setup: Linux
Linux
Verifying that your release of Linux can successfully
build might take some time due to compatibilityproblems with the C/C++ runtime library, i.e. It'snot obvious which Linux's are compatible.
> X86 Linux RedHat A.S. 2.1 Update 1> Motif needed
:
41
Machine Setup: Windows
Windows (most complicated setup)> Compilers
>Visual Studio .NET Professional 2003
Contains newer Platform SDK
Contains newer unicows.lib
> DirectX SDK 9.0 (or 7.0 but hard to find)
> MKS or CYGWIN
> UNICOWS.DLL
:
42
Machine Setup: Solaris
Solaris> Compilers
>Sun Studio 10
>AMD64 must build using Solaris 10> Builds on Solaris N will work on Solaris N+i
>Where i = 0, 1, 2, ...
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
15/42
Page 15Speaker Presentation Name
:
43
Install Mustang source and binary
1. JDK 6.0 Binary Snapshot Release> http://download.java.net/jdk6/binaries/
> jdk-6_0-ea-bin-b53-solaris-sparc-22_sep_2005.sh> Set environment variableMUSTANG_BIN
2. JDK 6.0 Source Snapshot Release> http://download.java.net/jdk6/
> Set environment variableMUSTANG_SRC
> jdk-6_0-ea-src-b53-jrl-22_sep_2005.jar
3. Ant 1.6.2 or later> SetANT_HOME
4. Nebeans 4.1> SetNETBEANS_HOME
:
44
Source Trees
Control (~30 files)> Contains the makefiles used to perform complete builds of
the product
HotSpot (~3,000 files)> Contains the HotSpot VM C++ source and the Serviceability
Agent Java source
J2SE (~30,000 files)> Contains the makefiles and Java source to everything in rt.jar
and tools.jar, plus more> Also includes C and C++ source for many of the native JNI
libraries
:
45
Source Trees
Motif (~500 files)> Contains the source to the Motif libraries, needed on Linux
Deploy (~2,000 files)
> Contains the makefiles and sources for the Java plugins Install (~500 files)
> Contains the makefiles and source to build the install bundles(not normally needed by developers)
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
16/42
Page 16Speaker Presentation Name
:
46
Binary Files Needed
Binary download for source area (fonts misc extrafiles), this should be overlayed over source
download tree. BOOTDIR (previous release of JDK 5.0)
Built Mustang (for imports, can also serve asBOOTDIR)
Mozilla Headers (needed to build plugin)
:
47
Common Build Procedures
Control Builds> Examples, 'cd control/make' and:
>Builds complete product:gnumake SKIP_FASTDEBUG_BUILD=true scsl
>Could Skip hotspot build (importing it in from a previousbuild)
gnumake BUILD_HOTSPOT=false scsl
:
48
Common Build Problems
Missing files> Missing font files (added sanity check for this)
Native compiler unknowns
Specific OS version issues (SP's patches)
Where it's built determines where it can run
Clean/Clobber build issues(INCREMENTAL_BUILD=true)
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
17/42
Page 17Speaker Presentation Name
:
49
Issues
Machine setup needs simplification, Windows inparticular
Stick with free or freely available build tools Build variations need to be allowed and
documented (ANT, subset builds, etc.)
Relax sanity error checks where we can
Add sanity checks as encountered
The Future of Java SEThe Future of Java SEMustangMustang
? JDK Collaboration ProjectJDK Collaboration Project
? How to Get StartedHow to Get Started
? How to Build MustangHow to Build Mustang
? How to Submit Bug FixesHow to Submit Bug Fixes
?
New features in MustangNew features in Mustang
:
51
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
18/42
Page 18Speaker Presentation Name
:
52
The Future of Java SEThe Future of Java SEMustangMustang
? JDK Collaboration ProjectJDK Collaboration Project
? How to Get StartedHow to Get Started
? How to Build MustangHow to Build Mustang
? How to Submit Bug FixesHow to Submit Bug Fixes
?
New features in MustangNew features in Mustang
:
54
Approved Mustang Component JSRs
202: Class File Update
199: Compiler API
269: Annotation Processors
260: Javadoc Tag Update Ease of Development
221: JDBC 4.0223: Scripting
105: XML Digital Signature
173: Streaming API for XML XML
222: JAXB 2.0
250: Common Annotations
181: WS Metadata Web Services
224: JAX-WS 2.0
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
19/42
Page 19Speaker Presentation Name
The Future of Java EEThe Future of Java EEGlassfishGlassfish
? GlassFish OverviewGlassFish Overview
? Building GlassFishBuilding GlassFish
? Java EE 5 FeaturesJava EE 5 Features
? Sun Java System Application ServerSun Java System Application Server
? GrizzlyGrizzly
:
56
What is GlassFish?
Sun's Open Source Application Server PlatformEdition 9> CDDL license> Open process
Open access to code and binaries> CVS access to source code> Nightly builds, weekly promoted builds
Must support Java EEcompatibility
Renewed partnership between Sun and the larger
enterprise Java community
:
57
Common Development andDistribution License(CDDL) - pronounced 'cuddle'
Takes the well known Mozilla Public License (MPL)
and makes it reusable without modification Clear, consistent, not burdensome for contributors
As reusable and general as possible
Meets the definition ofOpen Source Definition ofOpen Source Initiative
...CDDL... Everything is in place for it to work well.Linus Torvalds 2/1/05
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
20/42
Page 20Speaker Presentation Name
:
58
Open Source Definitionwww.opensource.org/docs/definition.php
Free Redistribution
Source Code Derived Works
Integrity of The Author's Source Code
No Discrimination Against Persons or Groups
No Discrimination Against Fields of Endeavor
:
59
Open Source Definitionwww.opensource.org/docs/definition.php
Distribution of License
License Must Not Be Specific to a Product
License Must Not Restrict Other Software
License Must Be Technology-Neutral
:
60
Why Become Part of the GlassFish Project
Contribute to world class application server> Involved in the implementation of cutting edge Enterprise
Java, Web Services, SOA standards, Grizzly> Easy build environment
Access to nightly and promoted builds> New Java EE 5 features> Bug fixes
Interact with a great group of people inside andoutside of Sun
Fully Participative Community> Already non-Sun committers
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
21/42
Page 21Speaker Presentation Name
:
61
How to Get Involved
Join discussions on mailing lists and forums
Download andtryout the binary builds
Submit bugs or request for enhancements> IssueTracker
Submit a patch to fix a bug or provide anenhancment to issue from> IssueTracker> Web Bugs
Checkout the GlassFish people page> http://wiki.java.net/bin/view/Projects/GlassFishPeoplePage
:
62
GlassFish Supports
Supports all platforms> Solaris, Solarix_X86, Windows, Linux and MacOS
Java Blueprints Solution Catalog EA release runson GlassFish> includes design guidelines, code and applications for
JavaServer Faces and AJAX
NetBeans 5.0 runs on GlassFish> You can use NetBeans to develop applications on GlassFish
The Future of Java EEThe Future of Java EEGlassfishGlassfish
? GlassFish OverviewGlassFish Overview
? Building GlassFishBuilding GlassFish
? Java EE 5 FeaturesJava EE 5 Features
? Sun Java System Application ServerSun Java System Application Server
? GrizzlyGrizzly
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
22/42
Page 22Speaker Presentation Name
:
64
Building GlassFish
Build steps to follow> Need Maven, JDK 5 and cvs client> Member of GlassFish and accept license> Checkout bootstrap module> Edit property files> Checkout rest of server> Build and configure server
Full set of instructions on GlassFish site -really quiteeasy to build> https://glassfish.dev.java.net/public/BuildGlassFish.html
:
65
Building GlassFish in NetBeans
Build steps to follow> Need NetBeans 4.1, Maven, JDK 5 and cvs client> Create the workspace home> Get the GlassFish Source> Set the project properties> Get, configure and test the GlassFish Image
Over30 GlassFish NetBeans Projects available
Checkout, open and modify a GlassFish module projectin NetBeans
Full set of instructions on NetBeans site -really quite
easy to build> http://www.netbeans.org/kb/41/glassfish.html
:
66
Code organization
Modules - way of dividing up the app server to helpnavigate the code
Webtier and most of administration online are up
EJB 3.0 pieces are being added> Session bean code is in> Persistence code is expected to be added during 10/2005
Others coming soon> JMS, JavaMail> Roadmap to be published end of summer
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
23/42
Page 23Speaker Presentation Name
:
67
Demo Scenario
Building GlassFish using NetBeans> http://www.netbeans.org/kb/41/glassfish.html
Checking out a couple of modules for modification> admin-cli> appserv-docs
Modify the code> admin-cli
Rebuild the GlassFish and test the modification
The Future of Java EEThe Future of Java EEGlassfishGlassfish
? GlassFish OverviewGlassFish Overview
? Building GlassFishBuilding GlassFish
? Java EE 5 FeaturesJava EE 5 Features
? Sun Java System Application ServerSun Java System Application Server
? GrizzlyGrizzly
:
69
Agenda
Java EE 5 Theme: Ease of development
EJB 3.0> Ease of development
> Persistence> Interoperability with EJB 2.1
Web services enhancements> JAXB 2.0> JAX-WS 2.0
JavaSever Faces 1.2
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
24/42
Page 24Speaker Presentation Name
:
70
The J2EETMChallenge
J2EE is enormously powerful> The industry standard for robust enterprise apps
But that power sometimes gets in the way> Too difficult to get started> Even simple apps need boring boilerplate
Can we keep the power, but make typicaldevelopment tasks simpler?
YES : and that is the focus of Java EE 5!
:
71
Ease of DevelopmentImprovements in JavaTM EE 5
POJO-based programming (Plain Old Java Object)> More freedom, fewer requirements
Extensive use of annotations> Reduced need for deployment descriptors
Resource Injection> Inversion of control
New APIs and frameworks
:
72
JavaTM EE 5 Major Features
Simplified web services support
More web service standards support
Greatly simplified EJBTM development
New persistence API
Easy web applications with JavaServerTM Faces
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
25/42
Page 25Speaker Presentation Name
:
73
JavaTM EE 5
EJB 3.0 (JSR-220)
JavaServer Faces (JSR-252)
StAX (JSR-173)
Web Services Metadata (JSR-181)
New persistence API (JSR-220)
JAXB (JSR-222)
JAX-WS (JSR-224)
Common Annotations (JSR-250)
:
74
Primary Goal of EJB 3.0
Ease of Development!
:
75
EJB 2.1
Very powerful, but complex to use> Too many classes, interfaces> Java Naming and Directory Interface
(JNDI) API lookups> javax.ejb interfaces> Awkward programming model> Deployment descriptors> Entity bean anti-patterns> ...
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
26/42
Page 26Speaker Presentation Name
:
76
Ease of Development Features inEJB 3.0
? Fewer classes and interfaces
? Dependency injection? Simple lookups
? No required container interfaces
? No required deployment descriptor
? Simplified persistence
? Object/relational mapping
:
77
EJB 3.0 Example
// Same example, EJB 3.0
@Stateless public class PayrollBean
implements Payroll {
@Resource DataSource empDB;
public void setBenefitsDeduction (int empId, doublededuction) {
...
Connection conn = empDB.getConnection();
...
}
...
}
:
78
Dependency Injection
Resources a bean depends upon are injected whenbean instance is constructed
References to:> EJBContext> DataSources> UserTransaction> Environment entries> EntityManager> TimerService> Other EJB beans> ...
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
27/42
Page 27Speaker Presentation Name
:
79
Dependency Injection
Annotations> @EJB
>References to EJB business interfaces
>References to Home interfaces (when accessingEJB 2.1 components)
> @Resource>Almost everything else
> Number of annotations is simplified from EJB 3 specificationearly draft
Injection can also be specified using deploymentdescriptor elements
:
80
Simplified Client View
Session beans have plain Java language businessinterface> No more EJB(Local)Home interface> No more EJB(Local)Object interface
Bean class implements interface> Looks like normal Java class to bean developer
Looks like normal Java language interfaceto client (POJI)
:
81
EJB 3.0 Client Example
// EJB 3.0 client view
@EJB ShoppingCart myCart;
...
Collection widgets = myCart.startToShop(widgets);
...
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
28/42
Page 28Speaker Presentation Name
:
82
EJB 3.0
Persistence
:
83
Persistence Goals of EJB 3.0
Simplify entity bean programming model
Support for light-weight domain modeling,including:> Inheritance and polymorphism
Complete query capabilities
Support for object/relational mappingspecification
Make entity instances usable outside the EJB
container> Remove need for DTOs and similar antipatterns
:
84
Persistence Model in EJB 3.0
Entities are simple Java classes> Concrete classessupport use of new> Getter/setter property methods or persistent
instance variables> No required bean interfaces> No required callback interfaces
Usable as detached objects in otherapplication tiers> No more need for DTOs (Data Transfer Objects)
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
29/42
Page 29Speaker Presentation Name
:
85
EntityManager
EntityManager serves as untyped home
for entity operations Methods for lifecycle operations> Persist, remove, merge, flush, refresh, etc.
Similar in functionality to Hibernate Session,JDO PersistenceManager, etc.
:
86
Persistence Focus: O/R Mapping
Ease-of-use facility for Java developers mappingdomain object model to a relational database
Developer is aware of mapping betweenDB schema and domain object model> Developer is in control of mapping> Developer can rely on mapping and its semantics
Mappings may be expressed using metadataannotations or XML>
Default mappings provided
:
87
EJB 3.0
Interoperability with EJB 2.1
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
30/42
Page 30Speaker Presentation Name
:
88
EJB 3.0/2.x TechnologyInteroperability and Migration
Applications written to EJB 2.1 specification andearlier work unchanged in EJB 3.0 containers
Migration path to EJB 3.0 APIs> New applications can be clients of older beans> Older clients can be clients of new EJB 3.0
components>Without change to preexisting client view
:
89
Web Services
JAX-WS and JAXB Integration
:
90
Java Support for Web Services
JAX-RPC 2.0 renamed to JAX-WS 2.0 (Java APIfor XML Web Services)
Implements new WS stack> JAX-WS 2.0 and JAXB 2.0> Designed for growth (JAX-WSA, others)
Heavy use of annotations> Ease-of-development> Portability
Supports Fast Infoset> Better Performance
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
31/42
Page 31Speaker Presentation Name
:
91
JAX-WS and JAXB Integration
JAX-WS delegates all data binding to JAXB
Development time> JAXB generates Java types from a WSDLs schemas> JAXB generates the WSDLs schema from Java types
Runtime> JAX-WS un/marshalls the message (soap:envelope)> JAXB un/marshalls the payload (soap:body child,
soap:header and soapfault elements)
:
92
Division of LaborDivision of Labor
33
Fred
Jones
JAXBJAX-WS
:
93
Web Services
JAXB 2.0
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
32/42
Page 32Speaker Presentation Name
:
94
JAXB 2.0 Is Now Bi-Directional
1.0: Schema Java only
> JAXB is for compiling schema> Dont touch the generated code
2.0: Java XML + schema compiler> JAXB is about persisting POJOs to XML> Annotations for controlling XML representation> Modify the generated code to suit your taste
:
95
Web Services
JAX-WS 2.0
:
96
JAX-RPC 1.1 RI Issues
Supports only SOAP 1.1over HTTP
Limited XML Schema support
Little Control of Mapping Java and WSDL/XML Schema
Large non-portable applications
Large runtime
Web Service development is too complex
Servlet container is required
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
33/42
Page 33Speaker Presentation Name
:
97
JAX-WS 2.0 RI
New Architecture
Improved Data Binding
Annotations
Java SE 6 Endpoints
:
98
JAX-WS 2.0 New Architecture
Multiple protocols> SOAP 1.1, SOAP 1.2, XML
Multiple encodings> XML, MTOM/XOP, FAST Infoset (Binary XML)
Multiple transports> HTTP> Others to be added in future releases
:
99
Improved Data Binding
JAX-RPC 1.1 Issues> Defines its own data binding rules
> Only a portion of XML Schema supported> javax.xml.soap.SOAPElement (DOM)> No control of the generated Java SEI
JAX-WS 2.0> Uses JAXB 2.0 for data binding (100% XML Schema)> Very few DOM-like mappings> Customizations to control the generated SEI
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
34/42
Page 34Speaker Presentation Name
:
100
Customizations in WSDL/XMLSchema to Java Mapping
JAXB customizations
> XML Schema to Java
JAX-WS customizations> Similar to JAXB customizations> WSDL to Java
Can live> In-lined in the WSDL as WSDL extension> As external file (pass to JAX-WS tools)
:
101
Preview: Java Technology,Annotations, WSDL
Java class is annotated with @WebService> Becomeswsdl:port-typeelement in the WSDL world
Java Methods are annotated with @WebMethod> Becomes awsdl:operation element in the WSDL world
Java Methods parameters mapping to XML is nowhandled by JAXB> wsdl:message part element types are now defined in
aseparateschemafile imported by the wsdl
What changes in Java EE 5
:
102
Web Service Example
@WebService(name=MySimpleWS);public class RandomClass {
@WebMethod
public String sayHello(String s) {...}
public void unpublished() {...}}
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
35/42
Page 35Speaker Presentation Name
:
103
Web Service Client
New standard annotations :
> @WebServiceRefto express dependencies ona Web service
> @PortComponentRefto express a dependencyon a port definition within a service
Can be overriddenby service-ref deploymentdescriptors
What changes in Java EE 5
:
104
Web Service Client Example
@WebServiceRef(
wsdlLocation=
http://localhost:8080/SayHelloService?WSDL);)
static javaone.SayHelloService wsService;
public static void main(String[] args) {
javaone.SayHello wsPort = wsService.getHello();
wsPort.sayHello(JavaOne Attendees);
}
:
105
JavaServer Faces 1.2
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
36/42
Page 36Speaker Presentation Name
:
106
JavaServer Faces (JSF)Framework Is
Aserver side user interface (UI)component framework for Javatechnology-based webapplications.
Drag-and-drop UI components tobuild a web Application.
:
107
JSF Architecture
HTML
RenderKit
AppBackend
Desktop
Browser
Phone
Frontctrl
JSF Page
JSF Page
WML
HTML
Server
WML
RenderKit
:
108
Important Basic Capabilities
Extensible UI component model
Flexible rendering model
Event handling model Validation framework
Basic page navigation support
Internationalization
Accessibility
Tool friendly
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
37/42
Page 37Speaker Presentation Name
:
109
JavaTM EE 5 Status
Most specs available for review now
Specs at Proposed Final Draft stage Q3 2005
Java EE 5 SDK Beta release Q4 2005
Java EE 5 Final release Q1 2006
The Future of Java EEThe Future of Java EEGlassfishGlassfish
? GlassFish OverviewGlassFish Overview
? Building GlassFishBuilding GlassFish
? Java EE 5 FeaturesJava EE 5 Features
? Sun Java System Application ServerSun Java System Application Server
? GrizzlyGrizzly
:
111
Java Enterprise System ApplicationPlatform Suite Q4 2005
JavaStudioEnterp
riseand
JavaStudioCreator
UML,
JavaEE,
JavaSer
verFaces,
BPEL/BPMN,
PortletBuildera
ndcollaboration
toolstocreatesimpleorcom
plexservices
PortalServerAggregation, secur ity, mobility, collaboration, per sonalization,
search, and device-independence
Application ServerClustering, transactions, scalability,performance and high availability
Business IntegrationBPEL, Data Transform, JBI
ServiceRegistry
Storeservicesmetadata
fordiscovery
andcomposition
Access ManagerUser authentication and access control
Message Broker
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
38/42
Page 38Speaker Presentation Name
:
112
Sun Java System Application Server Platform Edition: fast and lightweight
> GlassFish Project> Basis for Java EE SDK
> Free for development, deployment and (re)distribution> Integrates with NetBeans, Sun Java Studio Enterprise,
Sun Java Studio Creator software, and Eclipse
Standard Edition> Advanced security, out-of-the-box> Self-managing and self-healing> Clustering and multi-machine administration
Enterprise Edition supports 99.999% availability> Very small downtime, no data loss, full recovery
:
113
Developer View: Platform Edition
Entirely Java technology
Fast startup
Fast deployment
Available on all major platforms> Solaris OS, Microsoft Windows, Linux, MacOS
Same performance as the high-end versions> Multi-machine admin and availability are omitted> Seamless migration to advanced versions of product
:
114
Performance
Highly scalable HTTP path> Grizzly: thousands of connections with few threads,
all written in Java language (go to TS-3227)> Fast web services using Fast Infoset (go to TS-7187)
High-performance JMS broker
Improved Enterprise JavaBeans (EJB)specification performance> Relationship prefetching> Read-only EJB specification-based beans
Optimized XA transactions (LAO)
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
39/42
Page 39Speaker Presentation Name
:
115
Sun Java SystemApplication Server Platform Edition
The first and only free application server to publish
SPECjAppServer results Comparable performance to our SE publication
> PE: 298 JOPS on 6 CPUs> SE: 1201 JOPS on 26 CPUs
The Future of Java EEThe Future of Java EEGlassfishGlassfish
? GlassFish OverviewGlassFish Overview
? Building GlassFishBuilding GlassFish
? Java EE 5Java EE 5
? Sun Java System Application ServerSun Java System Application Server
? GrizzlyGrizzly
:
117
What Is the Grizzly HTTP Framework?
Introduction to Grizzly
Grizzly is a HTTP framework> Uses lower level Java NIO primitives> Easy-to-use, high-performance APIs for socket
communications
Grizzly brings non-blocking sockets to theHTTP processing layer
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
40/42
Page 40Speaker Presentation Name
:
118
Grizzly Architecture
A Task-based architecture has been used, each
task representing an operation whenmanipulating the byte stream> AcceptTask for managing OP_ACCEPT> ReadTask for managing OP_READ> ProcessorTask for parsing/processing
the byte stream
Tasks can execute on their own thread, on ashared thread or using the Selector thread
:
119
Benchmark Results
2 CPU 6 CPU 16 CPU0
250
500
750
1000
1250
1500
1750
2000
2250
2500
2750
3000 Traditional I/O
C-Based Server
C-Based Server
Grizzly
%o
fTraditionalI/OScore
:
120
Demo Scenario
Building EJB 3.0 app through NetBeans overGlassFish> http://j2ee.netbeans.org/NetBeans_EJB3.html
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
41/42
Page 41Speaker Presentation Name
Resources and Summary &Resources and Summary &Call for ActionCall for Action
:
122
Resources
Java.net
http://mustang.dev.java.net
New features of Mustang> http://java.sun.com/developer/technicalArticles/J2
SE/Desktop/Mustang_build39.html
http://glassfish.dev.java.net
http://java.sun.com/javaee
:
123
Call For Action
Become a member of java.net
Participate in any of the java.net community projects
Yes, your effort will make a difference!
Sun Microsystems, Inc.
10/04/2005
-
7/29/2019 JUGTourOnGlassFish42
42/42
:
124
Call for Action For GlassFish Project
Become a user and tell your friends> Download a build> Deploy your application> Learn the new Java EE 5 technologies> Give us feedback
Become a contributor, we need your help> Grizzly module is implementing new features> Admin module looking for help implementing new features> Bug fixes> Improve build infrastructure and how maven is used
Write tutorials and articles, get published
Java TechnologyJava TechnologyCommunity Development:Community Development:Peabody and GlassFishPeabody and GlassFish
Sang ShinSang ShinJava Technology EvangelistJava Technology Evangelist
Sun Microsystems, Inc.Sun Microsystems, [email protected]@sun.com
Sun Microsystems, Inc.
10/04/2005