Hi,
I've got a problem that I can't solve by myself with guice, a little
help would be nice, thanks.
I've got a routine, that injects some "stuff" from a resource into a
given instance. Until now, the stuff that was injected was
instanciated using "newInstance". That was nice, but now I'm getting a
guice-addict, I would like to instanciate this "stuff" using
injector.getInstance().
1/ solution could be :
Use a TypeListener,
public void injectMembers(T t) {
LOG.info("injecting guice/jformdesigner: " +
t.getClass());
myOwnInjector.injectInto(t);
}
}
but myOwnInjector should have been instantiated by guice, And I can't
make it !?
2/ a one liner in every class could go like this
@Inject
MyClass(MyOwnInjector in){
in.injectInto(this);
}
But, hey, that's a ugly dependency, isn't it ?
Any ideas ?
--
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.