Class MonitoringTimerTask

    • Field Detail

      • logger

        public static final Logger logger
      • timerPeriod

        protected long timerPeriod
        Time between two monitoring events
      • mbeanName

        public String mbeanName
        Name use to register/unregister MBean
    • Constructor Detail

      • MonitoringTimerTask

        public MonitoringTimerTask​(long period,
                                   Properties attlist)
        Creates a MonitoringTimerTask component.
        Parameters:
        period - Period value of the resulting task
        attlist - List of JMX attributes to periodically watch.
      • MonitoringTimerTask

        public MonitoringTimerTask()
        Creates a MonitoringTimerTask component.
    • Method Detail

      • getPeriod

        public long getPeriod()
        Returns the period value of this task, -1 if not set.
        Specified by:
        getPeriod in interface MonitoringTimerTaskMBean
        Returns:
        the period value of this task; -1 if not set.
      • init

        public abstract void init​(Timer timer,
                                  long period,
                                  Properties attlist,
                                  Properties taskProps)
        Initializes the MonitoringTimerTask component.
        Parameters:
        timer - The timer to use to schedule the resulting task.
        period - Period value of the resulting task
        attlist - List of JMX attributes to periodically watch.
        taskProps - The properties to initialize the task.
      • start

        protected final void start​(Timer timer)
        Starts the resulting task.
        Parameters:
        timer - Timer to use to schedule the resulting task.
      • initializeRecords

        protected abstract void initializeRecords()
        Initialize the record for the current collect time.
      • addRecord

        protected abstract void addRecord​(String mbean,
                                          String att,
                                          Object value)
        Records information about the specified attribute.
        Parameters:
        mbean - The name of the related mbean.
        att - The name of the related attribute.
        value - The value of the related attribute.
      • finalizeRecords

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

        public void run()
        When the task is waken up, collect the monitoring information required and saves it (see method run of fr.dyade.aaa.common.TimerTask class).
        Specified by:
        run in interface Runnable
        Specified by:
        run in class TimerTask
      • getMonitoredAttributes

        public String[] getMonitoredAttributes()
        Returns the comma separated list of all monitored attributes.
        Specified by:
        getMonitoredAttributes in interface MonitoringTimerTaskMBean
        Returns:
        the comma separated list of all monitored attributes.
      • addMonitoredAttributes

        public void addMonitoredAttributes​(String MBeanName,
                                           String attributes)
        Add the specified attributes to the list of monitored attributes. If the Mbean is already monitored, the specified list of attributes overrides the existing one.
        Specified by:
        addMonitoredAttributes in interface MonitoringTimerTaskMBean
        Parameters:
        MBeanName - the name of the MBean.
        attributes - the comma separated list of attributes to monitor.
      • delMonitoredAttributes

        public void delMonitoredAttributes​(String MBeanName)
        Removes all the attributes of the specified MBean in the list of monitored attributes.
        Specified by:
        delMonitoredAttributes in interface MonitoringTimerTaskMBean
        Parameters:
        MBeanName - the name of the MBean.