Map modules = mc.getModules();
for (Iterator iter = modules.keySet().iterator(); iter.hasNext();) {
String moduleID = (String) iter.next();
try {
ModuleLifeCycle mlc = (ModuleLifeCycle)modules.get(moduleID);
mlc.destroy();
} catch (Exception e) {
// log error and continue with with next module
log.error("Problem while destroying module::" + moduleID, e);
}
}