Bienvenue chez le Ch ti JUG!



Similar documents
Java EE 6 Ce qui vous attends

What's new in Java EE 6? Antonio Goncalves

The Java EE 6 Platform. Alexis Moussine-Pouchkine GlassFish Team

Java Servlet 3.0. Rajiv Mordani Spec Lead

OpenShift is FanPaaStic For Java EE. By Shekhar Gulati Promo Code JUDCON.IN

Servlet 3.0. Alexis Moussine-Pouchkine. mercredi 13 avril 2011

The. Platform. Alexis Moussine-Pouchkine Antonio Goncalves

Java EE 6 development with Eclipse, Netbeans, IntelliJ and GlassFish. Ludovic Champenois Oracle Corporation

Java EE 7: Back-End Server Application Development

Java EE Introduction, Content. Component Architecture: Why and How Java EE: Enterprise Java

JBoss JEE5 with EJB3.0 on NonStop. JAVA SIG, San Jose

RESIN APPLICATION SERVER JAVA EE 6 WEB PROFILE

<Insert Picture Here> Java EE 7: the New Cloud Platform

OUR COURSES 19 November All prices are per person in Swedish Krona. Solid Beans AB Kungsgatan Göteborg Sweden

<Insert Picture Here> Java EE 7. Linda DeMichiel Java EE Platform Lead

<Insert Picture Here> Java EE 7: the New Cloud Platform

Oracle WebLogic Foundation of Oracle Fusion Middleware. Lawrence Manickam Toyork Systems Inc

The end. Carl Nettelblad

White Paper: 1) Architecture Objectives: The primary objective of this architecture is to meet the. 2) Architecture Explanation

Web Development in Java Part I

Java EE 5, 6 et les EJBs 3.1

JAVA API FOR XML WEB SERVICES INTRODUCTION TO JAX-WS, THE JAVA API FOR XML BASED WEB SERVICES (SOAP, WSDL)

How to Build an E-Commerce Application using J2EE. Carol McDonald Code Camp Engineer

WebSphere Training Outline

Module 13 Implementing Java EE Web Services with JAX-WS

Project SailFin: Building and Hosting Your Own Communication Server.

Enterprise JavaBeans' Future: Getting Simpler, More Ubiquitous, but Not Dominant

Framework Adoption for Java Enterprise Application Development

White Paper: Why Upgrade from WebSphere Application Server (WAS) v7 to v8.x?

Client-Server Architecture & J2EE Platform Technologies Overview Ahmed K. Ezzat

Reusing Existing * Java EE Applications from Oracle SOA Suite

JAVA ENTERPRISE IN A NUTSHELL. Jim Farley and William Crawford. O'REILLY 4 Beijing Cambridge Farnham Koln Paris Sebastopol Taipei Tokyo.

JBoss SOAP Web Services User Guide. Version: M5

Complete Java Web Development

Web Service Development Using CXF. - Praveen Kumar Jayaram

Nicholas S. Williams. wrox. A Wiley Brand

Enterprise JavaBeans 3.1

GlassFish. Developing an Application Server in Open Source

Java EE 6 New features in practice Part 3

Java 2 Platform, Enterprise Edition (J2EE) Bruno Souza Java Technologist, Sun Microsystems, Inc.

Introduction to Sun ONE Application Server 7

Contents. Client-server and multi-tier architectures. The Java 2 Enterprise Edition (J2EE) platform

Case Studies of Running the Platform. NetBeans UML Servlet JSP GlassFish EJB

WEB SERVICES. Revised 9/29/2015

An introduction to creating JSF applications in Rational Application Developer Version 8.0

T-4 - Develop Better Java EE Applications With Eclipse Web Tools Platform. Christopher M. Judd. President/Consultant Judd Solutions, LLC

Tomcat 5 New Features

How To Write A Web Framework In Java

Web Application Architecture (based J2EE 1.4 Tutorial)

Implementation of an Enterprise-level Groupware System Based on J2EE Platform and WebDAV Protocol

APAC WebLogic Suite Workshop Oracle Parcel Service Overview. Jeffrey West Application Grid Product Management

Glassfish, JAVA EE, Servlets, JSP, EJB

Course Number: IAC-SOFT-WDAD Web Design and Application Development

JBS-102: Jboss Application Server Administration. Course Length: 4 days

Java and Web. WebWork

Controlling Web Application Behavior

This training is targeted at System Administrators and developers wanting to understand more about administering a WebLogic instance.

Course Name: Course in JSP Course Code: P5

Java 2 Platform, Enterprise Edition (J2EE): Enabling Technologies for EAI

Smalltalk in Enterprise Applications. ESUG Conference 2010 Barcelona

Web Applications. Originals of Slides and Source Code for Examples:

applications. JBoss Enterprise Application Platform

Java Platform, Enterprise Edition (Java EE) From Yes-M Systems LLC Length: Approx 3 weeks/30 hours Audience: Students with experience in Java SE

Why IBM WebSphere Application Server V8.0?

<Insert Picture Here> GlassFish v3 - A Taste of a Next Generation Application Server

Web Container Components Servlet JSP Tag Libraries

Developing Java Web Services

Running and Testing Java EE Applications in Embedded Mode with JupEEter Framework

EclipseLink. Solutions Guide for EclipseLink Release 2.5

Server-Side JavaScript auf der JVM. Peter Doschkinow Senior Java Architect

}w!"#$%&'()+,-./012345<ya

FEATURE MATRIX. ORACLE WEBLOGIC SERVER STANDARD EDITION 11g ORACLE WEBLOGIC SERVER ENTERPRISE EDITION 11g ORACLE WEBLOGIC SUITE 11g

J2EE Web Development. Agenda. Application servers. What is J2EE? Main component types Application Scenarios J2EE APIs and Services.

How To Protect Your Computer From Being Hacked On A J2Ee Application (J2Ee) On A Pc Or Macbook Or Macintosh (Jvee) On An Ipo (J 2Ee) (Jpe) On Pc Or

JBoss Enterprise App. Platforms Roadmap. Rich Sharples Director of Product Management, Red Hat 4th April 2011

Learning GlassFish for Tomcat Users

Accelerated Java EE Open Source Development with Eclipse CON1905

JSLEE and SIP-Servlets Interoperability with Mobicents Communication Platform

SOA Fundamentals For Java Developers. Alexander Ulanov, System Architect Odessa, 30 September 2008

WebOTX Application Server

Operations and Monitoring with Spring

ActiveVOS Server Architecture. March 2009

Web Application Programmer's Guide

As you learned about in Chapter 1, WebSphere Application Server V6 supports the

Weblogic 12c: Mastering The Cloud Foundation. Patrick Dewael & Kristof Satory

IBM WebSphere Server Administration

Oracle WebLogic Server

Building Web Applications, Servlets, JSP and JDBC

This presentation will provide a brief introduction to Rational Application Developer V7.5.

GlassFish v3. Building an ex tensible modular Java EE application server. Jerome Dochez and Ludovic Champenois Sun Microsystems, Inc.

Oracle im Open Source Kontext Abgrenzung GlassFish vs. JBoss und wozu noch WebLogic?

Eclipse Web Tools Platform. Naci Dai (Eteration), WTP JST Lead

Expert One-on-One J2EE Design and Development

Migrating JEE Applications from WLS/WAS to SpringSource tc Server. A Technical Perspective

Transcription:

Bienvenue chez le Ch ti JUG!

Programme Bienvenue chez le Ch ti JUG Le mot du sponsor Les JUGs en France Java EE 6, qu est-ce qui nous attend? L interro Le buffet

Le sponsor de cette session Ch ti JUG

Les JUGs en France

Les nouveautés de Java EE 6 Antonio Goncalves

«EJBs are dead...» «...Long live EJBs!» Rod Johnson Antonio Goncalves

Antonio Goncalves Ch ti JUG Software Architect Former BEA Consultant Experience with Application Servers Java EE 5 author (in French) Java EE 6 author (in English) JCP Expert Member Java EE 6, EJB 3.1, JPA 2.0 Co-creator, co-leader of the Paris JUG

Agenda Interoperability Tier Servlet 3.0 JSP 2.2 JSF 2.0 JAX-WS 2.2 Presentation Tier JAX-RS 1.1 EJB 3.1 JTA 1.1 JMS 1.1 Business Logic Tier Persistence Tier JPA 2.0 JCDI 1.0 Java EE 6

Java EE 6 Interoperability Tier Servlet 3.0 JSP 2.2 JSF 2.0 JAX-WS 2.2 Presentation Tier JAX-RS 1.1 EJB 3.1 JTA 1.1 JMS 1.1 Business Logic Tier Persistence Tier JPA 2.0 JCDI 1.0 Java EE 6

Project JPE A Bit of history Enterprise Application J2EE 1.2 Servlet JSP EJB JMS RMI/IIOP Robust Scalable J2EE 1.3 CMP JCA Web Services J2EE 1.4 WS Management Deployment Ease of development (web) Ease of development Java EE 6 Java EE 5 Annotations EJB 3 JPA 1.0 WS-* JSF EJB 3.1 JPA 2.0 Servlet 3.0 JSF 2.0 JAX-RS 1.1 JCDI 1.0 Bean Validat Web Profile May 1998 Dec 1999 Sept 2001 Nov 2003 10 specs 13 specs 20 specs May 2006 23 specs Q3 2009 ~28 specs

Java EE 6 is Richer, Easier, Lighter Richer New specifications Easier POJO model Less XML... even on the web tier Lighter EJB Lite Profiles and Pruning

Richer : ~28 specifications Web Services JAX-RPC 1.1 JAX-WS 2.2 JAXM 1.0 JAX-RS 1.1 JAXR 1.1 StAX 1.0 Web Services 1.2 Web Services Metadata 1.1 Enterprise EJB 3.1 JAF 1.1 JavaMail 1.4 JCA 1.6 JMS 1.1 JPA 2.0 JTA 1.1 Web JSF 2.0 JSP 2.2 JSTL 1.2 Servlet 3.0 Expression Language 1.2 Management, Security and other JCDI 1.0 JACC 1.1 Common Annotations 1.0 Java EE Application Deployment 1.2 Java EE Management 1.1 Java Authentication Service Provider Interface for Containers 1.0 Debugging Support for Other Languages 1.0 Bean Validation 1.0 + Java SE 6 JAXB 2.2 JDBC 4.0 JNDI 1.5 RMI JMX JAAS JAXP...

Lighter : Profiles Full Java EE 6 Profile X Web Profile Profile Y

Lighter : Web Profile Ch ti JUG Subset of full platform Focuses on web development Separate specification Others will come Minimal (Servlet/JSP) Portal... Servlet 3.0 JSP 2.2 EL 1.2 JSTL 1.2 EJB Lite 3.1 JTA 1.1 JPA 2.0 JSF 2.0 «...you'll see gradual move toward the Web profile» - Rod Johnson

Lighter : EJB Light Ch ti JUG Subset of the EJB 3.1 API To be used in Web profile Local Session Bean Injection CMT / BMT Interceptors Security Message Driven Beans EJB Web Service Endpoint RMI/IIOP Interoperability Remote interface EJB 2.x Timer service CMP / BMP

Lighter : Pruning (Soon less specs) Makes some specifications optional in next version Pruned in Java EE 6 Entity CMP 2.x JAX-RPC JAX-R JSR 88 (Java EE Application Deployment) Stronger than @Deprecated Might disappear from Java EE 7 Evolve (or not) separately from Java EE Easier for future containers

Easier? Of course!

Servlet 3.0 Interoperability Tier Servlet 3.0 JSP 2.2 JSF 2.0 JAX-WS 2.2 Presentation Tier JAX-RS 1.1 EJB 3.1 JTA 1.1 JMS 1.1 Business Logic Tier Persistence Tier JPA 2.0 JCDI 1.0 Java EE 6

Ease of development Ch ti JUG Annotations based programming model @WebServlet @ServletFilter @WebServletContextListener @InitParam Deployment descriptors optional (web.xml) Modular

Ease of development public class MyServlet extends HttpServlet { public void doget (HttpServletRequest req, HttpServletResponse res) {... } } Deployment descriptor (web.xml) <web-app> <servlet> <servlet-name>myservlet</servlet-name> <servlet-class>samples.myservlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>myservlet</servlet-name> <url-pattern>/myapp</url-pattern> </servlet-mapping>... </web-app>

Ease of development @WebServlet(urlMappings={"/MyApp"}) public class MyServlet extends HttpServlet { } public void doget (HttpServletRequest req, HttpServletResponse res){... } Same for filters and listeners web.xml is optional

Extensibility Ch ti JUG Fragments or modular web.xml Logical partitioning of a web application Annotations and web fragments are merged <web-fragment> <servlet> <servlet-name>myservlet</servlet-name> <servlet-class>samples.myservlet</servlet-class> </servlet> <listener> <listener-class>samples.mylistener</listener-class> </listener> </web-fragment>

Asynchronous support Ch ti JUG Servlets have to wait for a response from : Web service JDBC connection JMS message... Comet style of programming @WebServlet (asyncsupported = true) New APIs to ServletRequest / ServletResponse Suspending, resuming, querying the status of the request

JSF 2.0 Interoperability Tier Servlet 3.0 JSP 2.2 JSF 2.0 JAX-WS 2.2 Presentation Tier JAX-RS 1.1 EJB 3.1 JTA 1.1 JMS 1.1 Business Logic Tier Persistence Tier JPA 2.0 JCDI 1.0 Java EE 6

Ease of development Ch ti JUG Annotations @ManagedBean @ApplicationScoped, @SessionScoped... @FacesConverter @FacesValidator faces-config.xml optional Page declaration language (PDL) Facelets (preferred) JSP (still supported) Easier resources management Easier way of Component Development Ajax support

Managed bean public class DatabaseUtil { } private Cities cities;... faces-config.xml <managed-bean> <managed-bean-name>dbutil</managed-bean-name> <managed-bean-class>server.databaseutil </managed-bean-class> <managed-bean-scope>request</managed-bean-scope> <managed-property> <property-name>cities</property-name> <value>#{cities}</value> </managed-property> </managed-bean>

Managed bean @ManagedBean(name="dbUtil") @ApplicationScoped public class DatabaseUtil { } @ManagedProperty(value="#{cities}") private Cities cities; faces-config.xml is optional Same for converters and validators

Composite component Ch ti JUG No Java code needed Use XHTML and JSF tags to create components Like Java programming you need : «an interface» «an implementation»

Composite component Ch ti JUG <html> <composite:interface> <composite:attribute name="item" required="true"/> </composite:interface> <composite:implementation> <tr> <td>title :</td> <td> <h:inputtext value="#{compositecomponent.attrs.item.title}"/> </td> </tr> <tr> <td>description :</td> <td> <h:inputtext value="#{compositecomponent.attrs.item.desc}" /> </td> </tr> </composite:implementation> </html>

Ajax support Ch ti JUG Previous versions had no native Ajax solution Ajax support has been specified JavaScript library (jsf.js) Several specified JavaScript functions request, response, execute, render... Easier integration in your pages

EJB 3.1 Interoperability Tier Servlet 3.0 JSP 2.2 JSF 2.0 JAX-WS 2.2 Presentation Tier JAX-RS 1.1 EJB 3.1 JTA 1.1 JMS 1.1 Business Logic Tier Persistence Tier JPA 2.0 JCDI 1.0 Java EE 6

Easier & Richer Ch ti JUG Optional Local Interfaces Singleton Asynchronous calls Cron-based Timer Service Packaging in a war Portable JNDI name Embeddable Container EJB Lite

Optional Local Interface Ch ti JUG @Local, @Remote Interfaces are not always needed Only for local interfaces Remote interfaces are not optional! @Stateless public class HelloBean { } public String sayhello() { return "Salut biloute!"; }

Singleton Ch ti JUG New component Looks like a stateless / stateful No/local/remote interface Follows the Singleton pattern One single EJB per application per JVM Use to share state in the entire application State not preserved after container shutdown Added concurrency management @ConcurrencyManagement

Singleton @Singleton public class CachingBean { private Map cache; @PostConstruct void init() { cache =...; } public Map getcache() { return cache; } } public void addtocache(object key, Object val) { cache.put(key, val); }

Asynchronous calls Ch ti JUG How to have asynchronous call in EJBs? JMS is to send messages not to do asynchronous calls Threads are not allowed (don't integrate well) @Asynchronous Method returns void or Future<T> java.util.concurrent package

Asynchronous calls @Stateless public class OrderBean { public void createorder() { Order order = persistorder(); sendemail(order) ; } public Order persistorder() {...} } @Asynchronous public void sendemail(order order) {...}

Packaging in a war foo.ear foo.war lib/foo_common.jar com/acme/foo.class foo_web.war WEB-INF/web.xml WEB-INF/classes com/acme/fooservlet.class WEB-INF/classes com/acme/foo.class com/acme/fooservlet.class com/acme/fooejb.class foo_ejb.jar com/acme/fooejb.class

Portable JNDI Name Client inside a container (use DI) @EJB Hello h; Client outside a container Context ctx = new InitialContext(); Hello h = (Hello) ctx.lookup(???); Portable JNDI name is specified java:global/env/foo/helloejb java:global/(app)/(module)/(bean)#(intf)

Embeddable Container Ch ti JUG API allowing to : Initialize a container Get container context... EJB 3.1 Embedded container Transaction manager Security system Java SE Messaging engine Can run in any Java SE environment Batch processing Simplifies testing Just a jar file in your classpath

Embeddable Container public class PlaceBidClient { public static void main(string[] args) throws Exception { EJBContainer container = EJBContainerFactory.createEJBContainer(); Context context = container.getcontext(); Hello h = (Hello) context.lookup("java:global/app/foo/helloejb"); h.sayhello; } } container.close();

Timer Service Ch ti JUG Programmatic and Calendar based scheduling «Last day of the month» «Every five minutes on Monday and Friday» Cron-like syntax second [0..59], minute[0..59], hour[0..23], year DayOfMonth[1..31] dayofweek[0..7] or [sun, mon, tue..] Month[0..12] or [jan,feb..]

Timer Service @Stateless public class WakeUpBean { } @Schedule(dayOfWeek= Mon-Fri, hour= 9 ) void wakeup() {... } EJB Lite + Timer + Asynch calls + Embeddable Container = Batch processing

JPA 2.0 Interoperability Tier Servlet 3.0 JSP 2.2 JSF 2.0 JAX-WS 2.2 Presentation Tier JAX-RS 1.1 EJB 3.1 JTA 1.1 JMS 1.1 Business Logic Tier Persistence Tier JPA 2.0 JCDI 1.0 Java EE 6

JPA 2.0 Ch ti JUG Java Persistent API Evolves separately from EJB now JSR 317 Can also be used in Java SE More mappings JoinTable for OneToOne relationship Criteria API Standard properties in persistence.xml Simple Cache API

Collection of basic types Ch ti JUG @Entity Public class Item { } @ElementCollection private Set<String> tags; Mapped in a separate table

Better Support of Map Ch ti JUG @Entity public class Department {... @ElementCollection public Map<Integer, Employee> employees... } Basic types, Objects, Embeddables Mapped in a separate table

Locking Enhancement Ch ti JUG public enum LockModeType { OPTIMISTIC, OPTIMISTIC_FORCE_INCREMENT, PESSIMISTIC, PESSIMISTIC_FORCE_INCREMENT, NONE } JPA 1.0 only support optimist locking Now Pessimist locking Multiple places to specify lock Lock, read and lock, read then lock

Criteria API Ch ti JUG Used to define dynamic queries Like JPQL, Criteria API is based on Entities Allow the construction of an object-based graph Strongly typed Uses a metamodel Each entity X has a metamodel class X_

Criteria API @Entity public class Customer { @Id Integer custid; String name; Address shippingaddress;... } CriteriaQuery q = qb.create(); Root<Customer> customer = q.from(customer.class); q.select(customer.get(customer_.shippingaddress)). where(q.equal(customer.get(customer_.name),"peter"));

JAX-RS 1.1 New Interoperability Tier Servlet 3.0 JSP 2.2 JSF 2.0 JAX-WS 2.2 Presentation Tier JAX-RS 1.1 EJB 3.1 JTA 1.1 JMS 1.1 Business Logic Tier Persistence Tier JPA 2.0 JCDI 1.0 Java EE 6

JAX-RS 1.1 Ch ti JUG RESTful Services POJO and Annotations Based Data and functionality are considered resources Map HTTP HTTP Action HTTP Action GET Get a resource PUT Create or update POST Create a resource Delete Deletes a resource JAX-RS 1.0 has been released

Hello World Ch ti JUG @Path("/helloworld") public class HelloWorldResource { } @GET @Produces("text/plain") public String sayhello() { return "Hello World"; } http://example.com/helloworld

Hello World Request Response GET /helloworld HTTP/1.1 Host: example.com Accept: text/plain HTTP/1.1 200 OK Date: Wed, 12 Nov 2008 16:41:58 GMT Server: Apache/1.3.6 Content-Type: text/plain; charset=utf-8 Hello World

MIME Types @Path("/helloworld") public class HelloWorldResource { } @GET @Produces("image/jpeg") public byte[] painthello() {... @POST @Consumes("text/xml") public void updatehello(string xml) {...

Parameters @Path("/users/{userId}") public class UserResource { } @GET @Produces("text/xml") public String getuser(@pathparam("userid") String username) {... } http://example.com/users/smith123

Summary Interoperability Tier Servlet 3.0 JSP 2.2 JSF 2.0 JAX-WS 2.2 Presentation Tier JAX-RS 1.1 EJB 3.1 JTA 1.1 JMS 1.1 Business Logic Tier Persistence Tier JPA 2.0 JCDI 1.0 Java EE 6

From simple web application Presentation Tier JSF 2.0 Deployed in a war EJB 3.1 JTA 1.1 Business Logic Tier Persistence Tier JPA 2.0 Java EE 6

...to richer ones Servlet 3.0 JSF 2.0 ear in a cluster Interoperability Tier JAX-WS 2.2 Presentation Tier JAX-RS 1.1 EJB 3.1 JTA 1.1 JMS 1.1 Business Logic Tier Persistence Tier JPA 2.0 Java EE 6

Reference Implementations All these specs have reference implementations GlassFish V3 : EJB 3.1 and Servlet 3.0 EclipseLink : Java Persistence API (JPA 2.0) Jersey : RESTful Web services (JAX-RS 1.0) Metro : Web Services (JAX-WS 2.2) JBoss Seam : Web Beans 1.0 Mojarra : JSF 2.0 And they are production ready

Summary Ch ti JUG Java EE 6 is Simpler (POJO, annotation, less XML, Pruning) Richer (more specifications) Lighter (profiles, pruning, EJB lite) Standard (no vendor locking) Robust (10th anniversary) Book out in June 2009 Java EE 6 out in September 2009 «Forget the past, look to the future, Java EE 6 is the place to go...» - Antonio Goncalves

Q&A

Prochains épisodes? Rendez-vous sur chtijug.org! Flux RSS Mailing list : «chtijug-annonces» chez Google Groups Twitter: «chtijug»

Le Quizz!

Servlet 3.0 Ch ti JUG Parmi les éléments suivants, lequel est une nouveauté de Servlet 3.0? 1. Prise en charge du JDK 1.6 2. Un fichier web.xml optionnel 3. Prise en compte de la locale ch_ti

EJB 3.1 Ch ti JUG Parmi les assertions suivantes concernant les EJB 3.1, laquelle est vraie? 1. Pour être appelé en local, je n'ai pas besoin de coder d'interface 2. Pour être appelé en remote, je n'ai pas besoin de coder d'interface 3. Je suis obligé de déployer mon EJB dans un JAR séparé du WAR

JPA 2.0 Ch ti JUG Parmi les éléments suivants, lequel est une nouveauté de JPA 2.0? 1. L'utilisation d'annotations 2. L'API de Criteria 3. Les locks optimistes

Les JUGs Ch ti JUG Combien y a-t-il de JUGs en France? 1. entre 7 et 8 2. entre 13 et 15 3. entre 20 et 23 4. 42