On 17/01/2010 00:18, Dhanji R. Prasanna wrote:
2010/1/17 Willi Schönborn <[email protected] <mailto:[email protected]>>On 16/01/2010 18:02, Kartik Kumar wrote:This may help. http://code.google.com/p/google-guice/wiki/BindingAnnotationsNo, i dont want to bind multiple Implementations to the same interface, i want to configure (!) multiple instances of the same class independently using annotations (@Named). You're referring to the robot legs problem: http://code.google.com/p/google-guice/wiki/FrequentlyAskedQuestions (look for "robot legs")
I managed to solve a part of the problem using private modules, but there is something left i dont know
how to do:
Better example:
public interface Database
and
class MySqlDatabase implements Database {
@Named("database.mysql.username")
private String username;
}
Lets assume i actually want to work with two different mysql databases and
i have a settings.properties which is bound using
Names.bindProperties() and contains:
database.mysql.username = test database.mysql.second.username = user I need a way to "override" a constant bound by Names.bindProperties(...) in a private module by using the value of another constant binding. E.g. I want to set the value of "database.mysql.username" to the value of "database.mysql.second.username" in my private module without the need to parse the properties file on my own.
Dhanji. --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.
--
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.
