You could use a provider and let it construct the appropriate one
using the parameter you get through @Named. You can cache instances
with the provider if you want.

Eelco


2010/1/16 Willi Schönborn <[email protected]>:
> On 16/01/2010 18:02, Kartik Kumar wrote:
>
> This may help. http://code.google.com/p/google-guice/wiki/BindingAnnotations
>
> No, i dont want to bind multiple Implementations to the same interface, i
> want to configure (!)
> multiple instances of the same class independently using annotations
> (@Named).
>
>
> 2010/1/16 Willi Schönborn <[email protected]>
>>
>> Hi there,
>>
>> I consider switching to properties configuration style using guice, but i
>> am concerned about how to configure two instances of the same
>> implementation. Lets say there is an interface "MailService" and one (!)
>> implementation, let's say "VelocityMailService" which can be configured,
>> using annotations. How can i have two "VelocityMailService"s configured
>> independently. Any idea?
>>
>> Thanks for the reply,
>>
>> W
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "google-guice" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/google-guice?hl=en.
>>
>>
>>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-guice" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-guice?hl=en.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-guice" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-guice?hl=en.
>
>
-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en.


Reply via email to