AsyncListener Interface important methods

In this section, you will get to know about important methods AsyncListener Interface.

AsyncListener Interface important methods

AsyncListener Interface important  methods

In this section, you will get to know about important  methods AsyncListener Interface.

The AsyncListener will be notified when an asynchronous events occurs. These listeners will be notified in their creation/addition order.

Need of AsyncListener

AsyncEvent contains the details of the event occurred by the asynchronous processes. These events includes successfully completion of asynchronous cycle, times out, or results in an error . The AsyncListener will receive an AsyncEvent (asynchronous event object) when the above events(i.e. completion of asynchronous cycle, times out, or results in an error) occurs.

The AsyncListener will be notified in their creation/addition order.

The essential methods / functions of AsyncListener Interface is given below :

AsyncListener Method

Description

onComplete(AsyncEvent event) When an asynchronous operation has been finished, this method informs/notifies the AsyncListener about it.
   
onError(AsyncEvent event) When an asynchronous operation has failed to complete its task, this method informs/notifies the AsyncListener about it.
   
onStartAsync(AsyncEvent event) This method inform/notify AsyncListener about instantiation of a new asynchronous cycle.
   
onTimeout(AsyncEvent event) When an asynchronous operation timeout , this method informs/notifies the AsyncListener about it.