protected void destroyTree(ComponentCore child) { try { childrenLock.writeLock().lock(); child.childrenLock.writeLock().lock(); for (ComponentCore grandchild : child.children) { child.destroyTree(grandchild); } child.getComponent().tearDown(); doDestroy(child); } finally { child.childrenLock.writeLock().unlock(); childrenLock.writeLock().unlock(); } }
@Override public void handle(Stopped event) { logger().debug("Got Stopped event from {}", event.component); activeSet.remove(event.component); logger().debug("Active set has {} members", activeSet.size()); if (activeSet.isEmpty() && (state == Component.State.STOPPING)) { logger().debug("Stopped!"); state = Component.State.PASSIVE; component.tearDown(); if (parent != null) { ((PortCore<ControlPort>) parent.getControl()).doTrigger(new Stopped(component.getComponentCore()), wid, component.getComponentCore()); } else { synchronized (component.getComponentCore()) { component.getComponentCore().notifyAll(); } } } }
@Override public void handle(Killed event) { logger().debug("Got Killed event from {}", event.component); activeSet.remove(event.component); doDestroy(event.component); logger().debug("Active set has {} members", activeSet.size()); if (activeSet.isEmpty() && (state == Component.State.STOPPING)) { logger().debug("Stopped!"); state = Component.State.PASSIVE; component.tearDown(); if (parent != null) { ((PortCore<ControlPort>) parent.getControl()).doTrigger(new Killed(component.getComponentCore()), wid, component.getComponentCore()); } else { synchronized (component.getComponentCore()) { component.getComponentCore().notifyAll(); } } } }
logger().debug("Stopped!"); state = Component.State.PASSIVE; component.tearDown(); if (parent != null) { ((PortCore<ControlPort>) parent.getControl()).doTrigger(new Stopped(component.getComponentCore()), wid, component.getComponentCore());
state = Component.State.PASSIVE; component.tearDown(); if (parent != null) { ((PortCore<ControlPort>) parent.getControl()).doTrigger(new Killed(component.getComponentCore()), wid, component.getComponentCore());