public void removeDeploymentListener(final DeploymentListener deploymentListener) { final ReentrantLock l = lock; l.lock(); try { // the wrapping is done here to get the correct equals/hashcode methods SystemInstance.get().removeObserver(new DeploymentListenerObserver(deploymentListener)); } finally { l.unlock(); } }
public void removeDeploymentListener(final DeploymentListener deploymentListener) { final ReentrantLock l = lock; l.lock(); try { // the wrapping is done here to get the correct equals/hashcode methods SystemInstance.get().removeObserver(new DeploymentListenerObserver(deploymentListener)); } finally { l.unlock(); } }
public void destroy(final @Observes ContainerSystemPreDestroy destroy) throws Exception { SystemInstance.get().removeObserver(this); }
private void reset() { if (!configuration.isSkip()) { SystemInstance.get().removeObserver(this); } }
public void destroy(final @Observes ContainerSystemPreDestroy destroy) throws Exception { SystemInstance.get().removeObserver(this); }
public void destroy(final @Observes ContainerSystemPreDestroy destroy) throws Exception { SystemInstance.get().removeObserver(this); }
@PreDestroy public void preDestroy() { active = false; SystemInstance.get().removeObserver(this); SystemInstance.get().removeComponent(MetricsService.class); }
public void destroy(final @Observes ContainerSystemPreDestroy destroy) throws Exception { SystemInstance.get().removeObserver(this); }
public void destroy(final @Observes ContainerSystemPreDestroy destroy) throws Exception { SystemInstance.get().removeObserver(this); }
public void destroy(final @Observes AssemblerDestroyed destroy) throws Exception { SystemInstance.get().removeObserver(this); }
@Override public void stop() throws ServiceException { if (assembler != null) { SystemInstance.get().removeObserver(this); for (final AppInfo appInfo : new ArrayList<AppInfo>(deployedApplications)) { undeploy(new AssemblerBeforeApplicationDestroyed(appInfo, null)); } } for (final DeployedService service : services) { undeployRestObject(service.address); } }
public void destroy(final @Observes ContainerSystemPreDestroy destroy) throws Exception { if (chatManager != null) { connection.disconnect(); chatManager = null; } SystemInstance.get().removeObserver(this); }
public void destroy(@Observes final AssemblerDestroyed ignored) { final SystemInstance systemInstance = SystemInstance.get(); final Bus bus = getBus(); if ("true".equalsIgnoreCase(systemInstance.getProperty("openejb.cxf.jmx", "true"))) { final InstrumentationManager mgr = bus.getExtension(InstrumentationManager.class); if (InstrumentationManagerImpl.class.isInstance(mgr)) { mgr.shutdown(); } } systemInstance.removeObserver(this); }
public void switchContextClass(@Observes final LifecycleEvent le) { for (final Service service : TomcatHelper.getServer().findServices()) { final Container container = service.getContainer(); if (!Engine.class.isInstance(container)) { continue; } for (final Container engineChild : Engine.class.cast(container).findChildren()) { if (!StandardHost.class.isInstance(engineChild)) { LOGGER.warning(ContainerCodes.TELEMETRY_NOT_STANDARDHOST, "{0} is not a StandardHost so can't customize the context class", engineChild); continue; } final String contextClass = StandardHost.class.cast(engineChild).getContextClass(); if (!StandardContext.class.getName().equals(contextClass) && !contextClass.startsWith("com.tomitribe.tribestream.")) { LOGGER.warning(ContainerCodes.TELEMETRY_NOT_USING_STANDARDHOST, "{0} is not using StandardContext so ignoring customization of the context class", engineChild); } StandardHost.class.cast(engineChild).setContextClass(TribestreamStandardContext.class.getName()); } } SystemInstance.get().removeObserver(this); // we don't need to listen LifecycleEvent anymore } }
public void dump(@Observes final Object e) { if (!active) { SystemInstance.get().removeObserver(this); } if (ObserverAdded.class.isInstance(e)) { final ObserverAdded observerAdded = ObserverAdded.class.cast(e); if (observerAdded.getObserver() == this) { return; } LOGGER.info(ContainerCodes.DUMPER_OBSERVER_ADDED, "OBSERVER: " + e + "\n" + findObservers(observerAdded.getObserver())); } else if (ObserverRemoved.class.isInstance(e)) { LOGGER.info(ContainerCodes.DUMPER_OBSERVER_REMOVED, "OBSERVER: " + e); } else { LOGGER.info(ContainerCodes.DUMPER_EVENT, "EVENT: " + e); } }
public ServerType() { SystemInstance.get().setProperty("com.tomitribe.tribestream.serverType", guessServerType()); SystemInstance.get().removeObserver(this); }
@Override public void stop() throws ServiceException { if (assembler != null) { SystemInstance.get().removeObserver(this); for (final AppInfo appInfo : new ArrayList<AppInfo>(deployedApplications.keySet())) { undeploy(new AssemblerBeforeApplicationDestroyed(appInfo, null)); } assembler = null; if (SystemInstance.get().getComponent(WsService.class) == this) { SystemInstance.get().removeComponent(WsService.class); } } }
@Override public void stop() throws ServiceException { if (assembler != null) { SystemInstance.get().removeObserver(this); for (final AppInfo appInfo : new ArrayList<AppInfo>(deployedApplications.keySet())) { undeploy(new AssemblerBeforeApplicationDestroyed(appInfo, null)); } assembler = null; if (SystemInstance.get().getComponent(WsService.class) == this) { SystemInstance.get().removeComponent(WsService.class); } } }
public void doSetup(@Observes final ObserverAdded ignored) { SystemInstance.get().removeObserver(this);