@Override public void removeLifecycleListener(final LifecycleListener listener) { if (delegate instanceof Lifecycle) { ((Lifecycle) delegate).removeLifecycleListener(listener); } }
public void stop() throws JMException { Server server = this.findServer(); if (server != null) { if (!(server instanceof Lifecycle)) throw new IllegalStateException(); Lifecycle lifecycle = (Lifecycle) server; lifecycle.removeLifecycleListener(this); if (this.init.get() && this.start.compareAndSet(true, false)) { this.eventHandler.stop(new CatalinaServer(server, this.mbeanServer)); } if (this.init.compareAndSet(true, false)) { this.destroy(server); } } }
/** * Gracefully terminate the active use of the public methods of this * component. This method should be the last one called on a given * instance of this component. * * @exception LifecycleException if this component detects a fatal error * that needs to be reported */ public void stop() throws LifecycleException { // Validate and update our current component state if (!started) throw new LifecycleException (MESSAGES.valveNotStarted()); lifecycle.fireLifecycleEvent(STOP_EVENT, null); started = false; if (container instanceof Context) { ((Lifecycle) container).removeLifecycleListener(this); } }
private void removeListeners(Server server) { // Unregister ourself as a listener to child components for (Service service: server.findServices()) { Container engine = service.getContainer(); engine.removeContainerListener(this); ((Lifecycle) engine).removeLifecycleListener(this); for (Container host: engine.findChildren()) { host.removeContainerListener(this); for (Container context: host.findChildren()) { ((Lifecycle) context).removeLifecycleListener(this); } } } }
/** * Gracefully terminate the active use of the public methods of this * component. This method should be the last one called on a given * instance of this component. * * @exception LifecycleException if this component detects a fatal error * that needs to be reported */ public void stop() throws LifecycleException { // Validate and update our current component state if (!started) throw new LifecycleException (sm.getString("semaphoreValve.notStarted")); lifecycle.fireLifecycleEvent(STOP_EVENT, null); started = false; if (container instanceof Context) { ((Lifecycle) container).removeLifecycleListener(this); } }
if (container instanceof Lifecycle) ((Lifecycle) container).removeLifecycleListener(this);
lifecycle.removeLifecycleListener(listener);
if (container instanceof Host) { ((Lifecycle) child).removeLifecycleListener(this); ((Container) child).removePropertyChangeListener(this);
((Lifecycle) child).removeLifecycleListener(this); ((Container) child).removePropertyChangeListener(this);
((Lifecycle) context).removeLifecycleListener(this); mapper.removeContext(container.getName(), context.getName()); } else if (container instanceof Engine) {
((Lifecycle) context).removeLifecycleListener(this); mapper.removeContext(container.getName(), context.getName()); } else if (container instanceof Engine) {
Engine engine = (Engine) service.getContainer(); engine.removeContainerListener(this); ((Lifecycle) engine).removeLifecycleListener(this); for (Container host : engine.findChildren()) { host.removeContainerListener(this); mapper.removeHost(host.getName()); for (Container context : host.findChildren()) { ((Lifecycle) context).removeLifecycleListener(this); mapper.removeContext(host.getName(), context.getName());
Engine engine = (Engine) service.getContainer(); engine.removeContainerListener(this); ((Lifecycle) engine).removeLifecycleListener(this); for (Container host : engine.findChildren()) { host.removeContainerListener(this); mapper.removeHost(host.getName()); for (Container context : host.findChildren()) { ((Lifecycle) context).removeLifecycleListener(this); mapper.removeContext(host.getName(), context.getName());