org.jboss.monitor
Class SnapshotRecordingMonitor

java.lang.Object
  extended byorg.jboss.monitor.SnapshotRecordingMonitor
All Implemented Interfaces:
MBeanRegistration (src) , java.lang.Runnable, SnapshotRecordingMonitorMBean (src)

public class SnapshotRecordingMonitor
extends java.lang.Object
implements java.lang.Runnable, SnapshotRecordingMonitorMBean (src) , MBeanRegistration (src)

Comment


Field Summary
protected  java.lang.String attribute
           
protected  long endTime
           
protected  java.util.ArrayList history
           
protected  Logger (src) log
           
protected  MBeanServer (src) mbeanServer
           
protected  java.lang.String monitorName
           
protected  ObjectName (src) observedObject
           
protected  long period
           
protected  boolean recording
           
protected  long startTime
           
 
Constructor Summary
SnapshotRecordingMonitor()
           
 
Method Summary
 void clearData()
           
 void endSnapshot()
           
 java.util.ArrayList getData()
           
 long getEndTime()
           
 java.lang.String getMonitorName()
           
 java.lang.String getObservedAttribute()
           
 ObjectName (src) getObservedObject()
           
 long getPeriod()
           
 long getStartTime()
           
 boolean isRecording()
           
 void postDeregister()
          This method is called by the MBeanServer after deregistration takes place.
 void postRegister(java.lang.Boolean registrationDone)
          This method is called by the MBeanServer after registration takes place or when registration fails.
 void preDeregister()
          This method is called by the MBeanServer before deregistration takes place.
 ObjectName (src) preRegister(MBeanServer (src)  server, ObjectName (src)  objectName)
          This method is called by the MBeanServer before registration takes place.
 void run()
           
 void setMonitorName(java.lang.String name)
           
 void setObservedAttribute(java.lang.String attr)
           
 void setObservedObject(ObjectName (src)  oname)
           
 void setPeriod(long period)
           
 void setRecording(boolean start)
           
protected  void startMonitorThread()
           
 void startSnapshot()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected Logger (src)  log

monitorName

protected java.lang.String monitorName

observedObject

protected ObjectName (src)  observedObject

attribute

protected java.lang.String attribute

recording

protected boolean recording

period

protected long period

history

protected java.util.ArrayList history

startTime

protected long startTime

endTime

protected long endTime

mbeanServer

protected MBeanServer (src)  mbeanServer
Constructor Detail

SnapshotRecordingMonitor

public SnapshotRecordingMonitor()
Method Detail

startMonitorThread

protected void startMonitorThread()

getMonitorName

public java.lang.String getMonitorName()
Specified by:
getMonitorName in interface SnapshotRecordingMonitorMBean (src)

setMonitorName

public void setMonitorName(java.lang.String name)
Specified by:
setMonitorName in interface SnapshotRecordingMonitorMBean (src)

getObservedObject

public ObjectName (src)  getObservedObject()
Specified by:
getObservedObject in interface SnapshotRecordingMonitorMBean (src)

setObservedObject

public void setObservedObject(ObjectName (src)  oname)
Specified by:
setObservedObject in interface SnapshotRecordingMonitorMBean (src)

getObservedAttribute

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

setObservedAttribute

public void setObservedAttribute(java.lang.String attr)
Specified by:
setObservedAttribute in interface SnapshotRecordingMonitorMBean (src)

isRecording

public boolean isRecording()
Specified by:
isRecording in interface SnapshotRecordingMonitorMBean (src)

setRecording

public void setRecording(boolean start)

getPeriod

public long getPeriod()
Specified by:
getPeriod in interface SnapshotRecordingMonitorMBean (src)

setPeriod

public void setPeriod(long period)
Specified by:
setPeriod in interface SnapshotRecordingMonitorMBean (src)

getData

public java.util.ArrayList getData()
Specified by:
getData in interface SnapshotRecordingMonitorMBean (src)

clearData

public void clearData()
Specified by:
clearData in interface SnapshotRecordingMonitorMBean (src)

startSnapshot

public void startSnapshot()
Specified by:
startSnapshot in interface SnapshotRecordingMonitorMBean (src)

endSnapshot

public void endSnapshot()
Specified by:
endSnapshot in interface SnapshotRecordingMonitorMBean (src)

getStartTime

public long getStartTime()
Specified by:
getStartTime in interface SnapshotRecordingMonitorMBean (src)

getEndTime

public long getEndTime()
Specified by:
getEndTime in interface SnapshotRecordingMonitorMBean (src)

run

public void run()
Specified by:
run in interface java.lang.Runnable

preRegister

public ObjectName (src)  preRegister(MBeanServer (src)  server,
                              ObjectName (src)  objectName)
                       throws java.lang.Exception
Description copied from interface: MBeanRegistration (src)
This method is called by the MBeanServer before registration takes place. The MBean is passed a reference of the MBeanServer it is about to be registered with. The MBean must return the ObjectName it will be registered with. The MBeanServer can pass a suggested object depending upon how the MBean is registered.

The MBean can stop the registration by throwing an exception.The exception is forwarded to the invoker wrapped in an MBeanRegistrationException.

Specified by:
preRegister in interface MBeanRegistration (src)
Returns:
the actual ObjectName to register this MBean with.
Throws:
java.lang.Exception - for any error, the MBean is not registered.

postRegister

public void postRegister(java.lang.Boolean registrationDone)
Description copied from interface: MBeanRegistration (src)
This method is called by the MBeanServer after registration takes place or when registration fails.

Specified by:
postRegister in interface MBeanRegistration (src)
Parameters:
registrationDone - the MBeanServer passes true when the MBean was registered, false otherwise.

preDeregister

public void preDeregister()
                   throws java.lang.Exception
Description copied from interface: MBeanRegistration (src)
This method is called by the MBeanServer before deregistration takes place.

The MBean can throw an exception, this will stop the deregistration. The exception is forwarded to the invoker wrapped in an MBeanRegistrationException.

Specified by:
preDeregister in interface MBeanRegistration (src)
Throws:
java.lang.Exception

postDeregister

public void postDeregister()
Description copied from interface: MBeanRegistration (src)
This method is called by the MBeanServer after deregistration takes place.

Specified by:
postDeregister in interface MBeanRegistration (src)