public abstract class AbstractStatisticsRecorder extends java.lang.Object implements StatisticsRecorderMBean, javax.management.MBeanRegistration
StatisticsRecorderMBean
Modifier and Type | Field and Description |
---|---|
protected double |
averageValue |
protected long |
count |
protected java.util.SortedMap |
entries |
protected boolean |
isActive |
protected boolean |
isDouble |
protected int |
maxEntries |
protected double |
maximumValue |
protected double |
minimumValue |
protected java.util.Date |
recordingStart |
protected javax.management.MBeanServer |
server |
Constructor and Description |
---|
AbstractStatisticsRecorder() |
Modifier and Type | Method and Description |
---|---|
protected void |
addEntry(java.util.Date key,
java.lang.Number value)
Adds an entry to the collection.
|
protected void |
doStart()
Subclasses may override this to offer a custom startup procedure
|
protected void |
doStop()
Subclasses may override this to offer a custom stop procedure
|
java.lang.Number |
getAverage()
Returns the Average Value
|
java.util.SortedMap |
getEntries()
Returs a sorted map of the recorded values indexed by PointTime
|
protected Logger |
getLogger() |
java.lang.Number |
getMax()
Returns the Maximum Value
|
int |
getMaxEntries()
Returns how many entries may be recorded.
|
java.lang.Number |
getMin()
Returns the Minimum Value
|
java.util.Date |
getRecordingStart()
Returns the date when it started recording
|
boolean |
isActive()
Indicates whether the MBean is recording values
|
void |
postDeregister()
Callback called just after the MBean has been successfully unregistered.
|
void |
postRegister(java.lang.Boolean registrationDone)
Callback called just after the MBean has been registered (successfully or not).
|
void |
preDeregister()
Callback called just before MBean unregistration from the MBeanServer.
|
javax.management.ObjectName |
preRegister(javax.management.MBeanServer server,
javax.management.ObjectName name)
Callback called just before MBean registration in the MBeanServer.
|
void |
setMaxEntries(int maxEntries)
Sets the maximum entries stored in this recorder
|
void |
start()
Starts recording a variable
|
void |
stop()
Stops recording a variable
|
protected boolean isActive
protected javax.management.MBeanServer server
protected int maxEntries
protected java.util.SortedMap entries
protected java.util.Date recordingStart
protected boolean isDouble
protected double minimumValue
protected double maximumValue
protected double averageValue
protected long count
protected Logger getLogger()
public void start()
StatisticsRecorderMBean
start
in interface StatisticsRecorderMBean
public void stop()
StatisticsRecorderMBean
stop
in interface StatisticsRecorderMBean
public java.lang.Number getAverage()
StatisticsRecorderMBean
getAverage
in interface StatisticsRecorderMBean
public java.lang.Number getMin()
StatisticsRecorderMBean
getMin
in interface StatisticsRecorderMBean
public java.lang.Number getMax()
StatisticsRecorderMBean
getMax
in interface StatisticsRecorderMBean
public boolean isActive()
StatisticsRecorderMBean
isActive
in interface StatisticsRecorderMBean
public int getMaxEntries()
StatisticsRecorderMBean
getMaxEntries
in interface StatisticsRecorderMBean
public void setMaxEntries(int maxEntries)
StatisticsRecorderMBean
setMaxEntries
in interface StatisticsRecorderMBean
public java.util.SortedMap getEntries()
StatisticsRecorderMBean
getEntries
in interface StatisticsRecorderMBean
public java.util.Date getRecordingStart()
StatisticsRecorderMBean
getRecordingStart
in interface StatisticsRecorderMBean
public javax.management.ObjectName preRegister(javax.management.MBeanServer server, javax.management.ObjectName name) throws java.lang.Exception
javax.management.MBeanRegistration
preRegister
in interface javax.management.MBeanRegistration
server
- The MBeanServer on which the MBean will be registered.name
- The ObjectName
of the MBean.ObjectName
of the registered MBean, must not be nulljava.lang.Exception
- Any possible exception generated by this method will be caught
by the MBeanServer
and re-thrown as an MBeanRegistrationException
to the client.public void postRegister(java.lang.Boolean registrationDone)
javax.management.MBeanRegistration
postRegister
in interface javax.management.MBeanRegistration
registrationDone
- True if the registration was successful, false otherwise.public void preDeregister() throws java.lang.Exception
javax.management.MBeanRegistration
preDeregister
in interface javax.management.MBeanRegistration
java.lang.Exception
- Any possible exception generated by this method will be caught
by the MBeanServer
and re-thrown as an MBeanRegistrationException
to the client.public void postDeregister()
javax.management.MBeanRegistration
postDeregister
in interface javax.management.MBeanRegistration
protected void doStart() throws java.lang.Exception
java.lang.Exception
protected void doStop() throws java.lang.Exception
java.lang.Exception
protected void addEntry(java.util.Date key, java.lang.Number value)