Re: Customizing ImageToOperatingSystem

2014-06-05 Thread Ignasi Barrera
Could you share the code in a gist or paste (obviously excluding the credentials)? Just the relevant code that creates the context,, the module class and your function implementation. Just to have a bit more context. Thanks! On 5 June 2014 22:44, Charles Paclat wrote: > Hi Ignasi, This is what

Re: Customizing ImageToOperatingSystem

2014-06-05 Thread Charles Paclat
Hi Ignasi, This is what I am doing... bind(ImageToOperatingSystem.class).to(MagnetImageToOperatingSystem.class).in(Singleton.class); Where the class is... public class MagnetImageToOperatingSystem extends ImageToOperatingSystem { private final Map> osVersionMap; @Inject public MagnetIma

Re: Customizing ImageToOperatingSystem

2014-06-05 Thread Ignasi Barrera
How are you configuring the binding in your Guice module? You need to bind it like: bind(ImageToOperatingSystem.class).to(YourCustomImageToOperatingSystem.class).in(SINGLETON); On 5 June 2014 18:06, Charles Paclat wrote: > Ignasi, > > Thanks again for your patience. I guess what I need is for

Re: Customizing ImageToOperatingSystem

2014-06-05 Thread Charles Paclat
Ignasi, Thanks again for your patience. I guess what I need is for the wrapper classes to be injected with my version of the class and not the original, I did subclass the original class, but then it did not seem to find my registered instance. So it seem the only thing I am not quite getting i

Re: Customizing ImageToOperatingSystem

2014-06-05 Thread Ignasi Barrera
No. AFAIK there's no way to do that. That's why I said you'd have to create a subclass, just to bind the "result of the original binding" to your custom one, instead of overriding the original binding, which is not allowed bu Guice. On 5 June 2014 16:49, Charles Paclat wrote: > Thanks again for t

Customizing ImageToOperatingSystem

2014-06-05 Thread Charles Paclat
Thanks again for the pointers. I was able to make some progress by using... When I tried using the .class of the original as suggest it was not finding my replacement. I found the other alternatives for bind that used TypeLiteral and Key and tried those. protected void configure() { bind(K