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 <char...@paclat.net> wrote:
> 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(Key.get(new TypeLiteral<Function<Image, OperatingSystem>>() {
>     })).to(MagnetImageToOperatingSystem.class).in(Singleton.class);
>   }
>
> Now I am getting the errors below.  Is there a way to force it to replace
> the exiting binding?
>
> com.google.inject.CreationException: Guice creation errors:
>
>
> 1) A binding to
> com.google.common.base.Function<org.jclouds.openstack.nova.v2_0.domain.Image,
> org.jclouds.compute.domain.OperatingSystem> was already configured at
> com.magnet.tools.cloud.provision.jclouds.nova.CustomMagnetBindingsModule.configure(CustomMagnetBindingsModule.java:23)

Reply via email to