public class InterApplicationBus extends Object
| Constructor and Description |
|---|
InterApplicationBus(DesktopConnection desktopConnection)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addSubscribeListener(SubscriptionListener listener)
Registers a listener which is called whenever a subscription occurs.
|
protected void |
dispatchMessageToCallbacks(String sourceUuid,
String topic,
Object message)
Dispatches a messages to listeners
|
void |
dispatchToSubscribeListeners(String uuid,
String topic)
Dispatches to subscription listeners
|
void |
dispatchToUnsubscribeListeners(String uuid,
String topic)
Dispatches to unsubscription listeners
|
static void |
publish(String topic,
Object message)
Publishes a message to a topic
|
void |
removeSubscribeListener(SubscriptionListener listener)
Removes the passed listener.
|
static void |
send(String destinationUuid,
String topic,
Object message)
Sends a message to an application
|
static void |
subscribe(String sourceUuid,
String topic,
BusListener listener)
Subscribes to messages on the specified topic
|
static void |
unsubscribe(String sourceUuid,
String topic,
BusListener listener)
Unsubscribes to messages on the specified topic
|
public InterApplicationBus(DesktopConnection desktopConnection)
desktopConnection - Connection object to the AppDesktoppublic static void publish(String topic, Object message)
topic - Topic to which the message is publishedmessage - The JSON message to publishpublic static void send(String destinationUuid, String topic, Object message)
destinationUuid - UUID of the application from which messages are senttopic - Topic to which the message is publishedmessage - The JSON message to publishpublic static void subscribe(String sourceUuid, String topic, BusListener listener)
sourceUuid - UUID of the applicationtopic - The topic to be subscribed tolistener - BusListener for the subscriptionBusListenerpublic static void unsubscribe(String sourceUuid, String topic, BusListener listener)
sourceUuid - UUID of the applicationtopic - The topic to be subscribed tolistener - BusListener for the subscriptionBusListenerprotected void dispatchMessageToCallbacks(String sourceUuid, String topic, Object message)
sourceUuid - UUID of the application from which messages are senttopic - Topic to which the mssage is publishedmessage - The JSON message to be dispatchedpublic void addSubscribeListener(SubscriptionListener listener)
listener - Listener to addpublic void removeSubscribeListener(SubscriptionListener listener)
listener - Listener to removepublic void dispatchToSubscribeListeners(String uuid, String topic)
uuid - The subscribing applicationtopic - The topic that is subscribed toCopyright © 2014. All rights reserved.