Class AbstractRedisListenerEndpoint

java.lang.Object
org.springframework.data.redis.config.AbstractRedisListenerEndpoint
All Implemented Interfaces:
Lifecycle, Phased, SmartLifecycle, RedisListenerEndpoint
Direct Known Subclasses:
MethodRedisListenerEndpoint, SimpleRedisListenerEndpoint

public abstract class AbstractRedisListenerEndpoint extends Object implements RedisListenerEndpoint, SmartLifecycle
Base model for a Redis listener endpoint.
Since:
4.1
Author:
Ilyass Bougati, Mark Paluch, Christoph Strobl
  • Constructor Details

    • AbstractRedisListenerEndpoint

      public AbstractRedisListenerEndpoint()
  • Method Details

    • setId

      public void setId(String id)
      Set a custom id for this endpoint.
    • getId

      public String getId()
      Return the id of this endpoint (possibly generated).
      Specified by:
      getId in interface RedisListenerEndpoint
    • setTopic

      public void setTopic(@Nullable String topic)
      Set the name of the topic for this endpoint.
    • getTopic

      public @Nullable String getTopic()
      Return the name of the topic for this endpoint.
    • register

      public void register(RedisMessageListenerContainer listenerContainer)
      Description copied from interface: RedisListenerEndpoint
      Set up the specified message listener container with the model defined by this endpoint.

      This endpoint must provide the requested missing option(s) of the specified container to make it usable. Usually, this is about setting the destination and the messageListener to use but an implementation may override any default setting that was already set.

      Specified by:
      register in interface RedisListenerEndpoint
      Parameters:
      listenerContainer - the listener container to configure
    • createListener

      protected abstract @Nullable MessageListener createListener()
      Create the MessageListener for this endpoint.
    • start

      public void start()
      Specified by:
      start in interface Lifecycle
    • stop

      public void stop()
      Specified by:
      stop in interface Lifecycle
    • isRunning

      public boolean isRunning()
      Specified by:
      isRunning in interface Lifecycle
    • getEndpointDescription

      protected StringBuilder getEndpointDescription()
      Return a description for this endpoint.

      Available to subclasses, for inclusion in their toString() result.

    • toString

      public String toString()
      Overrides:
      toString in class Object