|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.israfil.foundation.notification.NotificationCentre
public class NotificationCentre
| Nested Class Summary | |
|---|---|
class |
NotificationCentre.ObservationSpec
TODO Use WeakReferences |
| Constructor Summary | |
|---|---|
protected |
NotificationCentre()
|
| Method Summary | |
|---|---|
void |
addObserver(java.lang.Object observer,
java.lang.String callbackSignature,
java.lang.String notification,
java.lang.Object sender)
This registers an object as an observer of notifications. |
void |
clearObservers()
|
static NotificationCentre |
defaultCentre()
|
void |
postNotification(Notification notification)
Post a notification with the given nam and notifier. |
void |
postNotification(java.lang.Object sender,
java.lang.String notification)
Post a notification with the given name, notifier, and with additional context information presented in a java.util.Map. |
void |
postNotification(java.lang.Object sender,
java.lang.String notification,
java.util.Map info)
Post a notification with the given name, notifier, and with additional context information presented in a java.util.Map. |
void |
removeObserver(java.lang.Object observer,
java.lang.String notification,
java.lang.Object sender)
Removes an observer from any notofications with either or both a provided notification string, or notifier |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected NotificationCentre()
| Method Detail |
|---|
public static NotificationCentre defaultCentre()
public void addObserver(java.lang.Object observer,
java.lang.String callbackSignature,
java.lang.String notification,
java.lang.Object sender)
| Notification Name | Sender Object | Effect |
|---|---|---|
| null | a sender | Notifications (of any name) from this sender are observed |
| notification string | null | Notifications with this name (from any sender) are observed. |
| notification string | a sender | Only notifications with this name and originating from this sender are observed |
| null | null | All Notifications from any source will be sent (big performance drag) |
observer - The object instance that wants to be registeredcallbackSignature - Must be a method that takes a single Object parameter which will be a Notification at run-time, or a single Notification parameternotification - The name of the notification to watch for (if any)sender - The name of the object to whose notifications should be paid attention. (if any)public void postNotification(Notification notification)
public void postNotification(java.lang.Object sender,
java.lang.String notification)
public void postNotification(java.lang.Object sender,
java.lang.String notification,
java.util.Map info)
public void removeObserver(java.lang.Object observer,
java.lang.String notification,
java.lang.Object sender)
public void clearObservers()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||