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, setImplementation
protected MX4JMonitor(java.lang.Class management) throws javax.management.NotCompliantMBeanException
javax.management.NotCompliantMBeanException
public javax.management.ObjectName preRegister(javax.management.MBeanServer server, javax.management.ObjectName name)
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 nullpublic 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()
javax.management.MBeanRegistration
preDeregister
in interface javax.management.MBeanRegistration
public void postDeregister()
javax.management.MBeanRegistration
postDeregister
in interface javax.management.MBeanRegistration
protected 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.NotificationBroadcaster
addNotificationListener
in interface javax.management.NotificationBroadcaster
listener
- 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.IllegalArgumentException
NotificationBroadcaster.removeNotificationListener(NotificationListener)
public void removeNotificationListener(javax.management.NotificationListener listener) throws javax.management.ListenerNotFoundException
javax.management.NotificationBroadcaster
removeNotificationListener
in interface javax.management.NotificationBroadcaster
listener
- 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.NotificationEmitter
removeNotificationListener
in interface javax.management.NotificationEmitter
listener
- 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 MX4JMonitorMBean
public void stop()
stop
in interface MX4JMonitorMBean
public boolean isActive()
isActive
in interface MX4JMonitorMBean
public void addObservedObject(javax.management.ObjectName name) throws java.lang.IllegalArgumentException
addObservedObject
in interface MX4JMonitorMBean
java.lang.IllegalArgumentException
public void removeObservedObject(javax.management.ObjectName name)
removeObservedObject
in interface MX4JMonitorMBean
public boolean containsObservedObject(javax.management.ObjectName name)
containsObservedObject
in interface MX4JMonitorMBean
public javax.management.ObjectName[] getObservedObjects()
getObservedObjects
in interface MX4JMonitorMBean
public void clearObservedObjects()
public java.lang.String getObservedAttribute()
getObservedAttribute
in interface MX4JMonitorMBean
public void setObservedAttribute(java.lang.String attribute)
setObservedAttribute
in interface MX4JMonitorMBean
public long getGranularityPeriod()
getGranularityPeriod
in interface MX4JMonitorMBean
public void setGranularityPeriod(long granularity) throws java.lang.IllegalArgumentException
setGranularityPeriod
in interface MX4JMonitorMBean
java.lang.IllegalArgumentException
protected 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)