Hey Fred,
Thanks for the suggestion. I'm not exactly sure if I'm missing something
here, but is it possible to do something like:
protected void configure() {
Names.bindProperties(binder(), loadProperties("*
database_one.properties*" ));
bind(DataSource.class).annotatedWith( *@DBOne *
).toProvider(MySQLDataSourceProvider.class).in(Scopes.SINGLETON);
Names.bindProperties(binder(), loadProperties("*
database_two.properties*" ));
bind(DataSource.class).annotatedWith( *@DBTwo *
).toProvider(MySQLDataSourceProvider.class).in(Scopes.SINGLETON);
}
In a single module? Are modules explicitly supposed to have a 1:1
relationship between the interface/class bindings, or can you double stuff
up based on the annotation as I have done above? Is it common or prefered to
have a single Module for the entire configuration, or should I have a bunch
of Singleton injectors with a number of modules, depending on things like
property files, etc?
And now, I've really confused myself... damn... thanks for the guidance!
E
--
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.