Class PortletAsyncEvent


  • public class PortletAsyncEvent
    extends Object
    Event that gets fired when the asynchronous operation initiated on a ResourceRequest (via a call to ResourceRequest#startAsync or ResourceRequest#startAsync(ResourceRequest, ResouceResponse)) has completed, timed out, or produced an error.
    Since:
    3.0
    See Also:
    PortletAsyncContext, PortletAsyncEvent, ResourceRequest
    • Constructor Detail

      • PortletAsyncEvent

        public PortletAsyncEvent​(PortletAsyncContext context,
                                 ResourceRequest request,
                                 ResourceResponse response,
                                 Throwable throwable)
        Constructs a PortletAsyncEvent from the given PortletAsyncContext, ResourceRequest, ResourceResponse, and Throwable.
        Parameters:
        context - the async context
        request - the resource request
        response - the resource response
        throwable - the error condition that is associated with the async event
      • PortletAsyncEvent

        public PortletAsyncEvent​(PortletAsyncContext context,
                                 ResourceRequest request,
                                 ResourceResponse response)
        Constructs a PortletAsyncEvent from the given PortletAsyncContext, ResourceRequest, and ResourceResponse.
        Parameters:
        context - the async context
        request - the resource request
        response - the resource response
      • PortletAsyncEvent

        public PortletAsyncEvent​(PortletAsyncContext context,
                                 Throwable throwable)
        Constructs a PortletAsyncEvent from the given PortletAsyncContext and Throwable.
        Parameters:
        context - the async context
        throwable - the error condition that is associated with the async event
      • PortletAsyncEvent

        public PortletAsyncEvent​(PortletAsyncContext context)
        Constructs a PortletAsyncEvent from the given PortletAsyncContext.
        Parameters:
        context - the async context
    • Method Detail

      • getPortletAsyncContext

        public PortletAsyncContext getPortletAsyncContext()
        Gets the portlet asynchronous context object associated with the event.
        Returns:
        the portlet asynchronous context
      • getSuppliedRequest

        public ResourceRequest getSuppliedRequest()
        Gets the resource request associated with the listener when it was added through the PortletAsyncContext#addListener(PortletAsyncListener, ResourceRequest, ResourceResponse) method.

        If the listener was added through the PortletAsyncContext#addListener(PortletAsyncListener) method, the returned resource request will be null.

        Returns:
        the resource request provided to the constructor, or null if no resource request was provided.
      • getSuppliedResponse

        public ResourceResponse getSuppliedResponse()
        Gets the resource response associated with the listener when it was added through the PortletAsyncContext#addListener(PortletAsyncListener, ResourceRequest, ResourceResponse) method.

        If the listener was added through the PortletAsyncContext#addListener(PortletAsyncListener) method, the returned resource response will be null.

        Returns:
        the resource response provided to the constructor, or null if no resource response was provided.
      • getThrowable

        public Throwable getThrowable()
        Gets the Throwable associated with the event.
        Returns:
        The Throwable that was used to initialize the event, or null if no Throwable was provided.