This session provides an overview of Java EE 6 and GlassFish v3. Using multiple simple-to-understand samples it explains the value propositionprovided by Java EE 6.
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Java EE 6 and GlassFish v3: Paving the path for future
1. Using Eclipse for Java EE 6
development for GlassFish
Arun Gupta, GlassFish Guy
Sun Microsystems, Inc.
blog.arungupta.me
2. Java EE: Past & Present
Right
Ease of Sizing
Developme Java EE 6
nt EJB Lite
Web Java EE 5 Restful WS
Ease of
Service Web Beans
Development
s Extensibility
J2EE 1.4 Annotations
EJB 3.0
Robustness Web Services, Persistence API
Enterprise Management, New and
Java J2EE 1.3 Deployment, Updated
Async.
Platform CMP, Web Services
Connector Connector
Architecture
` Java EE 6
J2EE 1.2
Servlet, JSP, Web Profile
JPE EJB, JMS
Project RMI/IIOP
Using Eclipse for Java EE 6 development for GlassFish Slide 2
3. Goals for the Java EE 6 Platform
• Right Sizing the Platform
> Flexible, lighter weight
• Extensible
>Embrace Open Source Frameworks
• Easier to use, develop on
> Continue on path set by Java EE 5
Using Eclipse for Java EE 6 development for GlassFish Slide 3
4. Right Sizing the Platform: Profiles
• Make platform flexible
> Decouple specifications to allow more
combinations
> Expands potential licensee ecosystem
> Profiles
>Targeted technology bundles
>Defined through the JCP
>First profile: Web Profile
– Defined by the Java EE 6 Expert Group
Using Eclipse for Java EE 6 development for GlassFish Slide 4
5. Right Sizing the Platform: Pruning
• Make platform lighter
> Makes some technologies optional
> Pruned today, means
> optional in the next release
> Deleted in the subsequent release
> Pruned Technologies will be marked in the
javadocs
> Current pruning list
> JAX-RPC, EJB 2.X Entity Beans, JAXR, JSR-88
Using Eclipse for Java EE 6 development for GlassFish Slide 5
6. Extensibility
• Embrace open source libraries and
frameworks
• Zero-configuration, drag-and-drop for web
frameworks
> Servlets, servlet filters, context listeners for a
framework get discovered and registered
automatically
• Plugin library jars using web fragments
Using Eclipse for Java EE 6 development for GlassFish Slide 6
7. EoD Example - Servlets
Servlet in Java EE 5: Create two source
<!--Deployment descriptor /* Code in Java Class */
files
web.xml -->
<web-app> package com.foo;
<servlet> public class MyServlet
<servlet-name>MyServlet extends HttpServlet {
</servlet-name> public void
<servlet-class> doGet(HttpServletRequest
com.foo.MyServlet
</servlet-class> req,HttpServletResponse res)
</servlet> {
<servlet-mapping>
<servlet-name>MyServlet ...
</servlet-name>
<url-pattern>/myApp/* }
</url-pattern>
</servlet-mapping>
... ...
</web-app>
}
Using Eclipse for Java EE 6 development for GlassFish Slide 7
8. EoD Example - Servlets
Servlet in Java EE 6: In many cases a single source file
package com.foo;
@WebServlet(name=”MyServlet”, urlPattern=”/myApp/*”)
public class MyServlet extends HttpServlet {
public void doGet(HttpServletRequest req,
HttpServletResponse res)
{
...
}
Using Eclipse for Java EE 6 development for GlassFish Slide 8
9. Web/EJB Application in Java EE 5 Platform
foo.ear foo.ear
foo_web.war lib/foo_common.jar
com/acme/Foo.class
WEB-INF/web.xml
WEB-INF/classes/
com/acme/FooServlet.class
foo_web.war
WEB-INF/classes
com/acme/Foo.class
OR WEB-INF/web.xml
WEB-INF/classes/
com/acme/FooServlet.class
foo_ejb.jar
com/acme/FooBean.class foo_ejb.jar
com/acme/Foo.class
com/acme/FooBean.class
Using Eclipse for Java EE 6 development for GlassFish Slide 9
10. Web/EJB Application in Java EE 6 Platform
foo.war
WEB-INF/classes/
com/acme/FooServlet.class
WEB-INF/classes/
com/acme/FooBean.class
web.xml
Using Eclipse for Java EE 6 development for GlassFish Slide 10
11. <web-fragment>
<filter>
<filter-name>wicket.helloworld</filter-name>
<filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
<init-param>
<param-name>applicationClassName</param-name>
<param-value>...</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>wicket.helloworld</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-fragment>
http://blog.arungupta.me/2009/08/totd-91-applying-java-ee-6-web-fragment-xml-to-apache-wicket-deploy-on-glassfish-v3/
Using Eclipse for Java EE 6 development for GlassFish Slide 11
12. New: GlassFish + Eclipse Bundle
Using Eclipse for Java EE 6 development for GlassFish Slide 12
13. Eclipse
Eclipse Java EE IDE User
Workspace:
• V2.1 & v3
GlassFish v2.1, v3prelude domain
• JavaDB config
JDK1.6 (optional)
• MySQL JDBC
Driver
• Java EE 5/6
projects
GlassFish Eclipse Plugins • User settings
Installer
Registration
Using Eclipse for Java EE 6 development for GlassFish Slide 13
14. Key Features
• Out of the box Installer with all Java EE Eclipse Standard
Features and JDK and GlassFish servers
• GlassFish v2.1 & v3 Prelude automatic domain
creation/configuration
• Java EE 5 and 6 integration
> Servlet 3.0, EJB 3.1, JPA 2.0, JAX-WS wizards
• JavaDB configuration, JDBC resource wizard
• MySQL JDBC Driver pre-registered
• Start, Stop, Deploy, undeploy, Debug(JSP/Java)
(v2, v3)
• Deploy on Save: Default for v3
• HTTP Monitoring pre-configured
Using Eclipse for Java EE 6 development for GlassFish Slide 14
15. Key Features
• All Sun DTDs registered for validation/code completion
• All Java EE APIs registered for code completion/JavaDoc
• GlassFish Log integrated into Eclipse IDE console
• GlassFish Update Center & Admin Console Integration
• All v2, v3p DocBooks integrated in Help (no need for
Internet)
• GlassFish Web Properties in Help Menu (The Aquarium,
Support,...)
Using Eclipse for Java EE 6 development for GlassFish Slide 15
16. Key Features
• Update Centers Integration
• Eclipse Update Center for Eclipse bits and the
GlassFish Plugin
• In future releases:
> JavaFX Plugin
> WebSynergy ,GlassFish ESB
> Better MySQL integration
Using Eclipse for Java EE 6 development for GlassFish Slide 16
17. Size of GlassFish Tools Bundle for Eclipse
Components in the Installer Size (total=375Mb)
● Eclipse 164Mb
● GlassFish v2.1 87Mb
● GlassFish v3 Prelude 29Mb
● GlassFish Plugin for Eclipse 10Mb (includes javadoc and
help books)
● Registration/Configuration 0.5Mb
● JDK 1.6u12 85Mb
• JBoss Dev Studio 2.0 RC2 +EAP = 617Mb (No JDK)
• Oracle Workshop for WebLogic 10.2 = 748Mb (No JDK)
Using Eclipse for Java EE 6 development for GlassFish Slide 17
18. GlassFish Tools Bundle for Eclipse
Using Eclipse for Java EE 6 development for GlassFish Slide 18
19. GlassFish Tools Bundle for Eclipse
Using Eclipse for Java EE 6 development for GlassFish Slide 19
21. GlassFish Tools Bundle for Eclipse
Using Eclipse for Java EE 6 development for GlassFish Slide 21
22. GlassFish Tools Bundle for Eclipse
Using Eclipse for Java EE 6 development for GlassFish Slide 22
23. For More Information
• GlassFish Tools Bundle for Eclipse
> http://download.java.net/glassfish/eclipse
• http://glassfishplugins.dev.java.net
• Java EE 6 Reference Implementation :
GlassFish v3
> http://glassfish.org
Using Eclipse for Java EE 6 development for GlassFish Slide 23