MessageInbound (Apache Tomcat 7.0.104 API Documentation)

org.apache.catalina.websocket

## Class MessageInbound

- java.lang.Object
- - org.apache.catalina.websocket.StreamInbound
  - - org.apache.catalina.websocket.MessageInbound

- All Implemented Interfaces:
    UpgradeInbound

  Deprecated.
  Replaced by the JSR356 WebSocket 1.1 implementation and will be removed in Tomcat 8.0.x.

      @Deprecated
      public abstract class MessageInbound
      extends StreamInbound

  Base implementation of the class used to process WebSocket connections based on messages. Applications should extend this class to provide application specific functionality. Applications that wish to operate on a stream basis rather than a message basis should use `StreamInbound`.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MessageInbound()` Deprecated.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getByteBufferMaxSize()` Deprecated. Obtain the current maximum size (in bytes) of the buffer used for binary messages.
    `int` | `getCharBufferMaxSize()` Deprecated. Obtain the current maximum size (in characters) of the buffer used for binary messages.
    `protected void` | `onBinaryData(InputStream is)` Deprecated. This method is called when there is a binary WebSocket message available to process.
    `protected abstract void` | `onBinaryMessage(ByteBuffer message)` Deprecated. This method is called when there is a binary WebSocket message available to process.
    `protected void` | `onTextData(Reader r)` Deprecated. This method is called when there is a textual WebSocket message available to process.
    `protected abstract void` | `onTextMessage(CharBuffer message)` Deprecated. This method is called when there is a textual WebSocket message available to process.
    `void` | `setByteBufferMaxSize(int byteBufferMaxSize)` Deprecated. Set the maximum size (in bytes) of the buffer used for binary messages.
    `void` | `setCharBufferMaxSize(int charBufferMaxSize)` Deprecated. Set the maximum size (in characters) of the buffer used for textual messages.

    - ### Methods inherited from class org.apache.catalina.websocket.StreamInbound

      `getOutboundByteBufferSize, getOutboundCharBufferSize, getReadTimeout, getWsOutbound, onClose, onData, onOpen, onPong, onUpgradeComplete, setOutboundByteBufferSize, setOutboundCharBufferSize, setUpgradeOutbound, setUpgradeProcessor`

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

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

- - ### Constructor Detail

    - #### MessageInbound

          public MessageInbound()

      Deprecated.

  - ### Method Detail

    - #### onBinaryData

          protected final void onBinaryData(InputStream is)
                                     throws IOException

      Deprecated.
      Description copied from class: `StreamInbound`
      This method is called when there is a binary WebSocket message available to process. The message is presented via a stream and may be formed from one or more frames. The number of frames used to transmit the message is not made visible to the application.
      Specified by:
        `onBinaryData` in class `StreamInbound`
      Parameters:
        `is` - The WebSocket message
      Throws:
        `IOException` - If a problem occurs processing the message. Any exception will trigger the closing of the WebSocket connection.

    - #### onTextData

          protected final void onTextData(Reader r)
                                   throws IOException

      Deprecated.
      Description copied from class: `StreamInbound`
      This method is called when there is a textual WebSocket message available to process. The message is presented via a reader and may be formed from one or more frames. The number of frames used to transmit the message is not made visible to the application.
      Specified by:
        `onTextData` in class `StreamInbound`
      Parameters:
        `r` - The WebSocket message
      Throws:
        `IOException` - If a problem occurs processing the message. Any exception will trigger the closing of the WebSocket connection.

    - #### getByteBufferMaxSize

          public final int getByteBufferMaxSize()

      Deprecated.
      Obtain the current maximum size (in bytes) of the buffer used for binary messages.

    - #### setByteBufferMaxSize

          public final void setByteBufferMaxSize(int byteBufferMaxSize)

      Deprecated.
      Set the maximum size (in bytes) of the buffer used for binary messages.

    - #### getCharBufferMaxSize

          public final int getCharBufferMaxSize()

      Deprecated.
      Obtain the current maximum size (in characters) of the buffer used for binary messages.

    - #### setCharBufferMaxSize

          public final void setCharBufferMaxSize(int charBufferMaxSize)

      Deprecated.
      Set the maximum size (in characters) of the buffer used for textual messages.

    - #### onBinaryMessage

          protected abstract void onBinaryMessage(ByteBuffer message)
                                           throws IOException

      Deprecated.
      This method is called when there is a binary WebSocket message available to process. The message is presented via a ByteBuffer and may have been formed from one or more frames. The number of frames used to transmit the message is not made visible to the application.
      Parameters:
        `message` - The WebSocket message
      Throws:
        `IOException` - If a problem occurs processing the message. Any exception will trigger the closing of the WebSocket connection.

    - #### onTextMessage

          protected abstract void onTextMessage(CharBuffer message)
                                         throws IOException

      Deprecated.
      This method is called when there is a textual WebSocket message available to process. The message is presented via a CharBuffer and may have been formed from one or more frames. The number of frames used to transmit the message is not made visible to the application.
      Parameters:
        `message` - The WebSocket message
      Throws:
        `IOException` - If a problem occurs processing the message. Any exception will trigger the closing of the WebSocket connection.

Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.