Tavian, thanks for the help!


> Yes, as written you'll have two separate singletons.  You want to bind 
> server implementation *itself* as a singleton, like this:
>
> bind(getServerClass()).in(Scopes.SINGLETON);
>
>

 That seems to work great, thanks!



> Type type = Types.newParameterizedType(IServer.class, getServerType());
> TypeLiteral<?> typeLiteral = TypeLiteral.get(type);
> bind(typeLiteral).to(getServerType());
>
> There are probably some casts missing from that snippet, you may have to 
> use raw types to get it to compile, but that's the gist.
>


 I'm unable to make this work!

<https://lh3.googleusercontent.com/-VsMrcr00pDQ/Vo8FaUNlKsI/AAAAAAAAAAg/z5-p2rbiOqw/s1600/err.png>

And, the IDE help for the parameters :

<https://lh3.googleusercontent.com/-n7ESp2b-hWw/Vo8Gcyp7r4I/AAAAAAAAAA4/ncPevqbuob0/s1600/err2.png>



Any idea?

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-guice.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-guice/2e3082e6-66fe-4555-b393-d46c97489f82%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to