com.hazelcast.topic.impl.reliable
Class ReliableTopicProxy<E>

java.lang.Object
  extended by com.hazelcast.spi.AbstractDistributedObject<ReliableTopicService>
      extended by com.hazelcast.topic.impl.reliable.ReliableTopicProxy<E>
Type Parameters:
E -
All Implemented Interfaces:
DistributedObject, ITopic<E>

public class ReliableTopicProxy<E>
extends AbstractDistributedObject<ReliableTopicService>
implements ITopic<E>

The serverside ITopic implementation for reliable topics.


Field Summary
static int INITIAL_BACKOFF_MS
           
static int MAX_BACKOFF
           
 
Fields inherited from class com.hazelcast.spi.AbstractDistributedObject
PARTITIONING_STRATEGY
 
Constructor Summary
ReliableTopicProxy(String name, NodeEngine nodeEngine, ReliableTopicService service, ReliableTopicConfig topicConfig)
           
 
Method Summary
 String addMessageListener(MessageListener<E> listener)
          Subscribes to this topic.
 LocalTopicStats getLocalTopicStats()
          Returns statistics about this topic, like total number of publishes/receives
 String getName()
          Returns the name of this ITopic instance
 String getServiceName()
          Returns the service name for this object.
protected  void postDestroy()
           
 void publish(E payload)
          Publishes the message to all subscribers of this topic
 boolean removeMessageListener(String registrationId)
          Stops receiving messages for the given message listener.
 
Methods inherited from class com.hazelcast.spi.AbstractDistributedObject
destroy, equals, getId, getNameAsPartitionAwareData, getNodeEngine, getOperationService, getPartitionKey, getService, hashCode, invalidate, throwNotActiveException, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.hazelcast.core.DistributedObject
destroy, getId, getPartitionKey
 

Field Detail

MAX_BACKOFF

public static final int MAX_BACKOFF
See Also:
Constant Field Values

INITIAL_BACKOFF_MS

public static final int INITIAL_BACKOFF_MS
See Also:
Constant Field Values
Constructor Detail

ReliableTopicProxy

public ReliableTopicProxy(String name,
                          NodeEngine nodeEngine,
                          ReliableTopicService service,
                          ReliableTopicConfig topicConfig)
Method Detail

getServiceName

public String getServiceName()
Description copied from interface: DistributedObject
Returns the service name for this object.

Specified by:
getServiceName in interface DistributedObject
Specified by:
getServiceName in class AbstractDistributedObject<ReliableTopicService>
Returns:
the service name for this object.

getName

public String getName()
Description copied from interface: ITopic
Returns the name of this ITopic instance

Specified by:
getName in interface DistributedObject
Specified by:
getName in interface ITopic<E>
Returns:
name of this ITopic instance

publish

public void publish(E payload)
Description copied from interface: ITopic
Publishes the message to all subscribers of this topic

Specified by:
publish in interface ITopic<E>
Parameters:
payload - 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

postDestroy

protected void postDestroy()
Overrides:
postDestroy in class AbstractDistributedObject<ReliableTopicService>

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.