E
- message typepublic class ClientTopicProxy<E> extends ClientProxy implements ITopic<E>
ITopic
.name
Constructor and Description |
---|
ClientTopicProxy(String serviceName,
String objectId,
ClientContext context) |
Modifier and Type | Method and Description |
---|---|
UUID |
addMessageListener(MessageListener<E> listener)
Subscribes to this topic.
|
LocalTopicStats |
getLocalTopicStats()
Returns statistics about this topic, like total number of publishes/receives.
|
protected ClientMessage |
invokeOnPartition(ClientMessage req) |
protected <T> T |
invokeOnPartition(ClientMessage clientMessage,
long invocationTimeoutSeconds) |
protected <T> ClientDelegatingFuture<T> |
invokeOnPartitionAsync(ClientMessage clientMessage,
ClientMessageDecoder clientMessageDecoder) |
protected <T> T |
invokeOnPartitionInterruptibly(ClientMessage clientMessage) |
protected <T> T |
invokeOnPartitionInterruptibly(ClientMessage clientMessage,
long invocationTimeoutSeconds) |
protected void |
onInitialize()
Called when proxy is created.
|
void |
publish(E message)
Publishes the message to all subscribers of this topic.
|
boolean |
removeMessageListener(UUID registrationId)
Stops receiving messages for the given message listener.
|
String |
toString() |
deregisterListener, destroy, destroyLocally, destroyRemotely, equals, getClient, getContext, getDistributedObjectName, getId, getName, getPartitionKey, getSerializationService, getServiceName, hashCode, invoke, invoke, invokeOnAddress, invokeOnPartition, invokeOnPartitionInterruptibly, onDestroy, onShutdown, postDestroy, preDestroy, registerListener, toData, toObject
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
destroy, getPartitionKey, getServiceName
public ClientTopicProxy(String serviceName, String objectId, ClientContext context)
public void publish(@Nullable E message)
ITopic
@Nonnull public UUID addMessageListener(@Nonnull 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 removeMessageListener(@Nonnull UUID 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
otherwise@Nonnull public LocalTopicStats getLocalTopicStats()
ITopic
getLocalTopicStats
in interface ITopic<E>
protected void onInitialize()
ClientProxy
onInitialize
in class ClientProxy
protected ClientMessage invokeOnPartition(ClientMessage req)
protected <T> T invokeOnPartitionInterruptibly(ClientMessage clientMessage) throws InterruptedException
InterruptedException
protected <T> ClientDelegatingFuture<T> invokeOnPartitionAsync(ClientMessage clientMessage, ClientMessageDecoder clientMessageDecoder)
protected <T> T invokeOnPartition(ClientMessage clientMessage, long invocationTimeoutSeconds)
protected <T> T invokeOnPartitionInterruptibly(ClientMessage clientMessage, long invocationTimeoutSeconds) throws InterruptedException
InterruptedException
Copyright © 2019 Hazelcast, Inc.. All rights reserved.