hi,

you can use:

Multbinder<Service> standardBinder =
  Multibinder.newSetBinder(binder(), Service.class);

Multbinder<Service> specialBinder =
  Multibinder.newSetBinder(binder(), Service.class, Special.class);

(note the third arg to the factory  method is the class of the binding
annotation to use)

-Fred

On Sun, Jul 25, 2010 at 11:19 AM, Simone Tripodi
<[email protected]>wrote:

> Hi all guys,
> I'm in trouble with using Binding annotations & Multibinding, my
> situation is: given a simple interface
>
> interface Service {}
>
> I've the need inject in the same components 2 different kinds of
> Set<Service>:
>
> class MyServiceClient {
>
> @Inject
> Set<Service> normalServices;
>
> @Inject
> @Special
> Set<Service> specialServices;
>
> }
>
> where @Special is a binding annotation ans the Set<Service> are bound
> using the Multibinder.
> So the question is: is there any way to express the bind: bind the
> Set<Service> annotated with @Special built by the Multibinder?
>
> Thanks a lot in advance!!!
> Simo
>
> http://people.apache.org/~simonetripodi/
> http://www.99soft.org/
>
> --
> 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]<google-guice%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-guice?hl=en.
>
>

-- 
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.

Reply via email to