Top Description Fields Constructors Methods
javax.servlet

public Class AsyncEvent

extends Object
Class Inheritance

Event that gets fired when the asynchronous operation initiated on a ServletRequest (via a call to ServletRequest#startAsync or ServletRequest#startAsync(ServletRequest, ServletResponse)) has completed, timed out, or produced an error.
Since
Servlet 3.0

Field Summary

Modifier and TypeField and Description
private AsyncContext
private ServletRequest
private ServletResponse
private Throwable

Constructor Summary

AccessConstructor and Description
public
AsyncEvent(AsyncContext
the AsyncContex to be delivered with this AsyncEvent
context
)

Constructs an AsyncEvent from the given AsyncContext.

public
AsyncEvent(AsyncContext
the AsyncContex to be delivered with this AsyncEvent
context
,
ServletRequest
the ServletRequest to be delivered with this AsyncEvent
request
,
ServletResponse
the ServletResponse to be delivered with this AsyncEvent
response
)

Constructs an AsyncEvent from the given AsyncContext, ServletRequest, and ServletResponse.

public
AsyncEvent(AsyncContext
the AsyncContex to be delivered with this AsyncEvent
context
,
Throwable
the Throwable to be delivered with this AsyncEvent
throwable
)

Constructs an AsyncEvent from the given AsyncContext and Throwable.

public
AsyncEvent(AsyncContext
the AsyncContex to be delivered with this AsyncEvent
context
,
ServletRequest
the ServletRequest to be delivered with this AsyncEvent
request
,
ServletResponse
the ServletResponse to be delivered with this AsyncEvent
response
,
Throwable
the Throwable to be delivered with this AsyncEvent
throwable
)

Constructs an AsyncEvent from the given AsyncContext, ServletRequest, ServletResponse, and Throwable.

Method Summary

Modifier and TypeMethod and Description
public AsyncContext

Returns:

the AsyncContext that was used to initialize this AsyncEvent
getAsyncContext
()

Gets the AsyncContext from this AsyncEvent.

public ServletRequest

Returns:

the ServletRequest that was used to initialize this AsyncEvent, or null if this AsyncEvent was initialized without any ServletRequest
getSuppliedRequest
()

Gets the ServletRequest from this AsyncEvent.

public ServletResponse

Returns:

the ServletResponse that was used to initialize this AsyncEvent, or null if this AsyncEvent was initialized without any ServletResponse
getSuppliedResponse
()

Gets the ServletResponse from this AsyncEvent.

public Throwable

Returns:

the Throwable that was used to initialize this AsyncEvent, or null if this AsyncEvent was initialized without any Throwable
getThrowable
()

Gets the Throwable from this AsyncEvent.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

contextback to summary
private AsyncContext context
requestback to summary
private ServletRequest request
responseback to summary
private ServletResponse response
throwableback to summary
private Throwable throwable

Constructor Detail

AsyncEventback to summary
public AsyncEvent(AsyncContext context)

Constructs an AsyncEvent from the given AsyncContext.

Parameters
context:AsyncContext

the AsyncContex to be delivered with this AsyncEvent

AsyncEventback to summary
public AsyncEvent(AsyncContext context, ServletRequest request, ServletResponse response)

Constructs an AsyncEvent from the given AsyncContext, ServletRequest, and ServletResponse.

Parameters
context:AsyncContext

the AsyncContex to be delivered with this AsyncEvent

request:ServletRequest

the ServletRequest to be delivered with this AsyncEvent

response:ServletResponse

the ServletResponse to be delivered with this AsyncEvent

AsyncEventback to summary
public AsyncEvent(AsyncContext context, Throwable throwable)

Constructs an AsyncEvent from the given AsyncContext and Throwable.

Parameters
context:AsyncContext

the AsyncContex to be delivered with this AsyncEvent

throwable:Throwable

the Throwable to be delivered with this AsyncEvent

AsyncEventback to summary
public AsyncEvent(AsyncContext context, ServletRequest request, ServletResponse response, Throwable throwable)

Constructs an AsyncEvent from the given AsyncContext, ServletRequest, ServletResponse, and Throwable.

Parameters
context:AsyncContext

the AsyncContex to be delivered with this AsyncEvent

request:ServletRequest

the ServletRequest to be delivered with this AsyncEvent

response:ServletResponse

the ServletResponse to be delivered with this AsyncEvent

throwable:Throwable

the Throwable to be delivered with this AsyncEvent

Method Detail

getAsyncContextback to summary
public AsyncContext getAsyncContext()

Gets the AsyncContext from this AsyncEvent.

Returns:AsyncContext

the AsyncContext that was used to initialize this AsyncEvent

getSuppliedRequestback to summary
public ServletRequest getSuppliedRequest()

Gets the ServletRequest from this AsyncEvent.

If the AsyncListener to which this AsyncEvent is being delivered was added using AsyncContext#addListener(AsyncListener, ServletRequest, ServletResponse), the returned ServletRequest will be the same as the one supplied to the above method. If the AsyncListener was added via AsyncContext#addListener(AsyncListener), this method must return null.

Returns:ServletRequest

the ServletRequest that was used to initialize this AsyncEvent, or null if this AsyncEvent was initialized without any ServletRequest

getSuppliedResponseback to summary
public ServletResponse getSuppliedResponse()

Gets the ServletResponse from this AsyncEvent.

If the AsyncListener to which this AsyncEvent is being delivered was added using AsyncContext#addListener(AsyncListener, ServletRequest, ServletResponse), the returned ServletResponse will be the same as the one supplied to the above method. If the AsyncListener was added via AsyncContext#addListener(AsyncListener), this method must return null.

Returns:ServletResponse

the ServletResponse that was used to initialize this AsyncEvent, or null if this AsyncEvent was initialized without any ServletResponse

getThrowableback to summary
public Throwable getThrowable()

Gets the Throwable from this AsyncEvent.

Returns:Throwable

the Throwable that was used to initialize this AsyncEvent, or null if this AsyncEvent was initialized without any Throwable