Interface PortletAsyncListener


  • public interface PortletAsyncListener
    Listener that will be notified in the event that an asynchronous operation initiated on a ResourceRequest to which the listener had been added has completed, timed out, or resulted in an error.
    Since:
    3.0
    See Also:
    PortletAsyncContext, PortletAsyncEvent
    • Method Detail

      • onComplete

        void onComplete​(PortletAsyncEvent evt)
                 throws IOException
        Notifies this PortletAsyncListener that an asynchronous operation has been completed.

        The PortletAsyncContext corresponding to the asynchronous operation that has been completed may be obtained by calling getAsyncContext on the given event.

        In addition, if this PortletAsyncListener had been registered via a call to PortletAsyncContext#addListener(PortletAsyncListener, ResourceRequest, ResourceResponse), the supplied ResourceRequest and ResourceResponse objects may be retrieved by calling getSuppliedRequest and getSuppliedResponse, respectively, on the given event.

        The PortletAsyncContext dispatch and complete methods may not be invoked within this method.

        Parameters:
        evt - the PortletAsyncEvent indicating 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 this PortletAsyncListener that an asynchronous operation has failed to complete.

        The PortletAsyncContext corresponding to the asynchronous operation that failed to complete may be obtained by calling getAsyncContext on the given event.

        In addition, if this PortletAsyncListener had been registered via a call to PortletAsyncContext#addListener(PortletAsyncListener, ResourceRequest, ResourceResponse), the supplied ResourceRequest and ResourceResponse objects may be retrieved by calling getSuppliedRequest and getSuppliedResponse, respectively, on the given event.

        The PortletAsyncContext dispatch 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 this PortletAsyncListener that a new asynchronous cycle is being initiated via a call to one of the ResourceRequest#startAsync methods.

        The PortletAsyncContext corresponding to the asynchronous operation that is being reinitialized may be obtained by calling getAsyncContext on the given event.

        In addition, if this PortletAsyncListener had been registered via a call to PortletAsyncContext#addListener(PortletAsyncListener, ResourceRequest, ResourceResponse), the supplied ResourceRequest and ResourceResponse objects may be retrieved by calling getSuppliedRequest and getSuppliedResponse, respectively, on the given event.

        This PortletAsyncListener will not receive any events related to the new asynchronous cycle unless it registers itself (via a call to PortletAsyncContext#addListener) with the PortletAsyncContext that 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 this PortletAsyncListener that an asynchronous operation has timed out.

        The PortletAsyncContext corresponding to the asynchronous operation that has timed out may be obtained by calling getAsyncContext on the given event.

        In addition, if this PortletAsyncListener had been registered via a call to PortletAsyncContext#addListener(PortletAsyncListener, ResourceRequest, ResourceResponse), the supplied ResourceRequest and ResourceResponse objects may be retrieved by calling getSuppliedRequest and getSuppliedResponse, respectively, on the given event.

        The PortletAsyncContext dispatch 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