com.adventnet.services.monitor
Class TableMonitor

java.lang.Object
  |
  +--javax.management.NotificationBroadcasterSupport
        |
        +--javax.management.monitor.Monitor
              |
              +--com.adventnet.services.monitor.TableMonitor

public class TableMonitor
extends Monitor
implements TableMonitorMBean

This class defines a monitor MBean designed to observe the values of the table attributes.


Inner Class Summary
(package private)  class TableMonitor.TableMonitorThread
           
 
Fields inherited from class javax.management.monitor.Monitor
alreadyNotified, alreadyNotifieds, capacityIncrement, dbgTag, derivedGaugeTimeStamp, elementCount, isActive, logger, OBSERVED_ATTRIBUTE_ERROR_NOTIFIED, OBSERVED_ATTRIBUTE_TYPE_ERROR_NOTIFIED, OBSERVED_OBJECT_ERROR_NOTIFIED, RESET_FLAGS_ALREADY_NOTIFIED, RUNTIME_ERROR_NOTIFIED, sequenceNumber, server
 
Fields inherited from class javax.management.NotificationBroadcasterSupport
li
 
Constructor Summary
TableMonitor()
          Default constructor
 
Method Summary
 boolean checkImplementsModelListener()
          Determines whether ModelListener is implemented or not
 long getGranularityPeriod()
          This method gets the granularity period (in milliseconds).
 java.lang.Object getHighThreshold()
          Returns the high threshold value
 java.lang.Object getLowThreshold()
          Returns the low threshold value
 java.lang.String getObservedAttribute()
          This method gets the name of the attribute being observed.
 java.lang.String getObservedColumn()
          Returns the observed column
 java.lang.String getObservedColumnType()
          Returns the type of the observed column
 ObjectName getObservedObject()
          This method gets the object name of the object being observed.
 boolean isActive()
          This method tests whether the monitor MBean is active.
 ObjectName preRegister(MBeanServer server, ObjectName name)
          Overriding the preRegister() of MBeanRegistration interface to store the ObjectName locally.
 void setGranularityPeriod(long period)
          This method sets the granularity period (in milliseconds) .The default value is one second.
 void setObservedAttribute(java.lang.String attribute)
          This method sets the attribute being observed.
 void setObservedColumn(java.lang.String colName, java.lang.String typeName)
          Sets the column to be observed
 void setObservedObject(ObjectName object)
          This method sets the object name of the object being observed.
 void setThresholds(java.lang.Object low, java.lang.Object high)
          Sets the high and the low threshold value
 void start()
          Starts the Table monitoring Thread
 void stop()
          Stops the monitoring Thread
 
Methods inherited from class javax.management.monitor.Monitor
addObservedObject, containsObservedObject, getNotificationInfo, getObservedObject, getObservedObjects, indexOf, insertElementAt, insertSpecificElementAt, isFlagsReset, postDeregister, postRegister, preDeregister, removeElementAt, removeObservedObject, removeSpecificElementAt, resetAllAlreadyNotifiedFlags, resetAlreadyNotifiedFlag, sendNotification, setAlreadyNotifiedFlag, updateDeprecatedAlreadyNotifiedFlag
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, handleNotification, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableMonitor

public TableMonitor()
Default constructor
Method Detail

getGranularityPeriod

public long getGranularityPeriod()
This method gets the granularity period (in milliseconds).
Overrides:
getGranularityPeriod in class Monitor
Returns:
long value representing the value of the granularity period (in milliseconds).

setGranularityPeriod

public void setGranularityPeriod(long period)
                          throws java.lang.IllegalArgumentException
This method sets the granularity period (in milliseconds) .The default value is one second.
Overrides:
setGranularityPeriod in class Monitor
Parameters:
period - the granularity period value.
Throws:
java.lang.IllegalArgumentException - - The granularity period is less than or equal to zero.

getObservedAttribute

public java.lang.String getObservedAttribute()
This method gets the name of the attribute being observed.
Overrides:
getObservedAttribute in class Monitor
Returns:
String The name of the attribute that is being observed.

setObservedAttribute

public void setObservedAttribute(java.lang.String attribute)
This method sets the attribute being observed.
Overrides:
setObservedAttribute in class Monitor
Parameters:
attribute - The attribute to be observed.

getObservedObject

public ObjectName getObservedObject()
This method gets the object name of the object being observed.
Overrides:
getObservedObject in class Monitor
Returns:
The ObjectName of the object being observed.

setObservedObject

public void setObservedObject(ObjectName object)
This method sets the object name of the object being observed.
Overrides:
setObservedObject in class Monitor
Parameters:
object - The ObjectName of the object to be observed.

isActive

public boolean isActive()
This method tests whether the monitor MBean is active. A monitor MBean is marked active when the start method is called. It becomes inactive when the stop method is called.
Overrides:
isActive in class Monitor
Returns:
boolean value indicating whether the MBean is active or not.

setObservedColumn

public void setObservedColumn(java.lang.String colName,
                              java.lang.String typeName)
Sets the column to be observed
Specified by:
setObservedColumn in interface TableMonitorMBean
Parameters:
colName - The name of the column to be observed
typeName - The type of the column to be observed

getObservedColumn

public java.lang.String getObservedColumn()
Returns the observed column
Specified by:
getObservedColumn in interface TableMonitorMBean
Returns:
The name of the observed column

getObservedColumnType

public java.lang.String getObservedColumnType()
Returns the type of the observed column
Specified by:
getObservedColumnType in interface TableMonitorMBean
Parameters:
The - type of the observed column

preRegister

public ObjectName preRegister(MBeanServer server,
                              ObjectName name)
                       throws java.lang.Exception
Overriding the preRegister() of MBeanRegistration interface to store the ObjectName locally.
Overrides:
preRegister in class Monitor
Tags copied from class: Monitor
Parameters:
server - - The MBean server in which the monitor MBean will be registered.
name - - The object name of the monitor MBean.
Returns:
The name of the monitor MBean registered.
Throws:
- - java.lang.Exception.

start

public void start()
Starts the Table monitoring Thread
Overrides:
start in class Monitor

setThresholds

public void setThresholds(java.lang.Object low,
                          java.lang.Object high)
Sets the high and the low threshold value
Specified by:
setThresholds in interface TableMonitorMBean
Parameters:
low - The low threshold value
high - The high threshold value

getLowThreshold

public java.lang.Object getLowThreshold()
Returns the low threshold value
Specified by:
getLowThreshold in interface TableMonitorMBean

getHighThreshold

public java.lang.Object getHighThreshold()
Returns the high threshold value
Specified by:
getHighThreshold in interface TableMonitorMBean

stop

public void stop()
Stops the monitoring Thread
Overrides:
stop in class Monitor

checkImplementsModelListener

public boolean checkImplementsModelListener()
Determines whether ModelListener is implemented or not
Returns:
true if ModelListener is implemented and false otherwise