-
-
Save mren/f4ceddaa69b31da5f722 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ExtensionComponent | |
public class AppConfigurator implements ErraiConfigExtension { | |
private final Logger logger = LoggerFactory.getLogger(AppConfigurator.class); | |
public void configure(ErraiConfig config) { | |
final Foo foo = new FooMock(); | |
ResourceProvider<Foo> fooAdapter = new ResourceProvider<Foo>() { | |
public Foo get() { | |
return foo; | |
} | |
}; | |
logger.info("adding binding for: " + foo.getClass()); | |
config.addBinding(Foo.class, fooAdapter); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FooModule extends AbstractModule { | |
@Override | |
protected void configure() { | |
bind(Foo.class).to(FooMock.class).asEagerSingleton(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment