/** * Deregister the MBeans for the specified Engine and its nested * components. * * @param engine Engine for which to destroy MBeans * * @exception Exception if an exception is thrown during MBean destruction */ protected void destroyMBeans(Engine engine) throws Exception { // Deregister ourselves as a ContainerListener engine.removeContainerListener(this); // Deregister the MBeans for each child Host Container hosts[] = engine.findChildren(); for (int k = 0; k < hosts.length; k++) { destroyMBeans((Host) hosts[k]); } // Deregister the MBeans for the associated nested components Realm eRealm = engine.getRealm(); if (eRealm != null) { if (log.isDebugEnabled()) log.debug("Destroying MBean for Realm " + eRealm); //MBeanUtils.destroyMBean(eRealm); } // Deregister the MBean for the Engine itself if (log.isDebugEnabled()) { log.debug("Destroying MBean for Engine " + engine); } //MBeanUtils.destroyMBean(engine); }
void stop() { engine.removeContainerListener(this); // Container[] childrenContainers = engine.findChildren(); for (Container childContainer : childrenContainers) { if (childContainer instanceof Host) { Host host = (Host)childContainer; unregisterHost(host); } } // registration.cancel(); registration = null; }
@Test public void undeployHost() { TomcatEventHandler handler = this.createEventHandler(this.eventHandler, this.provider, this.factory); org.apache.catalina.Engine engine = mock(org.apache.catalina.Engine.class); ContainerEvent event = new ContainerEvent(engine, Container.REMOVE_CHILD_EVENT, null); handler.containerEvent(event); verify(engine).removeContainerListener(handler); }
/** * Deregister the MBeans for the specified Engine and its nested * components. * * @param engine Engine for which to destroy MBeans * * @exception Exception if an exception is thrown during MBean destruction */ protected void destroyMBeans(Engine engine) throws Exception { // Deregister ourselves as a ContainerListener engine.removeContainerListener(this); // Deregister the MBeans for each child Host Container hosts[] = engine.findChildren(); for (int k = 0; k < hosts.length; k++) { destroyMBeans((Host) hosts[k]); } // Deregister the MBeans for the associated nested components Realm eRealm = engine.getRealm(); if (eRealm != null) { if (log.isDebugEnabled()) log.debug("Destroying MBean for Realm " + eRealm); //MBeanUtils.destroyMBean(eRealm); } // Deregister the MBean for the Engine itself if (log.isDebugEnabled()) { log.debug("Destroying MBean for Engine " + engine); } MBeanUtils.destroyMBean(engine); }
/** * Deregister the MBeans for the specified Engine and its nested * components. * * @param engine Engine for which to destroy MBeans * * @exception Exception if an exception is thrown during MBean destruction */ protected void destroyMBeans(Engine engine) throws Exception { // Deregister ourselves as a ContainerListener engine.removeContainerListener(this); // Deregister the MBeans for each child Host Container hosts[] = engine.findChildren(); for (int k = 0; k < hosts.length; k++) { destroyMBeans((Host) hosts[k]); } // Deregister the MBeans for the associated nested components Realm eRealm = engine.getRealm(); if (eRealm != null) { if (log.isDebugEnabled()) log.debug("Destroying MBean for Realm " + eRealm); //MBeanUtils.destroyMBean(eRealm); } // Deregister the MBean for the Engine itself if (log.isDebugEnabled()) { log.debug("Destroying MBean for Engine " + engine); } MBeanUtils.destroyMBean(engine); }
/** * Deregister the MBeans for the specified Engine and its nested * components. * * @param engine Engine for which to destroy MBeans * * @exception Exception if an exception is thrown during MBean destruction */ protected void destroyMBeans(Engine engine) throws Exception { // Deregister ourselves as a ContainerListener engine.removeContainerListener(this); // Deregister the MBeans for each child Host Container hosts[] = engine.findChildren(); for (int k = 0; k < hosts.length; k++) { destroyMBeans((Host) hosts[k]); } // Deregister the MBeans for the associated nested components Realm eRealm = engine.getRealm(); if (eRealm != null) { if (log.isDebugEnabled()) log.debug("Destroying MBean for Realm " + eRealm); //MBeanUtils.destroyMBean(eRealm); } // Deregister the MBean for the Engine itself if (log.isDebugEnabled()) { log.debug("Destroying MBean for Engine " + engine); } MBeanUtils.destroyMBean(engine); }
Service service = (Service) source; Engine engine = (Engine) service.getContainer(); engine.removeContainerListener(this); ((Lifecycle) engine).removeLifecycleListener(this); for (Container host : engine.findChildren()) {
Service service = (Service) source; Engine engine = (Engine) service.getContainer(); engine.removeContainerListener(this); ((Lifecycle) engine).removeLifecycleListener(this); for (Container host : engine.findChildren()) {