What you want for this is Multibindings. Specifically, you want to bind a Set<Action>
(not a List
, but a Set
is probably what you really want anyway) like this:
Multibinder<Action> actionBinder = Multibinder.newSetBinder(binder(), Action.class);
actionBinder.addBinding().to(FooAction.class);
actionBinder.addBinding().to(BarAction.class);
Then you can @Inject
the Set<Action>
anywhere.