servletContext.setAttribute(TUSCANY_RUNTIME_NAME, runtime);
servletContext.setAttribute(MODULE_COMPONENT_NAME, moduleContext);
}
public void contextDestroyed(ServletContextEvent servletContextEvent) {
moduleContext.publish(new ModuleStop(this));
moduleContext.stop();
SystemCompositeContext systemContext = runtime.getSystemContext();
systemContext.publish(new ModuleStop(this));
systemContext.stop();
runtime.stop();
servletContextEvent.getServletContext().removeAttribute(MODULE_COMPONENT_NAME);
servletContextEvent.getServletContext().removeAttribute(TUSCANY_RUNTIME_NAME);
}