javax.management.monitor
Class Monitor

java.lang.Object
  |
  +--javax.management.NotificationBroadcasterSupport
        |
        +--javax.management.monitor.Monitor
All Implemented Interfaces:
MBeanRegistration, MonitorMBean, NotificationBroadcaster
Direct Known Subclasses:
CounterMonitor, GaugeMonitor, StringMonitor

public abstract class Monitor
extends NotificationBroadcasterSupport
implements MonitorMBean, MBeanRegistration

Class monitor. Parent class of all Monitoring classes

See Also:
MonitorMBean

Constructor Summary
Monitor()
           
 
Method Summary
 long getGranularityPeriod()
           
 java.lang.String getObservedAttribute()
           
 javax.management.ObjectName getObservedObject()
           
 boolean isActive()
           
 void postDeregister()
          Called upon after the MBean has been de-registered.
 void postRegister(java.lang.Boolean registrationDone)
          Called upon after a registration ( successful or not ).
 void preDeregister()
          Called upon before an MBean will be de-registered by the MBeanServer.
 javax.management.ObjectName preRegister(javax.management.MBeanServer server, javax.management.ObjectName name)
          Allows the MBean to perform any operations before being registered to the MBeanServer.
 void setGranularityPeriod(long period)
           
 void setObservedAttribute(java.lang.String attribute)
           
 void setObservedObject(javax.management.ObjectName objectName)
           
abstract  void start()
           
abstract  void stop()
           
 java.lang.String toString()
           
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Monitor

public Monitor()
Method Detail

start

public abstract void start()
Specified by:
start in interface MonitorMBean

stop

public abstract void stop()
Specified by:
stop in interface MonitorMBean

getObservedObject

public javax.management.ObjectName getObservedObject()
Specified by:
getObservedObject in interface MonitorMBean

setObservedObject

public void setObservedObject(javax.management.ObjectName objectName)
                       throws java.lang.IllegalArgumentException
Specified by:
setObservedObject in interface MonitorMBean
java.lang.IllegalArgumentException

getObservedAttribute

public java.lang.String getObservedAttribute()
Specified by:
getObservedAttribute in interface MonitorMBean

setObservedAttribute

public void setObservedAttribute(java.lang.String attribute)
                          throws java.lang.IllegalArgumentException
Specified by:
setObservedAttribute in interface MonitorMBean
java.lang.IllegalArgumentException

getGranularityPeriod

public long getGranularityPeriod()
Specified by:
getGranularityPeriod in interface MonitorMBean

setGranularityPeriod

public void setGranularityPeriod(long period)
                          throws java.lang.IllegalArgumentException
Specified by:
setGranularityPeriod in interface MonitorMBean
java.lang.IllegalArgumentException

isActive

public boolean isActive()
Specified by:
isActive in interface MonitorMBean

preRegister

public javax.management.ObjectName preRegister(javax.management.MBeanServer server,
                                               javax.management.ObjectName name)
                                        throws java.lang.Exception
Description copied from interface: MBeanRegistration
Allows the MBean to perform any operations before being registered to the MBeanServer.

Any exception will cause the MBean not being registered.

Specified by:
preRegister in interface MBeanRegistration
Parameters:
server - The MBeanServer on which the MBean will be registered.
name - The ObjectName of the MBean.
Returns:
ObjectName The name of the registered MBean
Throws:
java.lang.Exception - Exception of the operation. Note that this is caught by the MBeanServer and re-thrown as an MBeanRegistrationException.

postRegister

public void postRegister(java.lang.Boolean registrationDone)
Description copied from interface: MBeanRegistration
Called upon after a registration ( successful or not ).

Specified by:
postRegister in interface MBeanRegistration
Parameters:
registrationDone - Evaluates to true of the registrations is successful, false otherwise.

preDeregister

public void preDeregister()
                   throws java.lang.Exception
Description copied from interface: MBeanRegistration
Called upon before an MBean will be de-registered by the MBeanServer.

Specified by:
preDeregister in interface MBeanRegistration
Throws:
java.lang.Exception - Would be caught by the MBeanServer and rethrown as an MBeanRegistrationException.

postDeregister

public void postDeregister()
Description copied from interface: MBeanRegistration
Called upon after the MBean has been de-registered.

Specified by:
postDeregister in interface MBeanRegistration

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object