private MonitoringLevel getMonitoringLevel(final MethodInvocation invocation) { final MonitoredAttribute att = getAttribute(invocation); if (att == null) { return MonitoringLevel.INFO; } else { return MonitoringLevel.toLevel(att.getLevelStr()); } }
/** * @@org.springframework.jmx.export.metadata.ManagedOperation * (description="Set the monitoring level for this process group" * ) * @@org.springframework.jmx.export.metadata.ManagedOperationParameter (index=0, * name="levelString", * description= * "new MonitoringLevel to apply" * ) */ @ManagedOperation(description = "Set the monitoring level for this process group") @ManagedOperationParameters({@ManagedOperationParameter(name = "levelString", description = "new MonitoringLevel to apply")}) public void updateMonitoringLevel(final String levelString) { if (!MonitoringLevel.isValidLevelStr(levelString)) { throw new IllegalArgumentException("levelString must match an existing MonitoringLevel"); } _monitoringLevel = MonitoringLevel.toLevel(levelString); log.info(this.toString() + " -> " + levelString); }
throw new IllegalArgumentException("levelStr must match an existing MonitoringLevel"); MonitoringLevel level = MonitoringLevel.toLevel(levelStr); MonitoringEngine.getInstance().addMonitorLevel(nameStartsWith, level); if (log.isInfoEnabled()) {
MonitorProcessor processor = processors[i]; if (name.equalsIgnoreCase(processor.getName())) { MonitoringEngine.getInstance().addProcessorLevel(name, MonitoringLevel.toLevel(levelStr)); log.info("Changed Processor level: " + name + " -> " + levelStr); return;// two processors should not have same name