com.hazelcast.topic.impl
Class TopicProxy<E>
java.lang.Object
com.hazelcast.spi.AbstractDistributedObject<TopicService>
com.hazelcast.topic.impl.TopicProxySupport
com.hazelcast.topic.impl.TopicProxy<E>
- All Implemented Interfaces:
- DistributedObject, ITopic<E>, InitializingObject
- Direct Known Subclasses:
- TotalOrderedTopicProxy
public class TopicProxy<E>
- extends TopicProxySupport
- implements ITopic<E>
Methods inherited from class com.hazelcast.spi.AbstractDistributedObject |
destroy, equals, getId, getNameAsPartitionAwareData, getNodeEngine, getOperationService, getPartitionKey, getService, hashCode, invalidate, postDestroy, throwNotActiveException, toString |
Methods inherited from interface com.hazelcast.core.ITopic |
getName |
TopicProxy
public TopicProxy(String name,
NodeEngine nodeEngine,
TopicService service)
publish
public void publish(E message)
- Description copied from interface:
ITopic
- Publishes the message to all subscribers of this topic
- Specified by:
publish
in interface ITopic<E>
- Parameters:
message
- the message to publish to all subscribers of this topic
addMessageListener
public String addMessageListener(MessageListener<E> listener)
- Description copied from interface:
ITopic
- Subscribes to this topic. When someone publishes a message on this topic.
onMessage() function of the given MessageListener is called. More than one message listener can be
added on one instance.
- Specified by:
addMessageListener
in interface ITopic<E>
- Parameters:
listener
- the MessageListener to add.
- Returns:
- returns the registration id.
removeMessageListener
public boolean removeMessageListener(String registrationId)
- Description copied from interface:
ITopic
- Stops receiving messages for the given message listener. If the given listener already removed,
this method does nothing.
- Specified by:
removeMessageListener
in interface ITopic<E>
- Parameters:
registrationId
- Id of listener registration.
- Returns:
- true if registration is removed, false otherwise
getLocalTopicStats
public LocalTopicStats getLocalTopicStats()
- Description copied from interface:
ITopic
- Returns statistics about this topic, like total number of publishes/receives
- Specified by:
getLocalTopicStats
in interface ITopic<E>
- Returns:
- statistics about this topic
Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.