Package jakarta.portlet
Class PortletAsyncEvent
- java.lang.Object
-
- jakarta.portlet.PortletAsyncEvent
-
public class PortletAsyncEvent extends Object
Event that gets fired when the asynchronous operation initiated on aResourceRequest(via a call toResourceRequest#startAsyncorResourceRequest#startAsync(ResourceRequest, ResouceResponse))has completed, timed out, or produced an error.- Since:
- 3.0
- See Also:
PortletAsyncContext,PortletAsyncEvent,ResourceRequest
-
-
Constructor Summary
Constructors Constructor Description PortletAsyncEvent(PortletAsyncContext context)Constructs aPortletAsyncEventfrom the givenPortletAsyncContext.PortletAsyncEvent(PortletAsyncContext context, ResourceRequest request, ResourceResponse response)Constructs aPortletAsyncEventfrom the givenPortletAsyncContext,ResourceRequest, andResourceResponse.PortletAsyncEvent(PortletAsyncContext context, ResourceRequest request, ResourceResponse response, Throwable throwable)Constructs aPortletAsyncEventfrom the givenPortletAsyncContext,ResourceRequest,ResourceResponse, andThrowable.PortletAsyncEvent(PortletAsyncContext context, Throwable throwable)Constructs aPortletAsyncEventfrom the givenPortletAsyncContextandThrowable.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PortletAsyncContextgetPortletAsyncContext()Gets the portlet asynchronous context object associated with the event.ResourceRequestgetSuppliedRequest()Gets the resource request associated with the listener when it was added through thePortletAsyncContext#addListener(PortletAsyncListener, ResourceRequest, ResourceResponse)method.ResourceResponsegetSuppliedResponse()Gets the resource response associated with the listener when it was added through thePortletAsyncContext#addListener(PortletAsyncListener, ResourceRequest, ResourceResponse)method.ThrowablegetThrowable()Gets theThrowableassociated with the event.
-
-
-
Constructor Detail
-
PortletAsyncEvent
public PortletAsyncEvent(PortletAsyncContext context, ResourceRequest request, ResourceResponse response, Throwable throwable)
Constructs aPortletAsyncEventfrom the givenPortletAsyncContext,ResourceRequest,ResourceResponse, andThrowable.- Parameters:
context- the async contextrequest- the resource requestresponse- the resource responsethrowable- the error condition that is associated with the async event
-
PortletAsyncEvent
public PortletAsyncEvent(PortletAsyncContext context, ResourceRequest request, ResourceResponse response)
Constructs aPortletAsyncEventfrom the givenPortletAsyncContext,ResourceRequest, andResourceResponse.- Parameters:
context- the async contextrequest- the resource requestresponse- the resource response
-
PortletAsyncEvent
public PortletAsyncEvent(PortletAsyncContext context, Throwable throwable)
Constructs aPortletAsyncEventfrom the givenPortletAsyncContextandThrowable.- Parameters:
context- the async contextthrowable- the error condition that is associated with the async event
-
PortletAsyncEvent
public PortletAsyncEvent(PortletAsyncContext context)
Constructs aPortletAsyncEventfrom the givenPortletAsyncContext.- 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 thePortletAsyncContext#addListener(PortletAsyncListener, ResourceRequest, ResourceResponse)method.If the listener was added through the
PortletAsyncContext#addListener(PortletAsyncListener)method, the returned resource request will benull.- Returns:
- the resource request provided to the constructor, or
nullif no resource request was provided.
-
getSuppliedResponse
public ResourceResponse getSuppliedResponse()
Gets the resource response associated with the listener when it was added through thePortletAsyncContext#addListener(PortletAsyncListener, ResourceRequest, ResourceResponse)method.If the listener was added through the
PortletAsyncContext#addListener(PortletAsyncListener)method, the returned resource response will benull.- Returns:
- the resource response provided to the constructor, or
nullif no resource response was provided.
-
getThrowable
public Throwable getThrowable()
Gets theThrowableassociated with the event.- Returns:
- The
Throwablethat was used to initialize the event, ornullif noThrowablewas provided.
-
-