Interface PortletAsyncListener
-
public interface PortletAsyncListenerListener that will be notified in the event that an asynchronous operation initiated on aResourceRequestto which the listener had been added has completed, timed out, or resulted in an error.- Since:
- 3.0
- See Also:
PortletAsyncContext,PortletAsyncEvent
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidonComplete(PortletAsyncEvent evt)Notifies thisPortletAsyncListenerthat an asynchronous operation has been completed.voidonError(PortletAsyncEvent evt)Notifies thisPortletAsyncListenerthat an asynchronous operation has failed to complete.voidonStartAsync(PortletAsyncEvent evt)Notifies thisPortletAsyncListenerthat a new asynchronous cycle is being initiated via a call to one of theResourceRequest#startAsync methods.voidonTimeout(PortletAsyncEvent evt)Notifies thisPortletAsyncListenerthat an asynchronous operation has timed out.
-
-
-
Method Detail
-
onComplete
void onComplete(PortletAsyncEvent evt) throws IOException
Notifies thisPortletAsyncListenerthat an asynchronous operation has been completed.The
PortletAsyncContextcorresponding to the asynchronous operation that has been completed may be obtained by callinggetAsyncContexton the given event.In addition, if this
PortletAsyncListenerhad been registered via a call toPortletAsyncContext#addListener(PortletAsyncListener, ResourceRequest, ResourceResponse), the suppliedResourceRequestandResourceResponseobjects may be retrieved by callinggetSuppliedRequestandgetSuppliedResponse, respectively, on the given event.The
PortletAsyncContextdispatch and complete methods may not be invoked within this method.- Parameters:
evt- thePortletAsyncEventindicating that an asynchronous operation has been completed- Throws:
IOException- if an I/O related error has occurred during the processing
-
onError
void onError(PortletAsyncEvent evt) throws IOException
Notifies thisPortletAsyncListenerthat an asynchronous operation has failed to complete.The
PortletAsyncContextcorresponding to the asynchronous operation that failed to complete may be obtained by callinggetAsyncContexton the given event.In addition, if this
PortletAsyncListenerhad been registered via a call toPortletAsyncContext#addListener(PortletAsyncListener, ResourceRequest, ResourceResponse), the suppliedResourceRequestandResourceResponseobjects may be retrieved by callinggetSuppliedRequestandgetSuppliedResponse, respectively, on the given event.The
PortletAsyncContextdispatch and complete methods may be invoked within this method.- Parameters:
evt- the PortletAsyncEvent indicating that an asynchronous operation has encountered an error- Throws:
IOException- if an I/O related error has occurred during the processing
-
onStartAsync
void onStartAsync(PortletAsyncEvent evt) throws IOException
Notifies thisPortletAsyncListenerthat a new asynchronous cycle is being initiated via a call to one of theResourceRequest#startAsync methods.The
PortletAsyncContextcorresponding to the asynchronous operation that is being reinitialized may be obtained by callinggetAsyncContexton the given event.In addition, if this
PortletAsyncListenerhad been registered via a call toPortletAsyncContext#addListener(PortletAsyncListener, ResourceRequest, ResourceResponse), the suppliedResourceRequestandResourceResponseobjects may be retrieved by callinggetSuppliedRequestandgetSuppliedResponse, respectively, on the given event.This
PortletAsyncListenerwill not receive any events related to the new asynchronous cycle unless it registers itself (via a call toPortletAsyncContext#addListener) with thePortletAsyncContextthat is delivered as part of the given event.- Parameters:
evt- the PortletAsyncEvent indicating that an asynchronous operation is being initiated- Throws:
IOException- if an I/O related error has occurred during the processing
-
onTimeout
void onTimeout(PortletAsyncEvent evt) throws IOException
Notifies thisPortletAsyncListenerthat an asynchronous operation has timed out.The
PortletAsyncContextcorresponding to the asynchronous operation that has timed out may be obtained by callinggetAsyncContexton the given event.In addition, if this
PortletAsyncListenerhad been registered via a call toPortletAsyncContext#addListener(PortletAsyncListener, ResourceRequest, ResourceResponse), the suppliedResourceRequestandResourceResponseobjects may be retrieved by callinggetSuppliedRequestandgetSuppliedResponse, respectively, on the given event.The
PortletAsyncContextdispatch and complete methods may be invoked within this method.- Parameters:
evt- the PortletAsyncEvent indicating that an asynchronous operation has timed out- Throws:
IOException- if an I/O related error has occurred during the processing
-
-