Top Description Methods
jakarta.servlet

public Interface AsyncListener

extends EventListener
Known Direct Implementers
jakarta.servlet.http.HttpServlet.NoBodyAsyncContextListener
Imports
java.io.IOException, java.util.EventListener

Listener for events associated with an AsyncContext.
Since
Servlet 3.0

Method Summary

Modifier and TypeMethod and Description
public void
onComplete(AsyncEvent
Provides access to the objects associated with the event
event
)

This event is fired after the call to AsyncContext#complete() has been processed by the container.

public void
onError(AsyncEvent
Provides access to the objects associated with the event
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.

public void
onStartAsync(AsyncEvent
Provides access to the objects associated with the event
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.

public void
onTimeout(AsyncEvent
Provides access to the objects associated with the event
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

onCompleteback to summary
public void onComplete(AsyncEvent event) throws IOException

This event is fired after the call to AsyncContext#complete() has been processed by the container.

Parameters
event:AsyncEvent

Provides access to the objects associated with the event

Exceptions
IOException:
Should be thrown if an I/O error occurs during the processing of the event
onErrorback to summary
public void onError(AsyncEvent event) throws 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:AsyncEvent

Provides access to the objects associated with the event

Exceptions
IOException:
Should be thrown if an I/O error occurs during the processing of the event
onStartAsyncback to summary
public void onStartAsync(AsyncEvent event) throws 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:AsyncEvent

Provides access to the objects associated with the event

Exceptions
IOException:
Should be thrown if an I/O error occurs during the processing of the event
onTimeoutback to summary
public void onTimeout(AsyncEvent event) throws 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:AsyncEvent

Provides access to the objects associated with the event

Exceptions
IOException:
Should be thrown if an I/O error occurs during the processing of the event