com.hazelcast.client.proxy

## Class ClientReliableTopicProxy<E>

- java.lang.Object
- - com.hazelcast.client.spi.ClientProxy
  - - com.hazelcast.client.proxy.ClientReliableTopicProxy<E>

- Type Parameters:
    `E` - message type
  All Implemented Interfaces:
    DistributedObject, ITopic<E>

      public class ClientReliableTopicProxy<E>
      extends ClientProxy
      implements ITopic<E>

  Reliable proxy implementation of `ITopic`.

  Unlike other topics, a reliable topic has its own `Ringbuffer` to store events and has its own executor to process events.

- - ### Field Summary

    - ### Fields inherited from class com.hazelcast.client.spi.ClientProxy

      `name`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ClientReliableTopicProxy(String objectId, ClientContext context, com.hazelcast.client.impl.HazelcastClientInstanceImpl client)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    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()`
    `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()`

    - ### Methods inherited from class com.hazelcast.client.spi.ClientProxy

      `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`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface com.hazelcast.core.ITopic

      `getName`

    - ### Methods inherited from interface com.hazelcast.core.DistributedObject

      `destroy, getPartitionKey, getServiceName`

- - ### Constructor Detail

    - #### ClientReliableTopicProxy

          public ClientReliableTopicProxy(String objectId,
                                          ClientContext context,
                                          com.hazelcast.client.impl.HazelcastClientInstanceImpl client)

  - ### Method Detail

    - #### 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

    - #### 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

    - #### getRingbuffer

          public Ringbuffer getRingbuffer()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### postDestroy

          protected void postDestroy()

      Description copied from class: `ClientProxy`
      Called after proxy is destroyed.
      Overrides:
        `postDestroy` in class `ClientProxy`

Copyright © 2018. All rights reserved.