Home Servlets Servlet3 Class AsyncEvent important methods
Questions:Ask|Latest


 
 

Share on Google+Share on Google+

Class AsyncEvent important methods

Advertisement
In this section, you will learn about the important methods of AsyncEvent Class.

Class AsyncEvent important methods

In this section, you will learn about the important methods of AsyncEvent Class.

When an asynchronous events occurs, AsyncListener will receive an AsyncEvent . AsyncEvent contains the details of asynchronous events.

Need of AsyncEvent

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. These events occurrence notification helps you in defining code according to your need for asynchronous processing.

The essential methods / functions of AsyncEvent Class is given below :

AsyncEvent Method

Description

getAsyncContext() Using this method, you can obtain AsyncContext of this AsyncEvent which was employed to initialize it.
   
getSuppliedRequest() Using this function, you can obtain ServletRequest of this AsyncEvent which was utilized to employed it.
   
getSuppliedResponse() Using this function, you can obtain ServletResponse of this AsyncEvent which was utilized to employed it.
   
getThrowable() This function returns the Throwable that was employed to initialize AsyncEvent, it returns null if the AsyncEvent was initialized without any Throwable.
Advertisements

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 20, 2012

Ask Questions?    Discuss: Class AsyncEvent important methods  

Post your Comment


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