public class DefaultNotificationCenter extends Object implements NotificationCenter
NotificationCenter.| Constructor and Description |
|---|
DefaultNotificationCenter() |
| Modifier and Type | Method and Description |
|---|---|
void |
publish(Object channel,
String messageName,
Object[] payload)
This notification will be send to the UI-Thread (if the UI-toolkit was bootstrapped).
|
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.
|
public void subscribe(String messageName, NotificationObserver observer)
NotificationCentersubscribe in interface NotificationCentermessageName - key of the notification to listenobserver - which listens for the notificationpublic void unsubscribe(String messageName, NotificationObserver observer)
NotificationCenterunsubscribe in interface NotificationCentermessageName - key of the notification to removeobserver - which listens for the notificationpublic void unsubscribe(NotificationObserver observer)
NotificationCenterunsubscribe in interface NotificationCenterobserver - for remove all notificationspublic void publish(String messageName, Object... payload)
NotificationCenterpublish in interface NotificationCentermessageName - of the notification which sould be sendpayload - which should be passedpublic void publish(Object channel, String messageName, Object[] payload)
publish in interface NotificationCenterchannel - the channelmessageName - the message to sentpayload - additional arguments to the messagepublic void subscribe(Object channel, String messageName, NotificationObserver observer)
NotificationCenterNotificationObserver on a specific channel.
See NotificationCenter.publish(Object, String, Object[]) for more information on channels.subscribe in interface NotificationCenterchannel - a channel objectmessageName - of the Notificationobserver - which should execute when the notification occurspublic void unsubscribe(Object channel, String messageName, NotificationObserver observer)
NotificationCenterNotificationObserver for a given messageName.unsubscribe in interface NotificationCenterpublic void unsubscribe(Object channel, NotificationObserver observer)
NotificationCenterNotificationObserver for all messageName.unsubscribe in interface NotificationCenterCopyright © 2019 Saxonia Systems AG. All rights reserved.