users@jersey.java.net

RE: [Jersey] Exposing EJB 3 Beans through JAX-RS

From: Markus KARG <markus.karg_at_gmx.net>
Date: Mon, 8 Sep 2008 18:37:43 +0200

> -----Original Message-----
> From: Paul.Sandoz_at_Sun.COM [mailto:Paul.Sandoz_at_Sun.COM]
> Sent: Montag, 8. September 2008 16:52
> To: users_at_jersey.dev.java.net
> Subject: Re: [Jersey] Exposing EJB 3 Beans through JAX-RS
>
>
> On Sep 8, 2008, at 4:21 PM, Reza Rahman wrote:
>
> > Paul,
> >
> > I think I am missing something? Why just singleton session beans? Is
> > there are a hard requirement for JAX-RS resources to be stateful?
> > Why not stateless session beans too? At any rate, how does this
> > really differ from Spring/WebBeans component life-cycles? Spring
> > singletons are designed for stateless usage (state is shared across
> > clients), as is WebBeans request scoped beans?
> >
>
> The default life-cycle for resource classes in JAX-RS is per-request.

So I suggest that internally, the JAX-RS parts of the resource are created
as a thin interfacing layer that do nothing but internally calling the
(existing, pooled) SB instance running in the application server. The JAX-RS
stuff will dynamically deal with the RESTful parts, the SB will deal with
the content.