Unless you want three different implementations injected into
different dependents and distinguished in which case you want to use
@Named or a custom binding annotation.  The docs on code.google.com
also cover this.

Regards,
Christian
Sent from my iPhone.

On Mar 18, 2012, at 21:17, Tejal <[email protected]> wrote:

> I am new to guice. I want to bind one interface(FilterConfig) to
> multiple instances and then be able to instantiate FilterImpl with
> each of these filterConfig instances. In short, FilterImpl can be
> instantiated with a different FilterConfig instance. How can I achieve
> the following using guice:
>
>
> public interface Filter {
>
> }
>
> public interface FilterConfig {
>
> }
>
> public class FilterImpl implements Filter {
>
>    public FilterImpl(FilterConfig config) {
>
>    }
>
> }
>
>
> What I want to achieve is the following:
> FilterImpl filter1 = new FilterImpl( config1 );
> FilterImpl filter2 = new FilterImpl( config2 );
> FilterImpl filter2 = new FilterImpl( config3 );
>
> where config1, config2, config3 are different instances of
> FilterConfig.
>
> Thanks in advance
>
> --
> 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