I never used provide methods, but you can add the @Singleton annotation to the provided class.

Am 24.08.2014 16:57 schrieb Maatary Okouya <maatarioko...@gmail.com>:
I have the following on the guice website with few explanation:

  @Provides @Singleton
  TransactionLog provideTransactionLog() {
    ...
  }

Is that the solution. Does the singleton apply to the provider or the provided. If it applies to the provider then, the solution would be to retain one instance and return it each time. But that would not work with a provide method.
Any help ?

On Sunday, August 24, 2014 4:38:06 PM UTC+2, Maatary Okouya wrote:
Hi, 


I have an object A that does some important loading. I use a provider for it. I have object B that needs A for its initialization. However in an object C I want to pass A, and B, properly prepared. 

Would it be possible to get a provider to return the same instance all the time, or the guice module to keep that instance provided and stop right there?


Many thanks,

-M-

--
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 google-guice+unsubscr...@googlegroups.com.
To post to this group, send email to google-guice@googlegroups.com.
Visit this group at http://groups.google.com/group/google-guice.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-guice/7d1352b4-cfe1-4397-8309-1694336bbcfa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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 google-guice+unsubscr...@googlegroups.com.
To post to this group, send email to google-guice@googlegroups.com.
Visit this group at http://groups.google.com/group/google-guice.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-guice/0MKHik-1XMCt73Luw-001fyO%40mail.gmx.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to