/** * Destroys scope * * @throws Exception on error */ public void destroy() throws Exception { log.debug("Destroy scope"); if (hasParent()) { parent.removeChildScope(this); } if (hasHandler()) { // Because handler can be null when there is a parent handler getHandler().stop(this); } // kill all child scopes for (IBasicScope child : children.keySet()) { removeChildScope(child); if (child instanceof Scope) { ((Scope) child).uninit(); } } }
/** Removes all the child scopes */ public void removeChildren() { log.trace("removeChildren of {}", name); for (IBasicScope child : children.keySet()) { removeChildScope(child); } }