On Sunday, January 8, 2012 7:08:21 AM UTC+1, Aladdin wrote:
>
> @Thomas I think you MultiBinder is what I need but I'm using GIN and
> it's not supported :(
>
>
> Any other suggestions ?
Could possibly be as simple as (in your GinModule):
@Provides Set<ServiceConsumer<?>>
provideServiceConsumers(CustomerAccountsServiceConsumer accountConsumer,
CustomerCreditCardsServiceConsumer creditCardConsumer) {
return new HashSet(Array.asList(accountConsumer, creditCardConsumer));
}
The major (if not only) difference with MultiBinder is that all bindings
have to be known and declared in the same GinModule (whereas MultiBinder
can "incrementally" add to the Set from distinct modules).
--
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-guice/-/pEypSi01Q-0J.
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.