- The document is a program for a conference on JAX-RS and Java EE 6 held in 2010.
- The keynote speaker Paul Sandoz will give a presentation on JAX-RS, the Java API for RESTful Web Services, and its role in Java EE 6.
- The agenda lists several sessions on topics related to JAX-RS, mobile development, agile practices and more running throughout the day.
2. Agilité iPhone Java Incubateur
8:15 Accueil des participantsAccueil des participantsAccueil des participantsAccueil des participants
8:40 Mot des organisateurs & Criée des orateursMot des organisateurs & Criée des orateursMot des organisateurs & Criée des orateursMot des organisateurs & Criée des orateurs
9:00 Keynote de Nicolas Martignole (30 minutes)Keynote de Nicolas Martignole (30 minutes)Keynote de Nicolas Martignole (30 minutes)Keynote de Nicolas Martignole (30 minutes)
9:40
10:40
- A1 -
Le terrain Agile
Jean-Philippe Vigniel
- I1-
Hello iPhone
Stephane Tavera
- J1 -
NOSQL also means RDF stores: an
Android case study
Fabrizio Giudci
- X1 -
Le développement durable
Dominic Williams
11:00
12:00
- A2 -
Integration of User Centered Design
in Agile Development of RIA
J. Borkenhagen, J. Desmazières
- I2 -
Développement d'une application
iPhone pilotée par les tests
Emmanuel Etasse, Van-Charles Tran
- J2 -
La Tequila du développement Web
Nicolas Martignole
- X2 -
Cloud Computing: anatomie et
pratique
Marc-Elian Bégin
12:20
13:20
- A3 -
Adoption de l'Agilité par les usages
Xavier Warzee
- I3 -
Distribution d'applications iPhone
en Entreprise: Réalisation d'un
AppStore interne
Géraud de Laval
- J3 -
Vaadin - Rich Web Applications in
Server-side Java without Plug-ins or
JavaScript
Joonas Lehtinen
- X3 -
Les DVCS sont vos amis
Sébastien Douche
Pause repas (50 minutes)Pause repas (50 minutes)Pause repas (50 minutes)Pause repas (50 minutes)
14h10 Keynote de Regis Medina (30 minutes)Keynote de Regis Medina (30 minutes)Keynote de Regis Medina (30 minutes)Keynote de Regis Medina (30 minutes)
14h50
15h50
- A4 -
Scrum, introduction et mise en
oeuvre avec iceScrum
Claude Aubry
- I4 -
Agile iOS Development
Jérôme Layat, Alexander Osterwalder
- J4 -
JAX-RS and Java EE 6
Paul Sandoz
- X4 -
IT Design & Ergonomy
Pascal Petit, Aude Lussigny
16h10
17h10
- A5 -
Agilité : 10 ans déjà
Thierry Cros
- I5 -
Optimizing iOS applications
Marc-Antoine Scheurer
- J5 -
Ecrivez et automatisez vos tests
fonctionnels avec jBehave
Xavier Bourguignon
- X5 -
NoSQL : Enfin de la biodiversité
dans l'écosystème des BD
Olivier Mallassi
17h30
18h30
- A6 -
Lean engineering
Jean-Christophe Dubail
- I6 -
iPhone et Agile, l'amour vache
Guillaume Duquesnay
- J6 -
Let's make this test suite run faster
David Gageot
- X6 -
The feel of Scala
Mario Fusco
Mot de la fin & tombolaMot de la fin & tombolaMot de la fin & tombolaMot de la fin & tombola
Programme de la Conférence
www.soft-shake.ch
3. JAX-RS,
The Java API for
RESTful Web services,
and Java EE 6
paul.sandoz@oracle.com
http://blogs.sun.com/sandoz/
https://twitter.com/PaulSandoz/
4. Agenda
● REST and JAX-RS primer
● Deployment options
● Demonstration
● Status
● Q & A
7. REST is an Architectural Style
Set of constraints
you apply to the architecture
of a distributed system
to induce desirable properties
8. RESTful Web services
Application of
REST architectural style to
services that utilize Web standards
(URIs, HTTP, HTML, XML, Atom, RDF
etc.)
9. Java API for RESTful Web Services
(JAX-RS)
Standard annotation-driven API
helping developers build RESTful Web
services in Java
10. RESTful application cycle
Resources are identified by URIs
↓
Clients communicate with resources via requests
using a standard set of methods
↓
Requests and responses contain resource
representations in formats identified by media types
↓
Responses contain URIs that link to further
resources
11. Resources are identified by URIs
http://example.com/widgets/foo
http://example.com/customers/bar
http://example.com/customers/bar/orders/2
http://example.com/orders/101230/customer
12. Resources are identified by URIs
● Resource == Java class
● POJO
● No required interface
● ID provided by @Path annotation
● Value is relative URI path, base URI is provided by
deployment context or “super” resource
● Embedded parameters for non-fixed parts of the
URI path
● Annotate class or “sub-resource-locator” method
13. Resources are identified by URIs
@Path("properties")
public class SystemProperties {
@GET
List<SystemProperty> getProperties(...) {...}
@Path("{name}")
SystemProperty getProperty(...) {...}
}
14. Standard set of methods
Method Purpose
GET Read, possibly cached
POST Update or create without a known ID
PUT Update or create with a known ID
DELETE Remove
15. Standard set of methods
● Annotate resource class methods with standard
method
● @GET, @PUT, @POST, @DELETE, @HEAD, @OPTIONS
● @HttpMethod meta-annotation allows extensions,
e.g. WebDAV or @PATCH
● JAX-RS routes request to appropriate resource
class and method
● Flexible method signatures, annotations on
parameters specify mapping from request
● Return value mapped to response
16. Standard set of methods
@Path("properties/{name}")
public class SystemProperty {
@GET
Property get(@PathParam("name") String name)
{...}
@PUT
Property set(@PathParam("name") String name,
String value) {...}
}
17. Resource representations
● Representation format identified by media type.
E.g.:
● XML – application/properties+xml
● JSON – application/properties+json
● (X)HTML+microformats – application/xhtml+xml
● JAX-RS automates content negotiation
● GET /foo
Accept:application/properties+json
18. Resource representations
Static and dynamic content negotiation
● Annotate methods or classes with static
capabilities
● @Produces, @Consumes
● Use Variant, VariantListBuilder and
Request.selectVariant for dynamic
capabilities
● Also supports language and encoding
21. Response contains links
● UriInfo provides information about
deployment context, the request URI and the
route to the resource
● UriBuilder provides facilities to easily
construct URIs for resources
22. Response contains links
@Context UriInfo i;
SystemProperty p = ...
UriBuilder b = i.getBaseUriBuilder();
URI u = b.path(SystemProperties.class)
.path(p.getName()).build();
List<URI> ancestors = i.getMatchedURIs();
URI parent = ancestors.get(1);
23. Agenda
● REST and JAX-RS primer
● Deployment options
● Demonstration
● Status
● Q & A
24. Java SE deployment
● RuntimeDelegate is used to create instances
of a desired endpoint class
● Application supplies configuration information
● List of resource classes and providers as subclass
of Application
● Implementations can support any Java type
● Jersey supports Grizzly and the LW HTTP server in
Sun's JDK
25. Java SE deployment
Application app = ...
RuntimeDelegate rd = RuntimeDelegate.getInstance();
Adapter a = rd.createEndpoint(app, Adapter.class);
SelectorThread st = GrizzlyServerFactory.create(
"http://127.0.0.1:8084/", a);
26. Servlet deployment
● JAX-RS application packaged in WAR like a
servlet
● For JAX-RS aware containers (e.g. supporting
Servlet 3.0)
● Application subclass referenced to in web.xml
as servlet name
● Application subclass annotated with
@ApplicationPath, no web.xml required
27. Servlet deployment
● For non-JAX-RS aware containers
● web.xml points to implementation-specific
Servlet; and
● an init-param identifies the Application
subclass
● Resource classes and providers can access
Servlet request, context, config and response
via injection
● @Context HttpServletRequest hsr;
28. Java EE 6 deployment
● Annotate with @Path, or @Provider
● EJB 3.1 session or singleton bean
● A (managed) bean annotated with @ManagedBean
● A CDI (managed) bean annotated with scope, such
as @RequestScoped or @ApplicationScoped
– CDI is enabled with an empty WEB-INF/beans.xml file
● Full access to facilities of native component
model
● Resource injection: @EJB, @Resource
● Support for @Inject
30. Agenda
● REST and JAX-RS primer
● Deployment options
● Demonstration
● Status
● Q & A
31. Agenda
● REST and JAX-RS primer
● Deployment options
● Demonstration
● Status
● Q & A
32. Status
● JAX-RS 1.1 maintenance released on
23rd
November 2009
● Jersey integrated into GlassFish 3.0, 3.0.1 and
3.1
● Possibly in-scope for any JAX-RS 2.0 effort
● Client API
● Hyperlinking
● Module view controller
● Parameter validation
● Better integration with @Inject
33. More information
● JSR
● http://jcp.org/en/jsr/detail?id=311
● http://jsr311.dev.java.net/
● mailto:users@jsr311.dev.java.net
● Jersey, the Reference Implementation
● http://jersey.dev.java.net/
● mailto:users@jersey.dev.java.net
● Blogs
● http://blogs.sun.com/sandoz/
● http://blogs.sun.com/japod/
● http://weblogs.java.net/blog/mhadley/