/** * Creates a new {@link ServiceLocator} instance from static {@link ServiceLocatorFactory} and adds the provided parent * locator if the instance is not null. * * @param parentLocator parent locator, can be {@code null}. * @return new instance of injection manager. */ private static ServiceLocator createLocator(ServiceLocator parentLocator) { ServiceLocator result = factory.create(null, parentLocator, null, ServiceLocatorFactory.CreatePolicy.DESTROY); result.setNeutralContextClassLoader(false); ServiceLocatorUtilities.enablePerThreadScope(result); return result; }
/** * Creates a new {@link ServiceLocator} instance from static {@link ServiceLocatorFactory} and adds the provided parent * locator if the instance is not null. * * @param parentLocator parent locator, can be {@code null}. * @return new instance of injection manager. */ private static ServiceLocator createLocator(ServiceLocator parentLocator) { ServiceLocator result = factory.create(null, parentLocator, null, ServiceLocatorFactory.CreatePolicy.DESTROY); result.setNeutralContextClassLoader(false); ServiceLocatorUtilities.enablePerThreadScope(result); return result; }
@Override public void setNeutralContextClassLoader(boolean b) { delegate.setNeutralContextClassLoader(b); }
/** * Creates a new {@link ServiceLocator} instance from static {@link ServiceLocatorFactory} and adds the provided parent * locator if the instance is not null. * * @param parentLocator parent locator, can be {@code null}. * @return new instance of injection manager. */ private static ServiceLocator createLocator(ServiceLocator parentLocator) { ServiceLocator result = factory.create(null, parentLocator, null, ServiceLocatorFactory.CreatePolicy.DESTROY); result.setNeutralContextClassLoader(false); ServiceLocatorUtilities.enablePerThreadScope(result); return result; }
/** * Creates a new {@link ServiceLocator} instance from static {@link ServiceLocatorFactory} and adds the provided parent * locator if the instance is not null. * * @param parentLocator parent locator, can be {@code null}. * @return new instance of injection manager. */ private static ServiceLocator createLocator(ServiceLocator parentLocator) { ServiceLocator result = factory.create(null, parentLocator, null, ServiceLocatorFactory.CreatePolicy.DESTROY); result.setNeutralContextClassLoader(false); ServiceLocatorUtilities.enablePerThreadScope(result); 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; }
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; }