Search in sources :

Example 1 with MonitoringLevel

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);
    }
}
Also used : ModuleMonitoringLevels(com.sun.enterprise.config.serverbeans.ModuleMonitoringLevels) Config(com.sun.enterprise.config.serverbeans.Config) String(java.lang.String) MonitoringLevel(com.sun.enterprise.admin.monitor.registry.MonitoringLevel)

Aggregations

MonitoringLevel (com.sun.enterprise.admin.monitor.registry.MonitoringLevel)1 Config (com.sun.enterprise.config.serverbeans.Config)1 ModuleMonitoringLevels (com.sun.enterprise.config.serverbeans.ModuleMonitoringLevels)1 String (java.lang.String)1