Date post: | 15-Jan-2015 |
Category: |
Technology |
Upload: | arun-gupta |
View: | 2,516 times |
Download: | 1 times |
Using Eclipse for Java EE 6 development for GlassFish
Arun Gupta, GlassFish GuySun Microsystems, Inc.blog.arungupta.me
Slide 2Using Eclipse for Java EE 6 development for GlassFish
JPEProject
J2EE 1.2Servlet, JSP,
EJB, JMSRMI/IIOP
J2EE 1.3CMP,
ConnectorArchitecture
J2EE 1.4Web Services, Management, Deployment, Async. Connector
Java EE 5Ease of DevelopmentAnnotationsEJB 3.0Persistence APINew and Updated Web Services
Robustness
Web Service
s
Enterprise Java
Platform
`
Java EE 6EJB LiteRestful WSWeb BeansExtensibility
Java EE 6Web Profile
Ease ofDevelopme
nt
Right Sizing
Java EE: Past & Present
Slide 3Using Eclipse for Java EE 6 development for GlassFish
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
Slide 4Using Eclipse for Java EE 6 development for GlassFish
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
Slide 5Using Eclipse for Java EE 6 development for GlassFish
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
Slide 6Using Eclipse for Java EE 6 development for GlassFish
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
Slide 7Using Eclipse for Java EE 6 development for GlassFish
EoD Example - Servlets<!--Deployment descriptor
web.xml -->
<web-app><servlet> <servlet-name>MyServlet
</servlet-name> <servlet-class> com.foo.MyServlet </servlet-class> </servlet> <servlet-mapping> <servlet-name>MyServlet </servlet-name> <url-pattern>/myApp/* </url-pattern> </servlet-mapping> ... </web-app>
Servlet in Java EE 5: Create two source files /* Code in Java Class */
package com.foo;public class MyServlet extends HttpServlet {public void doGet(HttpServletRequest req,HttpServletResponse res)
{
...
}
...
}
Slide 8Using Eclipse for Java EE 6 development for GlassFish
EoD Example - ServletsServlet 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)
{...
}
Slide 9Using Eclipse for Java EE 6 development for GlassFish
Web/EJB Application in Java EE 5 Platform
foo.ear
WEB-INF/web.xmlWEB-INF/classes/ com/acme/FooServlet.classWEB-INF/classes com/acme/Foo.class
foo_web.war
com/acme/FooBean.classcom/acme/Foo.class
foo_ejb.jar
foo.ear
lib/foo_common.jar
com/acme/Foo.class
WEB-INF/web.xmlWEB-INF/classes/ com/acme/FooServlet.class
foo_web.war
com/acme/FooBean.class
foo_ejb.jar
OR
Slide 10Using Eclipse for Java EE 6 development for GlassFish
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
Slide 11Using Eclipse for Java EE 6 development for GlassFish
<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/
Slide 12Using Eclipse for Java EE 6 development for GlassFish
New: GlassFish + Eclipse Bundle
Slide 13Using Eclipse for Java EE 6 development for GlassFish
Installer
Registration
Eclipse Java EE IDE
GlassFish Eclipse Plugins
GlassFish v2.1, v3prelude
EclipseUser
Workspace:• V2.1 & v3
domain
• JavaDB config
• MySQL JDBC Driver
• Java EE 5/6 projects
• User settings
JDK1.6 (optional)
Slide 14Using Eclipse for Java EE 6 development for GlassFish
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
Slide 15Using Eclipse for Java EE 6 development for GlassFish
• 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,...)
Key Features
Slide 16Using Eclipse for Java EE 6 development for GlassFish
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
Slide 17Using Eclipse for Java EE 6 development for GlassFish
Size of GlassFish Tools Bundle for Eclipse
• JBoss Dev Studio 2.0 RC2 +EAP = 617Mb (No JDK)
• Oracle Workshop for WebLogic 10.2 = 748Mb (No JDK)
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
Slide 18Using Eclipse for Java EE 6 development for GlassFish
GlassFish Tools Bundle for Eclipse
Slide 19Using Eclipse for Java EE 6 development for GlassFish
GlassFish Tools Bundle for Eclipse
Slide 20Using Eclipse for Java EE 6 development for GlassFish
Demo
http://blog.arungupta.me/2009/09/totd-102-java-ee-6-servlet-3-0-and-ejb-3-1-wizards-in-eclipse/http://blog.arungupta.me/2009/08/totd-99-creating-a-java-ee-6-application-using-mysql-jpa-2-0-and-servlet-3-0-with-glassfish-tools-bundle-for-eclipse/http://blog.arungupta.me/2009/08/totd-98-create-a-metro-jax-ws-web-service-using-glassfish-tools-bundle-for-eclipse/http://blog.arungupta.me/2009/08/totd-97-glassfish-plugin-with-eclipse-3-5/http://blog.arungupta.me/2008/11/screencast-28-simple-web-application-using-eclipse-and-glassfish-v3-prelude/
Slide 21Using Eclipse for Java EE 6 development for GlassFish
GlassFish Tools Bundle for Eclipse
Slide 22Using Eclipse for Java EE 6 development for GlassFish
GlassFish Tools Bundle for Eclipse
Slide 23Using Eclipse for Java EE 6 development for GlassFish
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