fr.dyade.aaa.common.monitoring
Class FileMonitoringTimerTask

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

public class FileMonitoringTimerTask
extends MonitoringTimerTask

The FileMonitoringTimerTask class allows to periodically watch JMX attributes and store the corresponding values to a file in CSV format.


Field Summary
static java.lang.String DEFAULT_MONITORING_CONFIG_PATH
          Default value for the pathname of a configuration file for a csv file monitoring task in the server, value is fileMonitoring.props.
static long DEFAULT_MONITORING_CONFIG_PERIOD
          Default value for the scanning period for the csv file monitoring task in the server, value is 60000L (5 seconds).
static java.lang.String DEFAULT_MONITORING_RESULT_PATH
          Default value for the pathname of the results file for the monitoring task in the server, value is monitoringStats.csv.
static java.lang.String MONITORING_CONFIG_PATH_PROPERTY
          Name of property allowing to fix the pathname of a configuration file for a csv file monitoring task in the server.
static java.lang.String MONITORING_CONFIG_PERIOD_PROPERTY
          Name of property allowing to fix the scanning period for the csv file monitoring task in the server.
static java.lang.String MONITORING_RESULT_PATH_PROPERTY
          Name of property allowing to fix the pathname of the results file for the csv file monitoring task in the server.
(package private)  java.lang.StringBuffer strbuf
           
(package private)  java.io.FileWriter writer
           
 
Fields inherited from class fr.dyade.aaa.common.monitoring.MonitoringTimerTask
attlist, logger, period
 
Constructor Summary
FileMonitoringTimerTask(java.util.Timer timer, long period, java.util.Properties attlist, java.lang.String path)
          Initializes the FileMonitoringTimerTask 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 csv file monitoring task in the server.

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

See Also:
FileMonitoringTimerTask, Constant Field Values

DEFAULT_MONITORING_CONFIG_PERIOD

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

See Also:
FileMonitoringTimerTask, 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 csv file monitoring task in the server.

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

See Also:
FileMonitoringTimerTask, 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 csv file monitoring task in the server, value is fileMonitoring.props.

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

See Also:
FileMonitoringTimerTask, Constant Field Values

MONITORING_RESULT_PATH_PROPERTY

public static final java.lang.String MONITORING_RESULT_PATH_PROPERTY
Name of property allowing to fix the pathname of the results file for the csv file monitoring task in the server.

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

See Also:
FileMonitoringTimerTask, Constant Field Values

DEFAULT_MONITORING_RESULT_PATH

public static final java.lang.String DEFAULT_MONITORING_RESULT_PATH
Default value for the pathname of the results file for the monitoring task in the server, value is monitoringStats.csv.

See Also:
FileMonitoringTimerTask, Constant Field Values

writer

java.io.FileWriter writer

strbuf

java.lang.StringBuffer strbuf
Constructor Detail

FileMonitoringTimerTask

public FileMonitoringTimerTask(java.util.Timer timer,
                               long period,
                               java.util.Properties attlist,
                               java.lang.String path)
Initializes the FileMonitoringTimerTask 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.
path - Pathname of resulting CSV file.
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.