|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.util.NotificationService
public final class NotificationService
a singleton that maintains Notifier objects
NotificationListener,
Notifier| Nested Class Summary | |
|---|---|
static interface |
NotificationService.Listener
|
| Method Summary | |
|---|---|
void |
addListener(NotificationService.Listener l)
|
NotificationService.Listener[] |
getListeners()
|
Object[] |
getMonitoredObjects()
|
Notifier |
getNotifier(Object monitoredObject)
returns either the Notifier that monitors the given object or null if the given object is not monitored |
static NotificationService |
getService()
|
boolean |
isMonitored(Object monitoredObject)
|
Notifier |
monitorObject(Object monitoredObject)
starts monitoring the given object by creating a new Notifier |
Notifier |
obtainNotifier(Object monitoredObject)
first calls getNotifier() and if that returns null, monitorObject() is called |
boolean |
removeListener(NotificationService.Listener l)
|
void |
stopAll()
calls stopNotifier() on all monitored objects |
void |
stopInactiveNotifiers()
calls stopNotifier() on all monitored objects where their respective Notifier instances have no listeners |
boolean |
stopNotifier(Object monitoredObject)
the Notifier for the given object will be stopped (all listeners will be informed) and removed from this service. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static NotificationService getService()
public boolean isMonitored(Object monitoredObject)
public Object[] getMonitoredObjects()
public void stopAll()
public void stopInactiveNotifiers()
public boolean stopNotifier(Object monitoredObject)
public Notifier monitorObject(Object monitoredObject)
throws IllegalStateException
IllegalStateException - if the given object is already monitoredpublic Notifier getNotifier(Object monitoredObject)
public Notifier obtainNotifier(Object monitoredObject)
public void addListener(NotificationService.Listener l)
public boolean removeListener(NotificationService.Listener l)
public NotificationService.Listener[] getListeners()
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||