Resets the stats of all web modules.
_logger = LogDomains.getLogger(LogDomains.WEB_LOGGER);
MonitoringRegistry monitoringRegistry =
serverContext.getMonitoringRegistry();
Engine[] engines = embedded.getEngines();
for(int h=0; h<engines.length; h++) {
Container engine = (Container) engines[h];
Container[] hosts = engine.findChildren();
for(int i=0; i<hosts.length; i++) {
Container nextHost = hosts[i];
Container [] webModules = nextHost.findChildren();
for (int j=0; j<webModules.length; j++) {
WebModule webModule = (WebModule) webModules[j];
if (!webModule.hasWebXml()) {
// Ad-hoc module
continue;
}
/*
* Standalone webmodules are loaded with the application
* name set to the string "null"
*/
String j2eeApp = webModule.getJ2EEApplication();
if ("null".equalsIgnoreCase(j2eeApp)) {
j2eeApp = null;
}
WebModuleStats stats =
monitoringRegistry.getWebModuleStats(
j2eeApp,
webModule.getModuleName(),
webModule.getPath(),
nextHost.getName());
if (stats != null) {
try {
stats.reset();
} catch (Throwable th) {
_logger.log(Level.SEVERE,
"Error resetting WebModuleStats", th);
}
}
}
}
}