public abstract class MX4JMonitor extends javax.management.StandardMBean implements MX4JMonitorMBean, javax.management.MBeanRegistration, javax.management.NotificationEmitter
| Modifier and Type | Class and Description |
|---|---|
protected class |
MX4JMonitor.MonitorInfo |
| Modifier | Constructor and Description |
|---|---|
protected |
MX4JMonitor(java.lang.Class management) |
| Modifier and Type | Method and Description |
|---|---|
void |
addNotificationListener(javax.management.NotificationListener listener,
javax.management.NotificationFilter filter,
java.lang.Object handback)
Adds a notification listener to this emitter.
|
void |
addObservedObject(javax.management.ObjectName name) |
void |
clearObservedObjects() |
boolean |
containsObservedObject(javax.management.ObjectName name) |
protected abstract MX4JMonitor.MonitorInfo |
createMonitorInfo() |
protected javax.management.Notification |
createMonitorNotification(java.lang.String type,
long sequence,
java.lang.String message,
javax.management.ObjectName observed,
java.lang.String attribute,
java.lang.Object gauge,
java.lang.Object trigger) |
protected javax.management.NotificationBroadcasterSupport |
createNotificationEmitter() |
long |
getGranularityPeriod() |
protected Logger |
getLogger() |
protected MX4JMonitor.MonitorInfo |
getMonitorInfo(javax.management.ObjectName name) |
java.lang.String |
getObservedAttribute() |
javax.management.ObjectName[] |
getObservedObjects() |
boolean |
isActive() |
protected abstract void |
monitor(javax.management.ObjectName name,
java.lang.String attribute,
java.lang.Object value,
MX4JMonitor.MonitorInfo info) |
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.
|
protected void |
putMonitorInfo(javax.management.ObjectName name,
MX4JMonitor.MonitorInfo info) |
protected void |
removeMonitorInfo(javax.management.ObjectName name) |
void |
removeNotificationListener(javax.management.NotificationListener listener)
Removes a notification listener from this emitter.
|
void |
removeNotificationListener(javax.management.NotificationListener listener,
javax.management.NotificationFilter filter,
java.lang.Object handback)
Removes a notification listener from this MBean.
|
void |
removeObservedObject(javax.management.ObjectName name) |
protected void |
sendErrorNotification(MX4JMonitor.MonitorInfo info,
java.lang.String type,
java.lang.String message,
javax.management.ObjectName observed,
java.lang.String attribute) |
void |
sendNotification(javax.management.Notification notification) |
protected void |
sendNotification(java.lang.String type,
java.lang.String message,
javax.management.ObjectName name,
java.lang.String attribute,
java.lang.Object gauge,
java.lang.Object trigger) |
void |
setGranularityPeriod(long granularity) |
void |
setObservedAttribute(java.lang.String attribute) |
void |
start() |
protected void |
startMonitor() |
void |
stop() |
protected void |
stopMonitor() |
cacheMBeanInfo, getAttribute, getAttributes, getCachedMBeanInfo, getClassName, getConstructors, getDescription, getDescription, getDescription, getDescription, getDescription, getDescription, getDescription, getImpact, getImplementation, getImplementationClass, getMBeanInfo, getMBeanInterface, getParameterName, getParameterName, invoke, setAttribute, setAttributes, setImplementationprotected MX4JMonitor(java.lang.Class management)
throws javax.management.NotCompliantMBeanException
javax.management.NotCompliantMBeanExceptionpublic javax.management.ObjectName preRegister(javax.management.MBeanServer server,
javax.management.ObjectName name)
javax.management.MBeanRegistrationpreRegister in interface javax.management.MBeanRegistrationserver - The MBeanServer on which the MBean will be registered.name - The ObjectName of the MBean.ObjectName of the registered MBean, must not be nullpublic void postRegister(java.lang.Boolean registrationDone)
javax.management.MBeanRegistrationpostRegister in interface javax.management.MBeanRegistrationregistrationDone - True if the registration was successful, false otherwise.public void preDeregister()
javax.management.MBeanRegistrationpreDeregister in interface javax.management.MBeanRegistrationpublic void postDeregister()
javax.management.MBeanRegistrationpostDeregister in interface javax.management.MBeanRegistrationprotected javax.management.NotificationBroadcasterSupport createNotificationEmitter()
public void addNotificationListener(javax.management.NotificationListener listener,
javax.management.NotificationFilter filter,
java.lang.Object handback)
throws java.lang.IllegalArgumentException
javax.management.NotificationBroadcasteraddNotificationListener in interface javax.management.NotificationBroadcasterlistener - The notification listener which will handle the notifications emitted.filter - Filters notifications that the listener should receive; may be null, if no filtering is required.handback - An opaque object to be sent back to the listener when a notification is emitted.java.lang.IllegalArgumentExceptionNotificationBroadcaster.removeNotificationListener(NotificationListener)public void removeNotificationListener(javax.management.NotificationListener listener)
throws javax.management.ListenerNotFoundException
javax.management.NotificationBroadcasterremoveNotificationListener in interface javax.management.NotificationBroadcasterlistener - The notification listener that was previously added to this emitter.javax.management.ListenerNotFoundException - If the listener is not registered with the emitter.NotificationBroadcaster.addNotificationListener(NotificationListener, NotificationFilter, Object)public void removeNotificationListener(javax.management.NotificationListener listener,
javax.management.NotificationFilter filter,
java.lang.Object handback)
throws javax.management.ListenerNotFoundException
javax.management.NotificationEmitterremoveNotificationListener in interface javax.management.NotificationEmitterlistener - The listener that was previously added to this MBean.filter - The filter that was specified when the listener was added.handback - The handback that was specified when the listener was added.javax.management.ListenerNotFoundException - If the triple listener, filter, handback is not registered with the emitterpublic void sendNotification(javax.management.Notification notification)
public void start()
start in interface MX4JMonitorMBeanpublic void stop()
stop in interface MX4JMonitorMBeanpublic boolean isActive()
isActive in interface MX4JMonitorMBeanpublic void addObservedObject(javax.management.ObjectName name)
throws java.lang.IllegalArgumentException
addObservedObject in interface MX4JMonitorMBeanjava.lang.IllegalArgumentExceptionpublic void removeObservedObject(javax.management.ObjectName name)
removeObservedObject in interface MX4JMonitorMBeanpublic boolean containsObservedObject(javax.management.ObjectName name)
containsObservedObject in interface MX4JMonitorMBeanpublic javax.management.ObjectName[] getObservedObjects()
getObservedObjects in interface MX4JMonitorMBeanpublic void clearObservedObjects()
public java.lang.String getObservedAttribute()
getObservedAttribute in interface MX4JMonitorMBeanpublic void setObservedAttribute(java.lang.String attribute)
setObservedAttribute in interface MX4JMonitorMBeanpublic long getGranularityPeriod()
getGranularityPeriod in interface MX4JMonitorMBeanpublic void setGranularityPeriod(long granularity)
throws java.lang.IllegalArgumentException
setGranularityPeriod in interface MX4JMonitorMBeanjava.lang.IllegalArgumentExceptionprotected void startMonitor()
protected void stopMonitor()
protected Logger getLogger()
protected void sendNotification(java.lang.String type,
java.lang.String message,
javax.management.ObjectName name,
java.lang.String attribute,
java.lang.Object gauge,
java.lang.Object trigger)
protected javax.management.Notification createMonitorNotification(java.lang.String type,
long sequence,
java.lang.String message,
javax.management.ObjectName observed,
java.lang.String attribute,
java.lang.Object gauge,
java.lang.Object trigger)
protected abstract void monitor(javax.management.ObjectName name,
java.lang.String attribute,
java.lang.Object value,
MX4JMonitor.MonitorInfo info)
protected abstract MX4JMonitor.MonitorInfo createMonitorInfo()
protected MX4JMonitor.MonitorInfo getMonitorInfo(javax.management.ObjectName name)
protected void putMonitorInfo(javax.management.ObjectName name,
MX4JMonitor.MonitorInfo info)
protected void removeMonitorInfo(javax.management.ObjectName name)
protected void sendErrorNotification(MX4JMonitor.MonitorInfo info, java.lang.String type, java.lang.String message, javax.management.ObjectName observed, java.lang.String attribute)