blackboard.platform.monitor
Interface Monitor<L extends MonitorListener>

Type Parameters:
L - The type of MonitorListener this monitor supports
All Known Subinterfaces:
CacheMonitor, ConnectionMonitor, LogMonitor, MemoryMonitor, SessionMonitor, SingletonMonitor<L>, TaskMonitor, ThreadMonitor

public interface Monitor<L extends MonitorListener>

The Monitor class provides a way to monitor an entity within the system. The MonitorService class can be used to retrieve a monitor for the desired entity. Monitors will monitor for certain occurrences and notify a set of registered MonitorListener classes by sending out a MonitorEvent.

Since:
Bb 9.1

Method Summary
 void addMonitorListener(L listener)
          Add a new listener for this monitor.
 long getNumEvents()
          The total number of events sent out by this monitor in its lifetime.
 int getNumListeners()
          The number of listeners currently registered.
 boolean isMonitoring()
          Tells the system whether the monitor is currently monitoring for events.
 void removeMonitorListener(L listener)
          Removes the specified listener from this monitor.
 

Method Detail

isMonitoring

boolean isMonitoring()
Tells the system whether the monitor is currently monitoring for events. A monitor is only monitoring if it is not closed and it has listeners registered to it.

Returns:
True if the monitor is currently monitoring, false otherwise.

getNumListeners

int getNumListeners()
The number of listeners currently registered.


getNumEvents

long getNumEvents()
The total number of events sent out by this monitor in its lifetime.


addMonitorListener

void addMonitorListener(L listener)
Add a new listener for this monitor.

Parameters:
listener - The listener to add

removeMonitorListener

void removeMonitorListener(L listener)
Removes the specified listener from this monitor. It is the responsibility of the original caller of addMonitorListener(MonitorListener) to keep track of the listeners it has registered with this monitor.

Parameters:
listener - The listener to remove


Copyright © 2012 Blackboard, Inc. All Rights Reserved.