public abstract class MonitoringTimerTask extends TimerTask implements MonitoringTimerTaskMBean
MonitoringTimerTask
class allows to periodically watch JMX attributes
and store the corresponding values to various support.Modifier and Type | Field and Description |
---|---|
(package private) Properties |
attlist |
static org.objectweb.util.monolog.api.Logger |
logger |
String |
MBean_name
Name use to register/unregister MBean
|
protected long |
period
Time between two monitoring events
|
Constructor and Description |
---|
MonitoringTimerTask()
Initializes the
MonitoringTimerTask component. |
MonitoringTimerTask(long period,
Properties attlist)
Initializes the
MonitoringTimerTask component. |
Modifier and Type | Method and Description |
---|---|
void |
addMonitoredAttributes(String MBeanName,
String attributes)
Add the specified attributes to the list of monitored attributes.
|
protected abstract void |
addRecord(String mbean,
String att,
Object value)
Records information about the specified attribute.
|
void |
cancelTask()
Cancels this timer task.
|
void |
delMonitoredAttributes(String MBeanName)
Removes all the attributes of the specified MBean in the list of
monitored attributes.
|
protected abstract void |
finalizeRecords()
Finalize the record for the current time.
|
String[] |
getMonitoredAttributes()
Returns the comma separated list of all monitored attributes.
|
long |
getPeriod()
Returns the period value of this task, -1 if not set.
|
abstract void |
init(Timer timer,
long period,
Properties attlist,
Properties taskProps) |
protected abstract void |
initializeRecords()
Initialize the record for the current collect time.
|
void |
run()
When the task is waken up, collect the monitoring information required and saves it.
|
protected void |
start(Timer timer)
Starts the resulting task.
|
cancel, scheduledExecutionTime
protected long period
Properties attlist
public String MBean_name
public static org.objectweb.util.monolog.api.Logger logger
public MonitoringTimerTask(long period, Properties attlist)
MonitoringTimerTask
component.period
- Period value of the resulting taskattlist
- List of JMX attributes to periodically watch.public MonitoringTimerTask()
MonitoringTimerTask
component.period
- Period value of the resulting taskattlist
- List of JMX attributes to periodically watch.public long getPeriod()
getPeriod
in interface MonitoringTimerTaskMBean
public abstract void init(Timer timer, long period, Properties attlist, Properties taskProps)
protected final void start(Timer timer)
timer
- Timer to use to schedule the resulting task.protected abstract void initializeRecords()
protected abstract void addRecord(String mbean, String att, Object value)
mbean
- The name of the related mbean.att
- The name of the related attribute.value
- The value of the related attribute.protected abstract void finalizeRecords()
public void run()
public String[] getMonitoredAttributes()
getMonitoredAttributes
in interface MonitoringTimerTaskMBean
public void addMonitoredAttributes(String MBeanName, String attributes)
addMonitoredAttributes
in interface MonitoringTimerTaskMBean
MBeanName
- the name of the MBean.attributes
- the comma separated list of attributes to monitor.public void delMonitoredAttributes(String MBeanName)
delMonitoredAttributes
in interface MonitoringTimerTaskMBean
MBeanName
- the name of the MBean.public void cancelTask()
cancelTask
in interface MonitoringTimerTaskMBean
Copyright © 2020 ScalAgent D.T.. All rights reserved.