use of com.squarespace.jersey2.guice.JerseyGuiceModule in project API by ca-cwds.
the class JerseyGuiceRule method before.
@Override
protected void before() throws Throwable {
Injector baseInjector = Guice.createInjector(Stage.PRODUCTION, new ServletModule());
JerseyGuiceUtils.install(new ServiceLocatorGenerator() {
@Override
public ServiceLocator create(String name, ServiceLocator parent) {
if (!name.startsWith("__HK2_Generated_")) {
return null;
}
return baseInjector.createChildInjector(new JerseyGuiceModule(name)).getInstance(ServiceLocator.class);
}
});
}
Aggregations