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
*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
Guice does not provide a way to bind conditionally. Any decission which is made at runtime must happen in your code.
The only thing which I can think of that might help in this kind of situation are multibindings. Basically multibindings allow to bind many implementations of an interface. All