E
- message typepublic class ClientReliableTopicProxy<E> extends ClientProxy implements ITopic<E>
ITopic
.
Unlike other topics, a reliable topic has its own Ringbuffer
to store events and
has its own executor to process events.name
Constructor and Description |
---|
ClientReliableTopicProxy(String objectId,
ClientContext context,
HazelcastClientInstanceImpl client) |
Modifier and Type | Method and Description |
---|---|
String |
addMessageListener(MessageListener<E> listener)
Subscribes to this topic.
|
LocalTopicStats |
getLocalTopicStats()
Returns statistics about this topic, like total number of publishes/receives.
|
Ringbuffer |
getRingbuffer() |
boolean |
isListenerCancelled(String registrationID) |
protected void |
postDestroy()
Called after proxy is destroyed.
|
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.
|
String |
toString() |
deregisterListener, destroy, destroyLocally, destroyRemotely, equals, getClient, getConnectedServerVersion, getContext, getDistributedObjectName, getId, getName, getPartitionKey, getSerializationService, getServiceName, hashCode, invoke, invoke, invokeOnAddress, invokeOnPartition, invokeOnPartitionInterruptibly, onDestroy, onInitialize, onShutdown, preDestroy, registerListener, setContext, toData, toObject
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
destroy, getPartitionKey, getServiceName
public ClientReliableTopicProxy(String objectId, ClientContext context, HazelcastClientInstanceImpl client)
public void publish(E payload)
ITopic
public String addMessageListener(MessageListener<E> listener)
ITopic
MessageListener.onMessage(Message)
method of the given
MessageListener is called.
More than one message listener can be added on one instance.addMessageListener
in interface ITopic<E>
listener
- the MessageListener to addpublic boolean isListenerCancelled(String registrationID)
public boolean removeMessageListener(String registrationId)
ITopic
If the given listener already removed, this method does nothing.
removeMessageListener
in interface ITopic<E>
registrationId
- ID of listener registrationtrue
if registration is removed, false
otherwisepublic LocalTopicStats getLocalTopicStats()
ITopic
getLocalTopicStats
in interface ITopic<E>
public Ringbuffer getRingbuffer()
protected void postDestroy()
ClientProxy
postDestroy
in class ClientProxy
Copyright © 2019 Hazelcast, Inc.. All Rights Reserved.