If I have I class:
class A {
@Inject A(Injector injector) {}
}
then when created this instance will hold a reference to our original
injector.
If I have a class:
class A {
@Inject A(@Assisted String name, Injector injector) {}
}
and create this class using assisted factories like this:
interface AFactory {
A create(String name);
}
bind(AFactory.class).toProvider(FactoryProvider.newFactory
(AFactory.class, A.class));
then the injector which A received in its constructor is different
from our original injector and it seems it's not really a valid
injector because you can't do much with it, it throws exceptions
complaining about duplicate bindings all the time. I can provide all
those errors, but it seems to me that it all could be fixed by just
providing the correct (original) injector for factories created
objects.
Anybody has any insights into this? Am I doing something wrong?
Thanks!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-guice?hl=en
-~----------~----~----~----~------~----~------~--~---