fr.dyade.aaa.common.monitoring
Class LogMonitoringTimerTask

java.lang.Object
  extended by java.util.TimerTask
      extended by fr.dyade.aaa.common.monitoring.MonitoringTimerTask
          extended by fr.dyade.aaa.common.monitoring.LogMonitoringTimerTask
All Implemented Interfaces:
MonitoringTimerTaskMBean, java.lang.Runnable

public class LogMonitoringTimerTask
extends MonitoringTimerTask

The FileMonitoringTimerTask class allows to periodically watch JMX attributes and write the corresponding values in the logging mechanism.


Field Summary
static java.lang.String DEFAULT_MONITORING_CONFIG_PATH
          Default value for the pathname of a configuration file for a log monitoring task in the server, value is logMonitoring.props.
static long DEFAULT_MONITORING_CONFIG_PERIOD
          Default value for the scanning period for the log monitoring task in the server, value is 60000L (5 seconds).
static int DEFAULT_MONITORING_RESULT_LEVEL
          Default value for the logging level of the results for the log monitoring task in the server, value is WARN.
static java.lang.String DEFAULT_MONITORING_RESULT_LOGGER
          Default value for the logger name of the results for the log monitoring task in the server, value is fr.dyade.aaa.agent.Monitoring.
static java.lang.String DEFAULT_MONITORING_RESULT_MESSAGE
          Default value for the logging message of the results for the log monitoring task in the server, value is "JMX Monitoring ".
(package private)  int level
          Level of monitoring messages.
static java.lang.String MONITORING_CONFIG_PATH_PROPERTY
          Name of property allowing to fix the pathname of a configuration file for a log monitoring task in the server.
static java.lang.String MONITORING_CONFIG_PERIOD_PROPERTY
          Name of property allowing to fix the scanning period for the log monitoring task in the server.
static java.lang.String MONITORING_RESULT_LEVEL_PROPERTY
          Name of property allowing to fix the logging level of the results for the log monitoring task in the server.
static java.lang.String MONITORING_RESULT_LOGGER_PROPERTY
          Name of property allowing to fix the logger name of the results for the log monitoring task in the server.
static java.lang.String MONITORING_RESULT_MESSAGE_PROPERTY
          Name of property allowing to set the logging message of the results for the log monitoring task in the server.
(package private)  org.objectweb.util.monolog.api.Logger monitoringLogger
          Logger to write results.
(package private)  java.lang.String msg
          Message to log.
(package private)  java.lang.StringBuffer strbuf
           
 
Fields inherited from class fr.dyade.aaa.common.monitoring.MonitoringTimerTask
attlist, logger, period
 
Constructor Summary
LogMonitoringTimerTask(java.util.Timer timer, long period, java.util.Properties attlist, org.objectweb.util.monolog.api.Logger logger, java.lang.String msg, int level)
          Initializes the LogMonitoringTimerTask component.
 
Method Summary
protected  void addRecord(javax.management.ObjectName mbean, java.lang.String att, java.lang.Object value)
          Records information about the specified attribute.
protected  void finalizeRecords()
          Finalize the record for the current time.
protected  void initializeRecords()
          Initialize the record for the current collect time.
 
Methods inherited from class fr.dyade.aaa.common.monitoring.MonitoringTimerTask
addMonitoredAttributes, cancelTask, delMonitoredAttributes, getMonitoredAttributes, getPeriod, run, start
 
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MONITORING_CONFIG_PERIOD_PROPERTY

public static final java.lang.String MONITORING_CONFIG_PERIOD_PROPERTY
Name of property allowing to fix the scanning period for the log monitoring task in the server.

This property can be fixed either from java launching command, or in a3servers.xml configuration file.

See Also:
LogMonitoringTimerTask, Constant Field Values

DEFAULT_MONITORING_CONFIG_PERIOD

public static final long DEFAULT_MONITORING_CONFIG_PERIOD
Default value for the scanning period for the log monitoring task in the server, value is 60000L (5 seconds).

See Also:
MonitoringTimerTask, Constant Field Values

MONITORING_CONFIG_PATH_PROPERTY

public static final java.lang.String MONITORING_CONFIG_PATH_PROPERTY
Name of property allowing to fix the pathname of a configuration file for a log monitoring task in the server.

This property can be fixed either from java launching command, or in a3servers.xml configuration file.

See Also:
LogMonitoringTimerTask, Constant Field Values

DEFAULT_MONITORING_CONFIG_PATH

public static final java.lang.String DEFAULT_MONITORING_CONFIG_PATH
Default value for the pathname of a configuration file for a log monitoring task in the server, value is logMonitoring.props.

If the file does not exist the timer task is not launched.

See Also:
LogMonitoringTimerTask, Constant Field Values

MONITORING_RESULT_LOGGER_PROPERTY

public static final java.lang.String MONITORING_RESULT_LOGGER_PROPERTY
Name of property allowing to fix the logger name of the results for the log monitoring task in the server.

This property can be fixed either from java launching command, or in a3servers.xml configuration file.

See Also:
LogMonitoringTimerTask, Constant Field Values

DEFAULT_MONITORING_RESULT_LOGGER

public static final java.lang.String DEFAULT_MONITORING_RESULT_LOGGER
Default value for the logger name of the results for the log monitoring task in the server, value is fr.dyade.aaa.agent.Monitoring.

See Also:
LogMonitoringTimerTask, Constant Field Values

MONITORING_RESULT_LEVEL_PROPERTY

public static final java.lang.String MONITORING_RESULT_LEVEL_PROPERTY
Name of property allowing to fix the logging level of the results for the log monitoring task in the server.

This property can be fixed either from java launching command, or in a3servers.xml configuration file.

See Also:
LogMonitoringTimerTask, Constant Field Values

DEFAULT_MONITORING_RESULT_LEVEL

public static final int DEFAULT_MONITORING_RESULT_LEVEL
Default value for the logging level of the results for the log monitoring task in the server, value is WARN.

See Also:
LogMonitoringTimerTask

MONITORING_RESULT_MESSAGE_PROPERTY

public static final java.lang.String MONITORING_RESULT_MESSAGE_PROPERTY
Name of property allowing to set the logging message of the results for the log monitoring task in the server.

This property can be fixed either from java launching command, or in a3servers.xml configuration file.

See Also:
LogMonitoringTimerTask, Constant Field Values

DEFAULT_MONITORING_RESULT_MESSAGE

public static final java.lang.String DEFAULT_MONITORING_RESULT_MESSAGE
Default value for the logging message of the results for the log monitoring task in the server, value is "JMX Monitoring ".

See Also:
LogMonitoringTimerTask, Constant Field Values

monitoringLogger

org.objectweb.util.monolog.api.Logger monitoringLogger
Logger to write results.


msg

java.lang.String msg
Message to log.


level

int level
Level of monitoring messages.


strbuf

java.lang.StringBuffer strbuf
Constructor Detail

LogMonitoringTimerTask

public LogMonitoringTimerTask(java.util.Timer timer,
                              long period,
                              java.util.Properties attlist,
                              org.objectweb.util.monolog.api.Logger logger,
                              java.lang.String msg,
                              int level)
Initializes the LogMonitoringTimerTask component.

Parameters:
timer - Timer to use to schedule the resulting task.
period - Period value of the resulting task
attlist - List of JMX attributes to periodically watch.
logger - Logger to write results.
msg - Message to log.
level - Level of monitoring messages.
Method Detail

initializeRecords

protected void initializeRecords()
Initialize the record for the current collect time. For the FileMonitoringTimer, it consists to initialize a StringBuffer to collect informations about all attributes.

Specified by:
initializeRecords in class MonitoringTimerTask
See Also:
MonitoringTimerTask.initializeRecords()

addRecord

protected void addRecord(javax.management.ObjectName mbean,
                         java.lang.String att,
                         java.lang.Object value)
Records information about the specified attribute.

Specified by:
addRecord in class MonitoringTimerTask
Parameters:
mbean - The name of the related mbean.
att - The name of the related attribute.
value - The value of the related attribute.
See Also:
MonitoringTimerTask.addRecord(javax.management.ObjectName, java.lang.String, java.lang.Object)

finalizeRecords

protected void finalizeRecords()
Finalize the record for the current time.

Specified by:
finalizeRecords in class MonitoringTimerTask
See Also:
MonitoringTimerTask.finalizeRecords()


Copyright © 2010 ScalAgent D.T.. All Rights Reserved.