public interface NotificationCenter
Object[] with a notification.
There is a util NotificationTestHelper that's purpose is to simplify testing of notifications in Unit-Tests.
| Modifier and Type | Method and Description |
|---|---|
void |
publish(Object channel,
String messageName,
Object[] payload)
Publishes a notification on a specific channel.
|
void |
publish(String messageName,
Object... payload)
Post a notification to all NotificationObserver which are registered with the given String.
|
void |
subscribe(Object channel,
String messageName,
NotificationObserver observer)
Subscribe to a notification with a given
NotificationObserver on a specific channel. |
void |
subscribe(String messageName,
NotificationObserver observer)
Add an observer to the NotificationCenter which gets notifications for the given String.
|
void |
unsubscribe(NotificationObserver observer)
Remove all registrations of an NotificationObserver.
|
void |
unsubscribe(Object channel,
NotificationObserver observer)
Removes a
NotificationObserver for all messageName. |
void |
unsubscribe(Object channel,
String messageName,
NotificationObserver observer)
Removes a
NotificationObserver for a given messageName. |
void |
unsubscribe(String messageName,
NotificationObserver observer)
Removes an observer from the NotificationCenter.
|
void subscribe(String messageName, NotificationObserver observer)
messageName - key of the notification to listenobserver - which listens for the notificationvoid unsubscribe(String messageName, NotificationObserver observer)
messageName - key of the notification to removeobserver - which listens for the notificationvoid unsubscribe(NotificationObserver observer)
observer - for remove all notificationsvoid publish(String messageName, Object... payload)
messageName - of the notification which sould be sendpayload - which should be passedvoid publish(Object channel, String messageName, Object[] payload)
channel - a channel object.messageName - of the notificationpayload - to be sendvoid subscribe(Object channel, String messageName, NotificationObserver observer)
NotificationObserver on a specific channel.
See publish(Object, String, Object[]) for more information on channels.channel - a channel objectmessageName - of the Notificationobserver - which should execute when the notification occursvoid unsubscribe(Object channel, String messageName, NotificationObserver observer)
NotificationObserver for a given messageName.channel - messageName - observer - void unsubscribe(Object channel, NotificationObserver observer)
NotificationObserver for all messageName.channel - observer - Copyright © 2019 Saxonia Systems AG. All rights reserved.