/** Uninitialize scope and unregister from parent. */ public void uninit() { log.debug("Un-init scope"); for (IBasicScope child : children.keySet()) { if (child instanceof Scope) { ((Scope) child).uninit(); } } stop(); setEnabled(false); if (hasParent()) { if (parent.hasChildScope(name)) { parent.removeChildScope(this); } } }
/** * 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(); } } }