mx4j.monitor

Class MX4JMonitor

public abstract class MX4JMonitor extends StandardMBean implements MX4JMonitorMBean, MBeanRegistration, NotificationEmitter

The class that implements the Monitor behavior of the JMX specification. IMPLEMENTATION NOTE: There is one single thread that handles monitoring, for all monitor objects. There is one single task per each monitor object that runs. The queue will have possibly many tasks per each monitor type. Each monitor handles many MBeans, but only one attribute; however, both MBeans and attribute can be changed, though it would be a strange way to use the monitor.

Version: $Revision: 1.4 $

Nested Class Summary
protected classMX4JMonitor.MonitorInfo
Constructor Summary
protected MX4JMonitor(Class management)
Method Summary
voidaddNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
voidaddObservedObject(ObjectName name)
voidclearObservedObjects()
booleancontainsObservedObject(ObjectName name)
protected abstract MX4JMonitor.MonitorInfocreateMonitorInfo()
protected NotificationcreateMonitorNotification(String type, long sequence, String message, ObjectName observed, String attribute, Object gauge, Object trigger)
protected NotificationBroadcasterSupportcreateNotificationEmitter()
longgetGranularityPeriod()
protected LoggergetLogger()
protected MX4JMonitor.MonitorInfogetMonitorInfo(ObjectName name)
StringgetObservedAttribute()
ObjectName[]getObservedObjects()
booleanisActive()
protected abstract voidmonitor(ObjectName name, String attribute, Object value, MX4JMonitor.MonitorInfo info)
voidpostDeregister()
voidpostRegister(Boolean registrationDone)
voidpreDeregister()
ObjectNamepreRegister(MBeanServer server, ObjectName name)
protected voidputMonitorInfo(ObjectName name, MX4JMonitor.MonitorInfo info)
protected voidremoveMonitorInfo(ObjectName name)
voidremoveNotificationListener(NotificationListener listener)
voidremoveNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
voidremoveObservedObject(ObjectName name)
protected voidsendErrorNotification(MX4JMonitor.MonitorInfo info, String type, String message, ObjectName observed, String attribute)
voidsendNotification(Notification notification)
protected voidsendNotification(String type, String message, ObjectName name, String attribute, Object gauge, Object trigger)
voidsetGranularityPeriod(long granularity)
voidsetObservedAttribute(String attribute)
voidstart()
protected voidstartMonitor()
voidstop()
protected voidstopMonitor()

Constructor Detail

MX4JMonitor

protected MX4JMonitor(Class management)

Method Detail

addNotificationListener

public void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)

addObservedObject

public void addObservedObject(ObjectName name)

clearObservedObjects

public void clearObservedObjects()

containsObservedObject

public boolean containsObservedObject(ObjectName name)

createMonitorInfo

protected abstract MX4JMonitor.MonitorInfo createMonitorInfo()

createMonitorNotification

protected Notification createMonitorNotification(String type, long sequence, String message, ObjectName observed, String attribute, Object gauge, Object trigger)

createNotificationEmitter

protected NotificationBroadcasterSupport createNotificationEmitter()

getGranularityPeriod

public long getGranularityPeriod()

getLogger

protected Logger getLogger()

getMonitorInfo

protected MX4JMonitor.MonitorInfo getMonitorInfo(ObjectName name)

getObservedAttribute

public String getObservedAttribute()

getObservedObjects

public ObjectName[] getObservedObjects()

isActive

public boolean isActive()

monitor

protected abstract void monitor(ObjectName name, String attribute, Object value, MX4JMonitor.MonitorInfo info)

postDeregister

public void postDeregister()

postRegister

public void postRegister(Boolean registrationDone)

preDeregister

public void preDeregister()

preRegister

public ObjectName preRegister(MBeanServer server, ObjectName name)

putMonitorInfo

protected void putMonitorInfo(ObjectName name, MX4JMonitor.MonitorInfo info)

removeMonitorInfo

protected void removeMonitorInfo(ObjectName name)

removeNotificationListener

public void removeNotificationListener(NotificationListener listener)

removeNotificationListener

public void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)

removeObservedObject

public void removeObservedObject(ObjectName name)

sendErrorNotification

protected void sendErrorNotification(MX4JMonitor.MonitorInfo info, String type, String message, ObjectName observed, String attribute)

sendNotification

public void sendNotification(Notification notification)

sendNotification

protected void sendNotification(String type, String message, ObjectName name, String attribute, Object gauge, Object trigger)

setGranularityPeriod

public void setGranularityPeriod(long granularity)

setObservedAttribute

public void setObservedAttribute(String attribute)

start

public void start()

startMonitor

protected void startMonitor()

stop

public void stop()

stopMonitor

protected void stopMonitor()
Copyright © 2001-2005 The MX4J Contributors. All Rights Reserved.