use of com.sun.enterprise.admin.monitor.registry.MonitoringLevel in project Payara by payara.
the class GrizzlyConfig method initMonitoringLevel.
private void initMonitoringLevel() {
try {
Config cfg = services.getService(Config.class, ServerEnvironment.DEFAULT_INSTANCE_NAME);
// default per DTD
MonitoringLevel monitoringLevel = MonitoringLevel.OFF;
if (cfg.getMonitoringService() != null) {
ModuleMonitoringLevels levels = cfg.getMonitoringService().getModuleMonitoringLevels();
if (levels != null) {
monitoringLevel = MonitoringLevel.instance(levels.getHttpService());
}
}
if (MonitoringLevel.OFF.equals(monitoringLevel)) {
isMonitoringEnabled = false;
} else {
isMonitoringEnabled = true;
}
String methodToInvoke = isMonitoringEnabled ? "enableMonitoring" : "disableMonitoring";
invokeGrizzly(methodToInvoke);
} catch (Exception ex) {
String msg = rb.getString(LogFacade.INIT_MONITORING_EXCEPTION);
msg = MessageFormat.format(msg, Integer.valueOf(port));
logger.log(Level.WARNING, msg, ex);
}
}
Aggregations