org.springframework.messaging.support

## Class AbstractSubscribableChannel

- java.lang.Object
- - org.springframework.messaging.support.AbstractMessageChannel
  - - org.springframework.messaging.support.AbstractSubscribableChannel

- All Implemented Interfaces:
    Aware, BeanNameAware, MessageChannel, SubscribableChannel
  Direct Known Subclasses:
    ExecutorSubscribableChannel

      public abstract class AbstractSubscribableChannel
      extends AbstractMessageChannel
      implements SubscribableChannel

  Abstract base class for `SubscribableChannel` implementations.
  Since:
    4.0
  Author:
    Rossen Stoyanchev

- - ### Field Summary

    - ### Fields inherited from class org.springframework.messaging.support.AbstractMessageChannel

      `logger`

    - ### Fields inherited from interface org.springframework.messaging.MessageChannel

      `INDEFINITE_TIMEOUT`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractSubscribableChannel()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Set<MessageHandler>` | `getSubscribers()`
    `boolean` | `hasSubscription(MessageHandler handler)`
    `boolean` | `subscribe(MessageHandler handler)` Register a message handler.
    `boolean` | `unsubscribe(MessageHandler handler)` Un-register a message handler.

    - ### Methods inherited from class org.springframework.messaging.support.AbstractMessageChannel

      `addInterceptor, getBeanName, getInterceptorChain, getInterceptors, send, send, sendInternal, setBeanName, setInterceptors, toString`

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

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

    - ### Methods inherited from interface org.springframework.messaging.MessageChannel

      `send, send`

- - ### Constructor Detail

    - #### AbstractSubscribableChannel

          public AbstractSubscribableChannel()

  - ### Method Detail

    - #### getSubscribers

          public Set<MessageHandler> getSubscribers()

    - #### hasSubscription

          public boolean hasSubscription(MessageHandler handler)

    - #### subscribe

          public boolean subscribe(MessageHandler handler)

      Description copied from interface: `SubscribableChannel`
      Register a message handler.
      Specified by:
        `subscribe` in interface `SubscribableChannel`
      Returns:
        `true` if the handler was subscribed or `false` if it was already subscribed.

    - #### unsubscribe

          public boolean unsubscribe(MessageHandler handler)

      Description copied from interface: `SubscribableChannel`
      Un-register a message handler.
      Specified by:
        `unsubscribe` in interface `SubscribableChannel`
      Returns:
        `true` if the handler was un-registered, or `false` if was not registered.