I think that you're looking for Assisted Inject:
http://code.google.com/p/google-guice/wiki/AssistedInject
On Thu, Jul 5, 2012 at 9:14 PM, cheez u.int.3...@gmail.com wrote:
I have a FTP client which has multiple servers configured by the user at
runtime:
class FTPConnection
{
If you absolutely want to go with just in time bindings: @ProvidedBy
is your best bet.
Cheers
Alen
On 5 jul., 09:33, Rainer Jung rainer.j...@gmail.com wrote:
Hello everyone.
I'm trying to create a Singleton to be used by Guice, and still remain to
be used as classical Singleton (it's a new
Hi Alen.
Thanks for your answer.
So i will need to create a Provider for my class.
Well, i wouldn't need one, but it would probably work like that.
I just wonder, if there's a possibility without a Provider and just with
the Implementation.
Regards,
-Rainer
On Friday, July 6, 2012 3:53:11 PM
Your Singleton is not thread safe. Some proper ways of doing it
http://stackoverflow.com/questions/70689/efficient-way-to-implement-singleton-pattern-in-java.
You can only use @Provides in a module. So it is impractical to use it
in your case.
I'd work backwards. Imagine what kind of API you