javax.management.monitor
Interface MonitorMBean

All Known Subinterfaces:
CounterMonitorMBean, GaugeMonitorMBean, StringMonitorMBean, TableMonitorMBean
All Known Implementing Classes:
Monitor

public interface MonitorMBean

This interface exposes the remote management interface of monitor MBeans.


Method Summary
 void addObservedObject(ObjectName object)
          This method adds the specified object in the set of observed MBeans.
 boolean containsObservedObject(ObjectName object)
          This method tests whether the specified object is in the set of observed MBeans.
 long getGranularityPeriod()
          This method gets the granularity period (in milliseconds).
 java.lang.String getObservedAttribute()
          This method gets the name of the attribute being observed.
 ObjectName getObservedObject()
          Deprecated. Replaced by getObservedObjects()
 ObjectName[] getObservedObjects()
          This method returns an array containing the objects being observed.
 boolean isActive()
          This method tests whether the monitor MBean is active.
 void removeObservedObject(ObjectName object)
          This method removes the specified object from the set of observed MBeans.
 void setGranularityPeriod(long period)
          This method sets the granularity period (in milliseconds).
 void setObservedAttribute(java.lang.String attribute)
          This method sets the attribute being observed.
 void setObservedObject(ObjectName object)
          Deprecated. Replaced by addObservedObject(javax.management.ObjectName)
 void start()
          This method starts the monitor.
 void stop()
          This method stops the monitor.
 

Method Detail

addObservedObject

public void addObservedObject(ObjectName object)
                       throws java.lang.IllegalArgumentException
This method adds the specified object in the set of observed MBeans.
Parameters:
object - The object to observe.
Throws:
java.lang.IllegalArgumentException - the specified object is null.

removeObservedObject

public void removeObservedObject(ObjectName object)
This method removes the specified object from the set of observed MBeans.
Parameters:
object - The object to remove.

containsObservedObject

public boolean containsObservedObject(ObjectName object)
This method tests whether the specified object is in the set of observed MBeans.
Parameters:
object - The object to check.
Returns:
true if the specified object is in the set, false otherwise.

getObservedObjects

public ObjectName[] getObservedObjects()
This method returns an array containing the objects being observed.
Returns:
The objects being observed.

getGranularityPeriod

public long getGranularityPeriod()
This method gets the granularity period (in milliseconds).
Returns:
long value representing the value of the granularity period (in milliseconds).
See Also:
setGranularityPeriod(long)

setGranularityPeriod

public void setGranularityPeriod(long period)
                          throws java.lang.IllegalArgumentException
This method sets the granularity period (in milliseconds).
Parameters:
period - the granularity period value.
Throws:
java.lang.IllegalArgumentException - - The granularity period is less than or equal to zero.
See Also:
getGranularityPeriod()

getObservedAttribute

public java.lang.String getObservedAttribute()
This method gets the name of the attribute being observed.
Returns:
String The name of the attribute that is being observed.
See Also:
setObservedAttribute(java.lang.String)

setObservedAttribute

public void setObservedAttribute(java.lang.String attribute)
This method sets the attribute being observed.
Parameters:
attribute - The attribute to be observed.
See Also:
getObservedAttribute()

getObservedObject

public ObjectName getObservedObject()
Deprecated. Replaced by getObservedObjects()

This method gets the object name of the object being observed.
Returns:
The ObjectName of the object being observed.
See Also:
setObservedObject(javax.management.ObjectName)

setObservedObject

public void setObservedObject(ObjectName object)
Deprecated. Replaced by addObservedObject(javax.management.ObjectName)

This method sets the object name of the object being observed.
Parameters:
object - The ObjectName of the object to be observed.
See Also:
getObservedObject()

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.
Returns:
true if the monitor MBean is active, false otherwise.

start

public void start()
This method starts the monitor.

stop

public void stop()
This method stops the monitor.