users@hk2.java.net

InjectionResolver crossing Module Boundaries

From: buko <buko_at_chiubarobot.com>
Date: Tue, 7 Jan 2014 07:48:41 -0500

I have an InjectionResolver defined in module A. There are some components
in module B that use the alternative injection annotation. Both modules are
then passed to ServiceLocatorUtilities.bind(ServiceLocator, Binder...).

The injection resolver is never invoked to resolve the dependencies in
module B.

Few possibilities:

a) It's not okay to define an InjectionResolver in one module and then use
it in another.
b) InjectionResolvers can't be used when/if they're added to an existing
ServiceLocator via the ServiceLocatorUtilities.bind() method. (The resolver
works fine when it's added to the parent ServiceLocator and created at the
same time as the parent locator.)

I'm thinking the problem is (b). Is there any work around? Why would
injection resolvers only be detected when a locator is created and not for
each config transaction?