Hi,

I've got several components, which look roughly like this

  public class Foo implements IFoo {
    private @Inject Bar bar;
    ...
  }

In my application, I am using several instances of IFoo with different 
values for @Named. Like this:

  public class App {
   private @Inject @Named(value="admin") adminFoo;
   private @Inject baseFoo;
   ...
  }

Ideally, I'd like to have any instance of Foo to have exactly one instance 
of Bar, with the same names. Or, to put it different:

  The adminFoo should have an adminBar, and the baseFoo should have a 
baseBar.

The only idea that comes to me mind, would be that instances of Foo can 
somehow obtain their name ("admin", or null) and use that to 
programmatically obtain their bar through the Injector.


Is that possible at all? Any other suggestions?

Thanks,

Jochen


-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice.
For more options, visit https://groups.google.com/d/optout.

Reply via email to