AsyncContextImpl (Apache Tomcat 7.0.96 API Documentation)

org.apache.catalina.core

## Class AsyncContextImpl

- java.lang.Object
- - org.apache.catalina.core.AsyncContextImpl

- All Implemented Interfaces:
    AsyncContext, AsyncContextCallback

      public class AsyncContextImpl
      extends java.lang.Object
      implements AsyncContext, AsyncContextCallback

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static StringManager` | `sm`

    - ### Fields inherited from interface javax.servlet.AsyncContext

      `ASYNC_CONTEXT_PATH, ASYNC_PATH_INFO, ASYNC_QUERY_STRING, ASYNC_REQUEST_URI, ASYNC_SERVLET_PATH`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AsyncContextImpl(Request request)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addListener(AsyncListener listener)`
    `void` | `addListener(AsyncListener listener, ServletRequest servletRequest, ServletResponse servletResponse)`
    `void` | `complete()`
    `<T extends AsyncListener> T` | `createListener(java.lang.Class<T> clazz)`
    `void` | `dispatch()`
    `void` | `dispatch(ServletContext servletContext, java.lang.String path)`
    `void` | `dispatch(java.lang.String path)`
    `protected void` | `doInternalDispatch()`
    `void` | `fireOnComplete()`
    `ServletRequest` | `getRequest()`
    `ServletResponse` | `getResponse()`
    `long` | `getTimeout()` Get the current.
    `boolean` | `hasOriginalRequestAndResponse()`
    `boolean` | `isAvailable()` Reports if the web application associated with this async request is available.
    `boolean` | `isStarted()`
    `void` | `recycle()`
    `void` | `setErrorState(java.lang.Throwable t, boolean fireOnError)`
    `void` | `setStarted(Context context, ServletRequest request, ServletResponse response, boolean originalRequestResponse)`
    `void` | `setTimeout(long timeout)` Set the timeout.
    `void` | `start(java.lang.Runnable run)`
    `boolean` | `timeout()`

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

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

- - ### Field Detail

    - #### sm

          protected static final StringManager sm

  - ### Constructor Detail

    - #### AsyncContextImpl

          public AsyncContextImpl(Request request)

  - ### Method Detail

    - #### complete

          public void complete()

      Specified by:
        `complete` in interface `AsyncContext`

    - #### fireOnComplete

          public void fireOnComplete()

      Specified by:
        `fireOnComplete` in interface `AsyncContextCallback`

    - #### timeout

          public boolean timeout()

    - #### dispatch

          public void dispatch()

      Specified by:
        `dispatch` in interface `AsyncContext`

    - #### dispatch

          public void dispatch(java.lang.String path)

      Specified by:
        `dispatch` in interface `AsyncContext`
      Parameters:
        `path` - The path to which the request/response should be dispatched relative to the `ServletContext` from which this async request was started.

    - #### dispatch

          public void dispatch(ServletContext servletContext,
                      java.lang.String path)

      Specified by:
        `dispatch` in interface `AsyncContext`
      Parameters:
        `servletContext` - The `ServletContext` to which the request/response should be dispatched.
        `path` - The path to which the request/response should be dispatched relative to the specified `ServletContext`.

    - #### getRequest

          public ServletRequest getRequest()

      Specified by:
        `getRequest` in interface `AsyncContext`

    - #### getResponse

          public ServletResponse getResponse()

      Specified by:
        `getResponse` in interface `AsyncContext`

    - #### start

          public void start(java.lang.Runnable run)

      Specified by:
        `start` in interface `AsyncContext`

    - #### addListener

          public void addListener(AsyncListener listener)

      Specified by:
        `addListener` in interface `AsyncContext`

    - #### addListener

          public void addListener(AsyncListener listener,
                         ServletRequest servletRequest,
                         ServletResponse servletResponse)

      Specified by:
        `addListener` in interface `AsyncContext`

    - #### createListener

          public <T extends AsyncListener> T createListener(java.lang.Class<T> clazz)
                                                 throws ServletException

      Specified by:
        `createListener` in interface `AsyncContext`
      Throws:
        `ServletException`

    - #### recycle

          public void recycle()

    - #### isStarted

          public boolean isStarted()

    - #### setStarted

          public void setStarted(Context context,
                        ServletRequest request,
                        ServletResponse response,
                        boolean originalRequestResponse)

    - #### hasOriginalRequestAndResponse

          public boolean hasOriginalRequestAndResponse()

      Specified by:
        `hasOriginalRequestAndResponse` in interface `AsyncContext`

    - #### doInternalDispatch

          protected void doInternalDispatch()
                                     throws ServletException,
                                            java.io.IOException

      Throws:
        `ServletException`
        `java.io.IOException`

    - #### getTimeout

          public long getTimeout()

      Description copied from interface: `javax.servlet.AsyncContext`
      Get the current.
      Specified by:
        `getTimeout` in interface `AsyncContext`
      Returns:
        The timeout in milliseconds. 0 or less indicates no timeout.

    - #### setTimeout

          public void setTimeout(long timeout)

      Description copied from interface: `javax.servlet.AsyncContext`
      Set the timeout.
      Specified by:
        `setTimeout` in interface `AsyncContext`
      Parameters:
        `timeout` - The timeout in milliseconds. 0 or less indicates no timeout.

    - #### isAvailable

          public boolean isAvailable()

      Description copied from interface: `AsyncContextCallback`
      Reports if the web application associated with this async request is available.
      Specified by:
        `isAvailable` in interface `AsyncContextCallback`
      Returns:
        `true` if the associated web application is available, otherwise `false`

    - #### setErrorState

          public void setErrorState(java.lang.Throwable t,
                           boolean fireOnError)

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