org.eclipse.jetty.monitor.triggers
Class AttrEventTrigger<TYPE extends Comparable<TYPE>>

java.lang.Object
  extended by org.eclipse.jetty.monitor.jmx.EventTrigger
      extended by org.eclipse.jetty.monitor.triggers.AttrEventTrigger<TYPE>
Direct Known Subclasses:
EqualToAttrEventTrigger, GreaterThanAttrEventTrigger, GreaterThanOrEqualToAttrEventTrigger, JavaMonitorTrigger, LessThanAttrEventTrigger, LessThanOrEqualToAttrEventTrigger, RangeAttrEventTrigger, RangeInclAttrEventTrigger

public class AttrEventTrigger<TYPE extends Comparable<TYPE>>
extends EventTrigger

AttrEventTrigger Event trigger that polls a value of an MXBean attribute and matches every invocation of this trigger. It can be used to send notifications of the value of an attribute of the MXBean being polled at a certain interval, or as a base class for the event triggers that match the value of an attribute of the MXBean being polled against some specified criteria.


Field Summary
protected  String _attributeName
           
protected  String _objectName
           
protected  Map<Long,EventState<TYPE>> _states
           
 
Constructor Summary
AttrEventTrigger(ObjectName nameObject, String attributeName)
          Construct event trigger and specify the MXBean attribute that will be polled by this event trigger.
AttrEventTrigger(String objectName, String attributeName)
          Construct event trigger and specify the MXBean attribute that will be polled by this event trigger.
 
Method Summary
protected  String getNameString()
          Returns the string representation of this event trigger in the format "[object_name:attribute_name]".
protected  boolean getSaveAll()
           
 EventState<TYPE> getState(long timestamp)
          Retrieve the event state associated with specified invocation of the event trigger match method.
protected  TYPE getValue(CompositeData compValue, String fieldName)
           
 boolean match(Comparable<TYPE> value)
          Verify if the event trigger conditions are in the appropriate state for an event to be triggered.
 boolean match(long timestamp)
          Verify if the event trigger conditions are in the appropriate state for an event to be triggered.
 String toString()
          Returns the string representation of this event trigger in the format "[object_name:attribute_name]".
 
Methods inherited from class org.eclipse.jetty.monitor.jmx.EventTrigger
getID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_objectName

protected final String _objectName

_attributeName

protected final String _attributeName

_states

protected Map<Long,EventState<TYPE extends Comparable<TYPE>>> _states
Constructor Detail

AttrEventTrigger

public AttrEventTrigger(String objectName,
                        String attributeName)
                 throws MalformedObjectNameException,
                        IllegalArgumentException
Construct event trigger and specify the MXBean attribute that will be polled by this event trigger.

Parameters:
objectName - object name of an MBean to be polled
attributeName - name of an MBean attribute to be polled
Throws:
MalformedObjectNameException
IllegalArgumentException

AttrEventTrigger

public AttrEventTrigger(ObjectName nameObject,
                        String attributeName)
                 throws IllegalArgumentException
Construct event trigger and specify the MXBean attribute that will be polled by this event trigger.

Parameters:
nameObject - object name of an MBean to be polled
attributeName - name of an MBean attribute to be polled
Throws:
IllegalArgumentException
Method Detail

match

public final boolean match(long timestamp)
                    throws Exception
Verify if the event trigger conditions are in the appropriate state for an event to be triggered. This event trigger uses the match(Comparable) method to compare the value of the MXBean attribute to the conditions specified by the subclasses.

Specified by:
match in class EventTrigger
Returns:
true to trigger an event
Throws:
Exception
See Also:
EventTrigger.match(long)

match

public boolean match(Comparable<TYPE> value)
Verify if the event trigger conditions are in the appropriate state for an event to be triggered. Allows subclasses to override the default behavior that matches every invocation of this trigger


getState

public final EventState<TYPE> getState(long timestamp)
Retrieve the event state associated with specified invocation of the event trigger match method.

Specified by:
getState in class EventTrigger
Parameters:
timestamp - time stamp associated with invocation
Returns:
event state or null if not found
See Also:
EventTrigger.getState(long)

toString

public String toString()
Returns the string representation of this event trigger in the format "[object_name:attribute_name]".

Overrides:
toString in class Object
Returns:
string representation of the event trigger
See Also:
Object.toString()

getNameString

protected String getNameString()
Returns the string representation of this event trigger in the format "[object_name:attribute_name]". Allows subclasses to override the name string used to identify this event trigger in the event state object as well as string representation of the subclasses.

Returns:
string representation of the event trigger

getSaveAll

protected boolean getSaveAll()

getValue

protected TYPE getValue(CompositeData compValue,
                        String fieldName)


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