use of ru.vyarus.dropwizard.guice.module.jersey.hk2.GuiceBindingsModule in project dropwizard-guicey by xvik.
the class Jersey2Module method configure.
@Override
protected void configure() {
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.option(UseHkBridge));
bind(ServiceLocator.class).toProvider(component);
environment.jersey().register(component);
if (guiceServletSupport) {
install(new GuiceWebModule(environment, types));
}
}
Aggregations