ReadListener (Apache Tomcat 7.0.104 API Documentation)

org.apache.coyote.http11.upgrade.servlet31

## Interface ReadListener

- All Superinterfaces:
    EventListener

      public interface ReadListener
      extends EventListener

  Receives notification of read events when using non-blocking IO.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `onAllDataRead()` Invoked when the request body has been fully read.
    `void` | `onDataAvailable()` Invoked when data is available to read.
    `void` | `onError(Throwable throwable)` Invoked if an error occurs while reading the request body.

- - ### Method Detail

    - #### onDataAvailable

          void onDataAvailable()
                               throws IOException

      Invoked when data is available to read. The container will invoke this method the first time for a request as soon as there is data to read. Subsequent invocations will only occur if a call to `AbstractServletInputStream.isReady()` has returned false and data has subsequently become available to read.
      Throws:
        `IOException`

    - #### onAllDataRead

          void onAllDataRead()
                             throws IOException

      Invoked when the request body has been fully read.
      Throws:
        `IOException`

    - #### onError

          void onError(Throwable throwable)

      Invoked if an error occurs while reading the request body.
      Parameters:
        `throwable` - The exception that occurred

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