javax.management.monitor
Interface MonitorMBean

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

public interface MonitorMBean

The monitor service MBean interface.

Version:
$Revision: 57200 $
Author:
Adrian Brock

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

Method Detail

start

void start()
Starts the monitor.


stop

void stop()
Stops the monitor.


addObservedObject

void addObservedObject(ObjectName object)
                       throws IllegalArgumentException
Add the object name of the MBean monitored.

Parameters:
object - the object name.
Throws:
IllegalArgumentException

removeObservedObject

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

Parameters:
object - the object name.

containsObservedObject

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

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

getObservedObjects

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

Returns:
the object names.

getObservedObject

ObjectName getObservedObject()
Deprecated. use getObservedObjects()

Retrieves the object name of the MBean monitored.

Returns:
the object name.

setObservedObject

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

Sets the object name of the MBean monitored.

The default value is null.

Parameters:
object - the object name.

getObservedAttribute

String getObservedAttribute()
Retrieves the name of the attribute monitored.

Returns:
the attribute monitored.

setObservedAttribute

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

The default value is null.

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

getGranularityPeriod

long getGranularityPeriod()
Retrieves the granularity period in milliseconds.

The monitoring takes place once per granularity period.

Returns:
the granularity period.

setGranularityPeriod

void setGranularityPeriod(long period)
                          throws 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:
IllegalArgumentException - when the period is not positive.

isActive

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

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


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.