javax.management.monitor
Interface MonitorMBean

All Known Subinterfaces:
CounterMonitorMBean (src) , GaugeMonitorMBean (src) , StringMonitorMBean (src)
All Known Implementing Classes:
CounterMonitor (src) , GaugeMonitor (src) , Monitor (src) , StringMonitor (src)

public interface MonitorMBean

The monitor service MBean interface.


Method Summary
 void addObservedObject(ObjectName (src)  object)
          Add the object name of the MBean monitored.
 boolean containsObservedObject(ObjectName (src)  object)
          Checks whether the object name is monitored.
 long getGranularityPeriod()
          Retrieves the granularity period in milliseconds.
 java.lang.String getObservedAttribute()
          Retrieves the name of the attribute monitored.
 ObjectName (src) getObservedObject()
          Deprecated. use getObservedObjects()
 ObjectName (src) [] getObservedObjects()
          Retrieves the object names of the MBeans monitored.
 boolean isActive()
          Tests whether this monitoring service is active.
 void removeObservedObject(ObjectName (src)  object)
          Remove the object name of the MBean monitored.
 void setGranularityPeriod(long period)
          Sets the granularity period in milliseconds.
 void setObservedAttribute(java.lang.String attribute)
          Sets the name of the attribute monitored.
 void setObservedObject(ObjectName (src)  object)
          Deprecated. use addObservedObject(ObjectName)
 void start()
          Starts the monitor.
 void stop()
          Stops the monitor.
 

Method Detail

start

public void start()
Starts the monitor.


stop

public void stop()
Stops the monitor.


addObservedObject

public void addObservedObject(ObjectName (src)  object)
                       throws java.lang.IllegalArgumentException
Add the object name of the MBean monitored.

Parameters:
object - the object name.
Throws:
java.lang.IllegalArgumentException

removeObservedObject

public void removeObservedObject(ObjectName (src)  object)
Remove the object name of the MBean monitored.

Parameters:
object - the object name.

containsObservedObject

public boolean containsObservedObject(ObjectName (src)  object)
Checks whether the object name is monitored.

Parameters:
object - the object name.
Returns:
true when it is monitored.

getObservedObjects

public ObjectName (src) [] getObservedObjects()
Retrieves the object names of the MBeans monitored.

Returns:
the object names.

getObservedObject

public ObjectName (src)  getObservedObject()
Deprecated. use getObservedObjects()

Retrieves the object name of the MBean monitored.

Returns:
the object name.

setObservedObject

public void setObservedObject(ObjectName (src)  object)
Deprecated. use addObservedObject(ObjectName)

Sets the object name of the MBean monitored.

The default value is null.

Parameters:
object - the object name.

getObservedAttribute

public java.lang.String getObservedAttribute()
Retrieves the name of the attribute monitored.

Returns:
the attribute monitored.

setObservedAttribute

public void setObservedAttribute(java.lang.String attribute)
Sets the name of the attribute monitored.

The default value is null.

Parameters:
attribute - the attribute monitored.
Throws:
java.lang.IllegalArgumentException - when the period is not positive.

getGranularityPeriod

public long getGranularityPeriod()
Retrieves the granularity period in milliseconds.

The monitoring takes place once per granularity period.

Returns:
the granularity period.

setGranularityPeriod

public void setGranularityPeriod(long period)
                          throws java.lang.IllegalArgumentException
Sets the granularity period in milliseconds.

The monitoring takes place once per granularity period.

The default value is 10 seconds.

Parameters:
period - the granularity period.
Throws:
java.lang.IllegalArgumentException - when the period is not positive.

isActive

public boolean isActive()
Tests whether this monitoring service is active.

Returns:
true when the service is active, false otherwise.