public class TopicProxy<E> extends AbstractDistributedObject<TopicService> implements ITopic<E>
PARTITIONING_STRATEGY
Constructor and Description |
---|
TopicProxy(String name,
NodeEngine nodeEngine,
TopicService service) |
Modifier and Type | Method and Description |
---|---|
String |
addMessageListener(MessageListener<E> listener)
Subscribes to this topic.
|
String |
addMessageListenerInternal(MessageListener listener) |
LocalTopicStats |
getLocalTopicStats()
Returns statistics about this topic, like total number of publishes/receives
|
LocalTopicStats |
getLocalTopicStatsInternal() |
String |
getName()
Returns the unique name for this DistributedObject.
|
String |
getServiceName()
Returns the service name for this object.
|
void |
initialize() |
void |
publish(E message)
Publishes the message to all subscribers of this topic
|
void |
publishInternal(Data message) |
boolean |
removeMessageListener(String registrationId)
Stops receiving messages for the given message listener.
|
boolean |
removeMessageListenerInternal(String registrationId) |
destroy, equals, getId, getNameAsPartitionAwareData, getNodeEngine, getPartitionKey, getService, hashCode, invalidate, postDestroy, throwNotActiveException, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
destroy, getId, getPartitionKey, getServiceName
public TopicProxy(String name, NodeEngine nodeEngine, TopicService service)
public void publish(E message)
ITopic
public String addMessageListener(MessageListener<E> listener)
ITopic
addMessageListener
in interface ITopic<E>
public boolean removeMessageListener(String registrationId)
ITopic
removeMessageListener
in interface ITopic<E>
registrationId
- Id of listener registration.public LocalTopicStats getLocalTopicStats()
ITopic
getLocalTopicStats
in interface ITopic<E>
public void initialize()
initialize
in interface InitializingObject
public LocalTopicStats getLocalTopicStatsInternal()
public void publishInternal(Data message)
public String addMessageListenerInternal(MessageListener listener)
public boolean removeMessageListenerInternal(String registrationId)
public String getServiceName()
DistributedObject
getServiceName
in interface DistributedObject
getServiceName
in class AbstractDistributedObject<TopicService>
public String getName()
DistributedObject
getName
in interface DistributedObject
Copyright © 2014 Hazelcast, Inc.. All Rights Reserved.