Modifier and Type | Method and Description |
---|---|
int |
addListener(MessageListener<M> listener)
Subscribes to this topic.
|
void |
close() |
String |
getName() |
void |
publish(M message)
Publish the message to all subscribers of this topic
|
void |
removeListener(int listenerId)
Removes the listener by
id for listening this topic |
void |
subscribe() |
public void subscribe()
public void publish(M message)
RTopic
public int addListener(MessageListener<M> listener)
RTopic
MessageListener.onMessage
is called when any message
is published on this topic.addListener
in interface RTopic<M>
MessageListener
public void removeListener(int listenerId)
RTopic
id
for listening this topicremoveListener
in interface RTopic<M>
public void close()
public String getName()
Copyright © 2014. All rights reserved.