Your SlideShare is downloading. ×
Java EE 6, Eclipse @ EclipseCon
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Java EE 6, Eclipse @ EclipseCon

1,974
views

Published on


0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,974
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
8
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. <Insert Picture Here> Java EE 6 application development, OSGi and Eclipse users Roberto Chinnici Java EE 6 Specification Lead Ludovic Champenois, GlassFish Tools Architect
  • 2. JAVA EE 6 FINAL RELEASE DECEMBER 10, 2009
  • 3. What's New? • Several new APIs • Web Profile • Pluggability/extensibility • Dependency injection • Lots of improvements to existing APIs
  • 4. New and updated components • EJB 3.1 • Managed Beans 1.0 • JPA 2.0 • Interceptors 1.1 • Servlet 3.0 • JAX-WS 2.2 • JSF 2.0 • JSR-109 1.3 • JAX-RS 1.1 • JSP 2.2 • Connectors 1.6 • EL 2.2 • Bean Validation 1.0 • JSR-250 1.1 • DI 1.0 • JASPIC 1.1 • CDI 1.0 • JACC 1.5
  • 5. Web Profile • First Java EE profile to be defined • A fully-functional, mid-size stack for modern web application development • Complete, but not the kitchen sink
  • 6. Java EE 6 Web Profile Contents JSF 2.0 JSP 2.2 · EL 2.2 · JSTL 1.2 · JSR-45 1.0 Servlet 3.0 EJB 3.1 Lite · DI 1.0 · CDI 1.0 · Managed Beans 1.0 Bean Validation 1.0 · Interceptors 1.1 · JSR-250 1.1 JPA 2.0 · JTA 1.1
  • 7. Pluggability/Extensibility • Focus on the web tier in this release • Create a level playing field for third-party frameworks • Simplify packaging of web applications
  • 8. Modular Web Applications • Libraries can contain /META-INF/web-fragment.xml • web.xml is optional • @WebServlet, @WebFilter annotations • ServletContainerInitializer interface • Programmatic registration of components • Resource jars containing /META-INF/resources
  • 9. Sample Web Fragment Descriptor <web-fragment version=”3.0” xmlns="http://java.sun.com/xml/ns/javaee"> <servlet> <servlet-name>welcome</servlet-name> <servlet-class>WelcomeServlet</servlet-class> </servlet> <listener> <listener-class>RequestListener</listener-class> </listener> </web-fragment>
  • 10. JAX-RS 1.1 • RESTful web services API • Already widely adopted • Really a general, high-level HTTP API • Annotation-based programming model • Programmatic API when needed
  • 11. JAX-RS Sample @Path(“widgets/{id}”) @Produces(“application/widgets+xml”) public class WidgetResource { public WidgetResource(@PathParam(“id”) String id) {…} @GET public Widget getWidget() {…} @PUT public void putWidget(Widget widget){…} }
  • 12. Bean Validation 1.0 • Integrated with JSF, JPA • Declarative constraints using annotations @NotNull @Size(max=40) String address; • Fully extensible: define your own constraints @Email String recipient; • Validator API for programmatic validation validator.validate(obj) → Set<ConstraintViolation>
  • 13. EJB 3.1 • @Singleton beans • @Startup beans • @Asynchronous invocations @Asynchronous public Future<Integer> compute(); • Define EJBs directly inside a web application • EJBContainer API works on Java SE
  • 14. Adding an EJB to a Web Application Before Now BuyBooks.war ShoppingCart ShoppingCart EJB Class EJB Class ShoppingCart.jar BuyBooks.ear BuyBooks.war
  • 15. Dependency Injection • DI + CDI (JSR-330 + JSR-299) • @Resource still around @Resource DataSource myDB; • Added @Inject annotation for typesafe injection @Inject @LoggedIn User user; • Automatic scope management (request, session, etc.) • No configuration: beans discovered at startup • Extensible via the BeanManager API
  • 16. Dependency Injection Sample @ApplicationScoped public class CheckoutHandler { @Inject public CheckoutHandler( @LoggedIn User user, @Reliable @PayBy(CREDIT_CARD) PaymentProcessor processor, @Default ShoppingCart cart) {…} } Injection points identified by Qualifier + Type @Default can be omitted
  • 17. JSF 2.0 • Facelet as a standard view declaration language • Composite components • Automatic discovery of component libraries • Programmatic and declarative Ajax support • System events • Validation out-of-the-box
  • 18. Java EE 6 Platform • More powerful • More flexible • More extensible • Easier to use http://java.sun.com/javaee
  • 19. What is GlassFish • A Community – Users, Partners, Testers, Developers – Started in 2005 on http://java.net • Application Server – Enterprise Quality and Open Source (CDDL & GPL v2) – Java EE 5 / 6 Reference Implementation • Full Commercial Support from Oracle – Not only a Reference Implementation – Roadmap announced tomorrow regarding HA, Clustering...
  • 20. GlassFish v3... • The Java EE 6 spec, of course, and... • Beyond the spec – Fast, very fast, small, very small – restart, btrace/dtrace, embedded, modularity, OSGi, RESTful Admin,... – Scripting: jRoR, Grails, and now Django • Update Center: repository of new/updated bundles • Tooling: Netbeans 6.8, IntelliJ,vi, and – Eclipse 3.5, 3.6Mx
  • 21. Modular and Dynamic • Modular : OSGi: Equinox and Apache Felix • But also Equinox or Static mode, thanks to HK2 – Yet very Fast ! • Painless Java EE 6 development – Via the new/easier APIs – Via better tools integration – Ultra fast Auto-deploy of all Java EE and static artifacts – Application runner • java -jar glassfish.jar foo.war
  • 22. Web Session Retention • Deployment option to maintain stateful sessions across re- deployments – $ asadmin redeploy --properties keepSessions=true myapp.war – Enabled by Default in Eclipse IDE • For All sessions: – Servlets, CDIs, Stateful EJBs,... • Greatly simplifies the development paradigm
  • 23. GlassFish and OSGi • GlassFish runs on top of OSGi (Felix and Equinox) – GlassFish ships with 200+ bundles • Can use OSGi management tools (CLI or Web) • Any OSGi bundle will run in GlassFish v3 – Drop it in domain1/autodeploy/bundles – Can also asadmin deploy it using --type osgi • Consume OSGi services via @Resource @Resource (mappedName="MYPUREOSGISERVICE") HelloService myOSGiService; • Web Application Bundle (WAB Support)
  • 24. Demo • GlassFish Java EE dev in Eclipse
  • 25. Integration with maven 2 • Java EE 6 APIs in Maven repository – http://download.java.net/maven/2/javax/javaee-api/ – Stripped jars: very small <1Mb – Not to be used for Testing • GlassFish Embbeded can run via Maven – mvn gf:run
  • 26. Update Center: Add/Remove/Update Bundles
  • 27. Thanks for your attention! • http://java.sun.com/javaee • http://glassfish.org

×