public class WhiteBoard extends Object implements IWhiteBoard
Modifier and Type | Field and Description |
---|---|
Subscriptions |
subscriptions |
Modifier and Type | Method and Description |
---|---|
static WhiteBoard |
getInstance()
The getInstance method is in charge of returning the singleton static instance
of the whiteboard object.
|
void |
publish(String key,
Object result)
The publish method is called by the producer when it
receives data to call back the consumer.
|
void |
subscribe(String key,
ISubscription s)
The subscribe method is called by the consumer when it
receives data.
|
void |
unsubscribe(String key)
The unsubscribe method is called by the producer when the
subscription does not need to be maintained, its role is over.
|
public Subscriptions subscriptions
public static WhiteBoard getInstance()
public void subscribe(String key, ISubscription s)
subscribe
in interface IWhiteBoard
key
- the unique id of the subscriptions
- the subscription containing a callbackpublic void publish(String key, Object result)
publish
in interface IWhiteBoard
key
- the unique id of the subscriptionresult
- the subscription containing a callbackpublic void unsubscribe(String key)
unsubscribe
in interface IWhiteBoard
key
- the unique id of the subscriptionCopyright © 2022. All rights reserved.