Hi Dale,
See the following thread [1] for some information on this. We are
currently working out the details of state and life-cycle. Per-request
will be the default.
As of now the 0.2 stable and trunk builds create a per-application
singleton of a root resource (one annotated with UriTemplate). To create
a per-request instance you need to do something like the following from
a root resource, for example:
@UriTemplate("/")
public class Resource {
@UriTemplate("foo")
public FooResource getFooResource(<parameters>) {
return new FooResource(<parameters>, <more parameter>);
}
}
A URI path begining with "/foo" will result in a new instance of
FooResource for each request.
Hope this helps,
Paul.
[1]
https://jersey.dev.java.net/servlets/BrowseList?list=users&by=thread&from=884340
Dale Peakall wrote:
> Hi,
>
> I guess I must be missing something quite fundamental here, but how do I
> create a JAX-RS service for an object that has (non-global/static) state?
>
> Thanks.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
--
| ? + ? = To question
----------------\
Paul Sandoz
x38109
+33-4-76188109