On May 14, 2009, at 8:30 PM, Zach Cox wrote:
> Is there a specific reason that
> GuiceComponentProviderFactory.isInjectPresent only looks for Guice's
> @Inject annotation on constructors?
I thought that was the easiest solution for the case when Guice
instantiates but Jersey manages the life-cycle. To enable such support
you have to annotate a constructor with @Inject, and of course the
class must not be explicitly bound. Do you think we should loosen such
requirements to detect such cases?
For explicitly bound classes the
GuiceComponentProviderFactory.isInjectPresent is never utilized and
there are no restrictions imposed by Jersey on what should be annotated.
Paul.
> Guice also supports method and
> field injection. By not looking for @Inject on methods and fields,
> resource classes that use method or field injection but not
> constructor injection are not handled by Guice at all.
>
> Thanks,
> Zach
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>