ChannelReceiver (Apache Tomcat 9.0.69 API Documentation)

Package org.apache.catalina.tribes

## Interface ChannelReceiver

- All Superinterfaces:
    `Heartbeat`
  All Known Implementing Classes:
    `BioReceiver`, `NioReceiver`, `ReceiverBase`

      public interface ChannelReceiver
      extends Heartbeat

  ChannelReceiver Interface
  The `ChannelReceiver` interface is the data receiver component at the bottom layer, the IO layer (for layers see the javadoc for the `Channel` interface). This class may optionally implement a thread pool for parallel processing of incoming messages.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static int` | `MAX_UDP_SIZE` |

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Channel` | `getChannel()` | Return the channel that is related to this ChannelReceiver
    `java.lang.String` | `getHost()` | String representation of the IPv4 or IPv6 address that this host is listening to.
    `MessageListener` | `getMessageListener()` | Returns the message listener that is associated with this receiver
    `int` | `getPort()` | Returns the listening port
    `int` | `getSecurePort()` | Returns the secure listening port
    `int` | `getUdpPort()` | Returns the UDP port
    `void` | `setChannel​(Channel channel)` | Set the channel that is related to this ChannelReceiver
    `void` | `setMessageListener​(MessageListener listener)` | Sets the message listener to receive notification of incoming
    `void` | `start()` | Start listening for incoming messages on the host/port
    `void` | `stop()` | Stop listening for messages

    - ### Methods inherited from interface org.apache.catalina.tribes.Heartbeat

      `heartbeat`

- - ### Field Detail

    - #### MAX_UDP_SIZE

          static final int MAX_UDP_SIZE

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### start

          void start()
              throws java.io.IOException

      Start listening for incoming messages on the host/port
      Throws:
        `java.io.IOException` - Listen failed

    - #### stop

          void stop()

      Stop listening for messages

    - #### getHost

          java.lang.String getHost()

      String representation of the IPv4 or IPv6 address that this host is listening to.
      Returns:
        the host that this receiver is listening to

    - #### getPort

          int getPort()

      Returns the listening port
      Returns:
        port

    - #### getSecurePort

          int getSecurePort()

      Returns the secure listening port
      Returns:
        port, -1 if a secure port is not activated

    - #### getUdpPort

          int getUdpPort()

      Returns the UDP port
      Returns:
        port, -1 if the UDP port is not activated.

    - #### setMessageListener

          void setMessageListener​(MessageListener listener)

      Sets the message listener to receive notification of incoming
      Parameters:
        `listener` - MessageListener
      See Also:
        `MessageListener`

    - #### getMessageListener

          MessageListener getMessageListener()

      Returns the message listener that is associated with this receiver
      Returns:
        MessageListener
      See Also:
        `MessageListener`

    - #### getChannel

          Channel getChannel()

      Return the channel that is related to this ChannelReceiver
      Returns:
        Channel

    - #### setChannel

          void setChannel​(Channel channel)

      Set the channel that is related to this ChannelReceiver
      Parameters:
        `channel` - The channel