@Override public void shutdown() { if (factory.find(getServiceLocator().getName()) != null) { factory.destroy(getServiceLocator().getName()); } else { getServiceLocator().shutdown(); } }
@Override public void shutdown() { if (factory.find(getServiceLocator().getName()) != null) { factory.destroy(getServiceLocator().getName()); } else { getServiceLocator().shutdown(); } }
@Override public ServiceLocator find(String name) { return factory.find(name); }
@Override public ServiceLocator find(String name) { return factory.find(name); }
@Override public void initialize(NotDuplicateTargetName constraintAnnotation) { ServiceLocator locator = ServiceLocatorFactory.getInstance().find("default"); if (locator == null) return; ConfigBeansUtilities cbu = locator.getService(ConfigBeansUtilities.class); if (cbu == null) return; domain = cbu.getDomain(); }
/** * Shutdown {@link org.glassfish.hk2.api.ServiceLocator} - either via service locator factory (if possible) or directly by * calling shutdown method. * * @param locator locator to be shut down. */ public static void shutdownLocator(final ServiceLocator locator) { if (factory.find(locator.getName()) != null) { factory.destroy(locator.getName()); } else { locator.shutdown(); } } }
/** * Shutdown {@link org.glassfish.hk2.api.ServiceLocator} - either via service locator factory (if possible) or directly by * calling shutdown method. * * @param locator locator to be shut down. */ public static void shutdownLocator(final ServiceLocator locator) { if (factory.find(locator.getName()) != null) { factory.destroy(locator.getName()); } else { locator.shutdown(); } } }
/** * Shutdown {@link org.glassfish.hk2.api.ServiceLocator} - either via service locator factory (if possible) or directly by * calling shutdown method. * * @param locator locator to be shut down. */ public static void shutdownLocator(final ServiceLocator locator) { if (factory.find(locator.getName()) != null) { factory.destroy(locator.getName()); } else { locator.shutdown(); } } }
private void createServiceLocator() { String locatorName = APP_SERVICE_LOCATOR_PREFIX + name; ServiceLocatorFactory slf = ServiceLocatorFactory.getInstance(); if (slf.find(locatorName) != null) { slf.destroy(locatorName); } appServiceLocator = slf.create(locatorName); deploymentFailedListener = new DeploymentFailedListener(source); events.register(deploymentFailedListener); }
@Override public void shutdown() { if (factory.find(getServiceLocator().getName()) != null) { factory.destroy(getServiceLocator().getName()); } else { getServiceLocator().shutdown(); } }
@Override public void shutdown() { if (factory.find(getServiceLocator().getName()) != null) { factory.destroy(getServiceLocator().getName()); } else { getServiceLocator().shutdown(); } }
public static ServiceLocator getNewServiceLocator(String name) { ServiceLocator habitat = null; if (ServiceLocatorFactory.getInstance().find(name) == null) { ServiceLocator serviceLocator = ServiceLocatorFactory.getInstance() .create(name); DynamicConfigurationService dcs = serviceLocator.getService(DynamicConfigurationService.class); DynamicConfiguration config = dcs.createDynamicConfiguration(); config.commit(); habitat = ServiceLocatorFactory.getInstance().create(name); try { HK2Populator.populate(serviceLocator, new ClasspathDescriptorFileFinder(Utils.class.getClassLoader()), null); } catch (IOException e) { e.printStackTrace(); } } return (habitat != null) ? habitat : ServiceLocatorFactory.getInstance().create(name); }
public static ServiceLocator getNewServiceLocator(String name) { ServiceLocator habitat = null; if (ServiceLocatorFactory.getInstance().find(name) == null) { ServiceLocator serviceLocator = ServiceLocatorFactory.getInstance() .create(name); DynamicConfigurationService dcs = serviceLocator.getService(DynamicConfigurationService.class); DynamicConfiguration config = dcs.createDynamicConfiguration(); config.commit(); habitat = ServiceLocatorFactory.getInstance().create(name); try { HK2Populator.populate(serviceLocator, new ClasspathDescriptorFileFinder(Utils.class.getClassLoader()), null); } catch (IOException e) { e.printStackTrace(); } } return (habitat != null) ? habitat : ServiceLocatorFactory.getInstance().create(name); }