Package jakarta.servlet

## Class AsyncEvent

- java.lang.Object
- - jakarta.servlet.AsyncEvent

-     public class AsyncEvent
      extends java.lang.Object

  Used to pass data to the methods of `AsyncListener`.
  Since:
    Servlet 3.0

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `AsyncEvent​(AsyncContext context)` | Creates an instance using the provide parameters.
    `AsyncEvent​(AsyncContext context, ServletRequest request, ServletResponse response)` | Creates an instance using the provide parameters.
    `AsyncEvent​(AsyncContext context, ServletRequest request, ServletResponse response, java.lang.Throwable throwable)` | Creates an instance using the provide parameters.
    `AsyncEvent​(AsyncContext context, java.lang.Throwable throwable)` | Creates an instance using the provide parameters.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `AsyncContext` | `getAsyncContext()` | Obtain the asynchronous context associated with the event.
    `ServletRequest` | `getSuppliedRequest()` | Obtain the request associated with the event.
    `ServletResponse` | `getSuppliedResponse()` | Obtain the response associated with the event.
    `java.lang.Throwable` | `getThrowable()` | Obtain the throwable associated with the event.

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

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

- - ### Constructor Detail

    - #### AsyncEvent

          public AsyncEvent​(AsyncContext context)

      Creates an instance using the provide parameters.
      Parameters:
        `context` - The asynchronous context associated with the event

    - #### AsyncEvent

          public AsyncEvent​(AsyncContext context,
                            ServletRequest request,
                            ServletResponse response)

      Creates an instance using the provide parameters.
      Parameters:
        `context` - The asynchronous context associated with the event
        `request` - The request associated with the event
        `response` - The response associated with the event

    - #### AsyncEvent

          public AsyncEvent​(AsyncContext context,
                            java.lang.Throwable throwable)

      Creates an instance using the provide parameters.
      Parameters:
        `context` - The asynchronous context associated with the event
        `throwable` - The throwable associated with the event

    - #### AsyncEvent

          public AsyncEvent​(AsyncContext context,
                            ServletRequest request,
                            ServletResponse response,
                            java.lang.Throwable throwable)

      Creates an instance using the provide parameters.
      Parameters:
        `context` - The asynchronous context associated with the event
        `request` - The request associated with the event
        `response` - The response associated with the event
        `throwable` - The throwable associated with the event

  - ### Method Detail

    - #### getAsyncContext

          public AsyncContext getAsyncContext()

      Obtain the asynchronous context associated with the event.
      Returns:
        The asynchronous context associated with the event or `null` if one was not specified

    - #### getSuppliedRequest

          public ServletRequest getSuppliedRequest()

      Obtain the request associated with the event.
      Returns:
        The request associated with the event or `null` if one was not specified

    - #### getSuppliedResponse

          public ServletResponse getSuppliedResponse()

      Obtain the response associated with the event.
      Returns:
        The response associated with the event or `null` if one was not specified

    - #### getThrowable

          public java.lang.Throwable getThrowable()

      Obtain the throwable associated with the event.
      Returns:
        The throwable associated with the event or `null` if one was not specified