private static ServiceLocator _createLocator(final String name, final ServiceLocator parent, final Binder... binders) { // Passing null as service locator generator would force HK2 to find appropriate one. final ServiceLocator result = factory.create(name, parent, null, ServiceLocatorFactory.CreatePolicy.DESTROY); result.setNeutralContextClassLoader(false); ServiceLocatorUtilities.enablePerThreadScope(result); // HK2 Immediate Scope is commented out due to JERSEY-2979 and other issues // ServiceLocatorUtilities.enableImmediateScope(result); for (final Binder binder : binders) { bind(result, binder); } return result; }
private static ServiceLocator _createLocator(final String name, final ServiceLocator parent, final Binder... binders) { // Passing null as service locator generator would force HK2 to find appropriate one. final ServiceLocator result = factory.create(name, parent, null, ServiceLocatorFactory.CreatePolicy.DESTROY); result.setNeutralContextClassLoader(false); ServiceLocatorUtilities.enablePerThreadScope(result); // HK2 Immediate Scope is commented out due to JERSEY-2979 and other issues // ServiceLocatorUtilities.enableImmediateScope(result); for (final Binder binder : binders) { bind(result, binder); } return result; }
private static ServiceLocator _createLocator(final String name, final ServiceLocator parent, final Binder... binders) { // Passing null as service locator generator would force HK2 to find appropriate one. final ServiceLocator result = factory.create(name, parent, null, ServiceLocatorFactory.CreatePolicy.DESTROY); result.setNeutralContextClassLoader(false); ServiceLocatorUtilities.enablePerThreadScope(result); // HK2 Immediate Scope is commented out due to JERSEY-2979 and other issues // ServiceLocatorUtilities.enableImmediateScope(result); for (final Binder binder : binders) { bind(result, binder); } return result; }