Awesome, it works.
What wasn't quite obvious to me is that i didn't have to explicitly
implement Provider for handlers. I guess Guice just creates a default one
behind the scenes and injects it by type matching when needed.
Thanks a lot.
On Monday, 10 February 2014 17:46:25 UTC, Denys Zakhozhyy wrote:
>
>
> After spending a couple of hours reading I am quite confused now and not
> sure how to do the following properly.
>
> I have a Coordinator class as
>
> public class Coordinator {
>
> @Inject
> public Coordinator(@Named("HandlersGroup1") Handler[] handlers1,
> @Named("HandlersGroup2") Handler[] handlers2) {
> ...
> }
>
> }
>
>
>
> Implementations within each handler group are the same, but different from
> another group.
> Coordinator should not decide on how many handlers are in each group.
>
> How should I properly bind this with Guice?
>
>
--
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/groups/opt_out.