I have a use case where I need to add, replace or remove a
datasource(s). I have each data source living in a MyBatisModule
installed in a PrivatModule with a common service exposed. I currently
writing an implementation that can do this, but I will have to restart
the app every time I make a change. Is there a way of doing this on
the fly with the use of Inject#createChildInjector(Module... modules)
or some other method. The services that are exposed from each
PrivateModule do not depend on each other. It would also be nice to be
able to inject a Map of some sort where I can get the different
exposed services that are created:

@Inject
Map<String<ItemService> itemServices;

...

itemServices.get("DataSource1").getItem(itemId);
itemServices.get("DataSource2").getItem(itemId);


I am very new to Guice and from what I have seen so far, it looks like
I should be able to do this, just need some help so I don't try to
reinvent the wheel.

Thanks,

Warren Bell

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