Hyx Injection Injector

I am trying to override the binding in a child injector that has already been configured in the base injector.

like this:

public class PersistenceModule extends Abstract{ @Override protected void configure() { bind(IProductPersistenceHelper.class).to(ProductPersistenceHelper.class); } } 

then:

 Injector injector = Guice.createInjector(new PersistenceModule()); injector.createChildInjector(new AbstractModule(){ @Override protected void configure() { bind(IProductPersistenceHelper.class).to(MockProductPersistenceHelper.class); } }) 

Guice complains that he is already attached to this. Are there any patterns or recommendations on this issue?

+7
java guice
source share

No one has answered this question yet.

See similar questions:

112
Overriding bindings in Guice

or similar:

454
How should I explain the difference between an interface and an abstract class?
eleven
How to delegate the creation of some classes from a Guice injector to another factory?
4
Creating instances in a single, single space / group
3
guice: automate binding of common classes
2
Does Jersey-Giz not handle related resources if the injector is a child?
2
Introducing on-the-fly class with Guice
one
Associating a class map with instances inside the guice module
one
Overriding a binding or child module in Guice
0
Providing an abstract class that extends the Guice AbstractModule module and provides methods
0
Fail-safe injector for child modules. Additional bindings in google guice

All Articles