In Guice’s documentation, the chapter about Untargetted Bindings presents this example:
bind(AnotherConcreteClass.class).in(Singleton.class);
What does the in() do? The doc doesn’t mention what it is for.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s just the scope I think. It also accept the Scopes enum – either Singleton or NO_SCOPE.
http://google-guice.googlecode.com/svn/tags/3.0/javadoc/com/google/inject/Scopes.html#SINGLETON