Home Servlets Servlet3 AsyncListener Interface important methods
Questions:Ask|Latest


 
 

Share on Google+Share on Google+

AsyncListener Interface important methods

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

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.

 

Advertisement

Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: June 18, 2012

Ask Questions?    Discuss: AsyncListener Interface important methods  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
DMCA.com