org.eclipse.jetty.monitor.jmx
Class MonitorAction

java.lang.Object
  extended by org.eclipse.jetty.monitor.jmx.NotifierGroup
      extended by org.eclipse.jetty.monitor.jmx.MonitorAction
All Implemented Interfaces:
EventNotifier
Direct Known Subclasses:
JavaMonitorAction, SimpleAction

public abstract class MonitorAction
extends NotifierGroup

MonitorAction Abstract base class for all MonitorAction implementations. Receives notification when an associated EventTrigger is matched.


Field Summary
static int DEFAULT_POLL_INTERVAL
           
 
Constructor Summary
MonitorAction(EventTrigger trigger)
          Creates a new monitor action
MonitorAction(EventTrigger trigger, EventNotifier notifier)
          Creates a new monitor action
MonitorAction(EventTrigger trigger, EventNotifier notifier, long pollInterval)
          Creates a new monitor action
MonitorAction(EventTrigger trigger, EventNotifier notifier, long pollInterval, long pollDelay)
          Creates a new monitor action
 
Method Summary
 void doExecute(long timestamp)
          This method will be called when event trigger associated with this monitor action matches its conditions.
abstract  void execute(EventTrigger trigger, EventState<?> state, long timestamp)
          This method will be called to allow subclass to execute the desired action in response to the event.
 String getID()
          Retrieve the identification string of the monitor action
 long getPollDelay()
          Retrieve the poll delay
 long getPollInterval()
          Retrieve the poll interval
 EventTrigger getTrigger()
          Retrieve the event trigger of the monitor action
 
Methods inherited from class org.eclipse.jetty.monitor.jmx.NotifierGroup
addNotifier, addNotifiers, getNotifiers, notify, removeNotifier, removeNotifiers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_POLL_INTERVAL

public static final int DEFAULT_POLL_INTERVAL
See Also:
Constant Field Values
Constructor Detail

MonitorAction

public MonitorAction(EventTrigger trigger)
              throws InvalidParameterException
Creates a new monitor action

Parameters:
trigger - event trigger to be associated with this action
Throws:
InvalidParameterException

MonitorAction

public MonitorAction(EventTrigger trigger,
                     EventNotifier notifier)
              throws InvalidParameterException
Creates a new monitor action

Parameters:
trigger - event trigger to be associated with this action
notifier - event notifier to be associated with this action
Throws:
InvalidParameterException

MonitorAction

public MonitorAction(EventTrigger trigger,
                     EventNotifier notifier,
                     long pollInterval)
              throws InvalidParameterException
Creates a new monitor action

Parameters:
trigger - event trigger to be associated with this action
notifier - event notifier to be associated with this action
pollInterval - interval for polling of the JMX server
Throws:
InvalidParameterException

MonitorAction

public MonitorAction(EventTrigger trigger,
                     EventNotifier notifier,
                     long pollInterval,
                     long pollDelay)
              throws InvalidParameterException
Creates a new monitor action

Parameters:
trigger - event trigger to be associated with this action
notifier - event notifier to be associated with this action
pollInterval - interval for polling of the JMX server
pollDelay - delay before starting to poll the JMX server
Throws:
InvalidParameterException
Method Detail

getID

public final String getID()
Retrieve the identification string of the monitor action

Returns:
unique identification string

getTrigger

public EventTrigger getTrigger()
Retrieve the event trigger of the monitor action

Returns:
associated event trigger

getPollInterval

public long getPollInterval()
Retrieve the poll interval

Returns:
interval value (in milliseconds)

getPollDelay

public long getPollDelay()
Retrieve the poll delay

Returns:
delay value (in milliseconds)

doExecute

public final void doExecute(long timestamp)
This method will be called when event trigger associated with this monitor action matches its conditions.

Parameters:
timestamp - time stamp of the event

execute

public abstract void execute(EventTrigger trigger,
                             EventState<?> state,
                             long timestamp)
This method will be called to allow subclass to execute the desired action in response to the event.

Parameters:
trigger - event trigger associated with this monitor action
state - event state associated with current invocation of event trigger
timestamp - time stamp of the current invocation of event trigger


Copyright © 1995-2012 Mort Bay Consulting. All Rights Reserved.