GWT, CDI & JAX-RS
“A match made in heaven”
Heiko Braun <hbraun@redhat.com>
GWT, CDI & JAX-RS A match made in heaven Heiko Braun - - PowerPoint PPT Presentation
GWT, CDI & JAX-RS A match made in heaven Heiko Braun <hbraun@redhat.com> About me Heiko Braun Senior Software Engineer JBoss / Red Hat 4 years JBoss, 12 years industry Focus on SOA, BPM, GWT Contributor:
Heiko Braun <hbraun@redhat.com>
frameworks
plate
modifications
12
(Errai Bus, Pub/Sub)
Bean (actual maps to it)
fully managed by CDI container
injected
CDI Component GWT Client
14
interface
beans (maps to it)
client API
CDI Component Remote interface GWT Client
15
exchange
client API
custom CDI events
CDI Component GWT Client
16
17
@Path("/customerservice/")
@Produces("application/xml") public class CustomerService { @GET @Path("/customers/{id}") @Produces("application/json") public Customer getCustomer(@PathParam("id") String id) { ...... } @PUT @Path("/customers/{id}") @Consumes("application/xml") public Response updateCustomer(@PathParam("id") Long id, Customer customer) { ...... } @POST @Path("/customers") public Response addCustomer(Customer customer) { ...... } @DELETE @Path("/customers/{id}/") public Response deleteCustomer(@PathParam("id") String id) { ...... } }
GWT Client Server Resource
within EE 6 environments
Still better then writing your own servlet code
You can mix and match JAX-RPC and CDI within the same components (at least on JBoss 6)
[1] http://anonsvn.jboss.org/repos/errai/projects/weld-integration/trunk/
design
directional
serialization
Publisher Subscriber