I have an @Provides method in a module that creates an object for me, and 
the class of that object has @Singleton on it. I found that merely having 
the @Singleton on the class does not enforce a single instance being 
created. After adding @Singleton to the @Provider method, I do get a single 
instance. Even though I am doing a "new" on the object in my provider 
method, couldn't Guice see that the @Provider method is creating it, and do 
the same thing it does (keep a single instance handy and give it out when 
requested) when having the @Singleton on the provider method?

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to