Hi Patrick,
Patrick Ruhkopf wrote:
> I would like to inject the current user object to my resources. Is there a
> way to create customized annotations and injectables?
>
> I looked at the source code and noticed a comment in
> com.sun.ws.rest.impl.application.WebApplicationContext (line 127) saying
> "TODO defer to other injection providers".
>
> This sounds promising. Is this going to be implemented soon?
Marc gives some suggestions on how to support this. See also Christian
Rivasseau's integration with Guice [1].
But if these are not sufficient for your needs it also be possible to
have a light weight container independent (and IoC independent) solution
whereby a set of injectable classes to instantiate or instances
associated with an 'marker' are passed to the container using the
property bag on the ResourceConfig.
This should fairly easy to implement, and incidentally i talked to
another developer who wants similar functionality as well, see this
issue [2]. We have a lot to get into the 0.5 release but we might be
able to get it fixed in this time-frame. Note that we are very happy to
accept contributions, e.g. patches attached to issues, so if you want to
help it would be very much appreciated :-)
Paul.
[1]
http://objectif-naiade.blogspot.com/2007/11/integrating-jersey-with-guice-and.html
[2]
https://jersey.dev.java.net/issues/show_bug.cgi?id=22
> If not, how
> would you implement security functionality? With plain old servlet
> filters?
>
> Regards
> Patrick
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: dev-help_at_jersey.dev.java.net
>
--
| ? + ? = To question
----------------\
Paul Sandoz
x38109
+33-4-76188109