Paul Sandoz wrote:
>
> Lets differentiate between the resposibilities such that Guice injects
> what Guice understands and Jersey injects what Jersey understands
> according to what is specified by JAX-RS.
>
I see two problems with this approach.
1) Some of us want Guice to handle all injection. See
http://groups.google.com/group/google-guice/browse_thread/thread/649f1a24c62a2bae
2) Even if we wanted to firmly separate Jersey and Guice, where each one
would be responsible for injecting their own classes, there is no (simple)
way to implement it with the current architecture.
Currently, Jersey asks Guice to inject all classes (even Jersey-specific
ones) and if it fails Jersey does the injection itself. This is not the same
as asking Jersey to inject its own classes and Guice to inject its own.
Because there is no firm separation I am unable to throw a fatal exception
if Guice fails to inject a class that it is expected to inject.
For example, if someone annotated a class with Guice scoping rules but at
runtime Guice fails to inject it (because something is wrong with the
configuration) then it falls back on Jersey's built-in injection and ignores
all the Guice annotations, which is wrong. Users would expect a hard
failure.
Gili
--
View this message in context: http://n2.nabble.com/Using-Guice-with-JAX-RS-tp1127230p1303996.html
Sent from the Jersey mailing list archive at Nabble.com.