use of ru.vyarus.dropwizard.guice.injector.lookup.InjectorProvider in project dropwizard-guicey by xvik.
the class Jersey2Module method configure.
@Override
protected void configure() {
checkHkFirstMode();
final EnumSet<DispatcherType> types = context.option(GuiceFilterRegistration);
final boolean guiceServletSupport = !types.isEmpty();
// injector not available at this point, so using provider
final InjectorProvider provider = new InjectorProvider(application);
install(new GuiceBindingsModule(provider, guiceServletSupport));
final GuiceFeature component = new GuiceFeature(provider, context.stat(), context.lifecycle(), context.option(UseHkBridge));
bind(InjectionManager.class).toProvider(component);
// avoid registration when called within guice report
if (currentStage() != Stage.TOOL) {
environment.jersey().register(component);
}
if (guiceServletSupport) {
install(new GuiceWebModule(environment, types));
}
}
Aggregations