Package javax.servlet

## Interface AsyncListener

- All Superinterfaces:
    `java.util.EventListener`

      public interface AsyncListener
      extends java.util.EventListener

  Listener for events associated with an `AsyncContext`.
  Since:
    Servlet 3.0

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `onComplete​(AsyncEvent event)` | This event is fired after the call to `AsyncContext.complete()` has been processed by the container.
    `void` | `onError​(AsyncEvent event)` | This event is fired if an error occurs during an asynchronous operation but before the container takes any action as a result of the error.
    `void` | `onStartAsync​(AsyncEvent event)` | This event is fired if new call is made to `ServletRequest.startAsync()` after the completion of the `AsyncContext` to which this listener was added.
    `void` | `onTimeout​(AsyncEvent event)` | This event is fired if an asynchronous operation times out but before the container takes any action as a result of the timeout.

- - ### Method Detail

    - #### onComplete

          void onComplete​(AsyncEvent event)
                   throws java.io.IOException

      This event is fired after the call to `AsyncContext.complete()` has been processed by the container.
      Parameters:
        `event` - Provides access to the objects associated with the event
      Throws:
        `java.io.IOException` - Should be thrown if an I/O error occurs during the processing of the event

    - #### onTimeout

          void onTimeout​(AsyncEvent event)
                  throws java.io.IOException

      This event is fired if an asynchronous operation times out but before the container takes any action as a result of the timeout.
      Parameters:
        `event` - Provides access to the objects associated with the event
      Throws:
        `java.io.IOException` - Should be thrown if an I/O error occurs during the processing of the event

    - #### onError

          void onError​(AsyncEvent event)
                throws java.io.IOException

      This event is fired if an error occurs during an asynchronous operation but before the container takes any action as a result of the error.
      Parameters:
        `event` - Provides access to the objects associated with the event
      Throws:
        `java.io.IOException` - Should be thrown if an I/O error occurs during the processing of the event

    - #### onStartAsync

          void onStartAsync​(AsyncEvent event)
                     throws java.io.IOException

      This event is fired if new call is made to `ServletRequest.startAsync()` after the completion of the `AsyncContext` to which this listener was added.
      Parameters:
        `event` - Provides access to the objects associated with the event
      Throws:
        `java.io.IOException` - Should be thrown if an I/O error occurs during the processing of the event