Package org.apache.tapestry5.http
Class AsyncRequestHandlerResponse
java.lang.Object
org.apache.tapestry5.http.AsyncRequestHandlerResponse
Class used by AsyncRequestHandler to return information on how to handle
a request.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAsyncRequestHandlerResponse(Executor executor) Creates an instance with a givenExecutor. -
Method Summary
Modifier and TypeMethodDescriptionReturns theExecutorto be used to process the request.javax.servlet.AsyncListenerReturns the listener to be added to the asynchronous request or null.javax.servlet.http.HttpServletRequestReturns the request to be used withServletRequest.startAsync()or null.javax.servlet.http.HttpServletResponseReturns the response to be used withServletRequest.startAsync()or null.longReturns the timeout, in milliseconds, for the asynchronous request.booleanisAsync()Returns whether the request should be processed asynchronously or not.booleanReturns whether a request and a response were set in this object.static AsyncRequestHandlerResponseReturns a response saying this AsyncRequestHandler doesn't handle this request.toString()with(javax.servlet.AsyncListener listener) Defines a listener to be added to the asynchronous request.with(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Defines a different request and response to be passed toServletRequest.startAsync(javax.servlet.ServletRequest, javax.servlet.ServletResponse).withTimeout(long timeout) Sets the timeout for this asynchronous request in milliseconds.
-
Constructor Details
-
AsyncRequestHandlerResponse
Creates an instance with a givenExecutor. It cannot be null. If you want an instance with a non-async response, usenotHandled()instead.- Parameters:
executor- a non-nullExecutor.
-
-
Method Details
-
with
public AsyncRequestHandlerResponse with(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Defines a different request and response to be passed toServletRequest.startAsync(javax.servlet.ServletRequest, javax.servlet.ServletResponse). Both cannot be null. -
with
Defines a listener to be added to the asynchronous request. It cannot be null. -
withTimeout
Sets the timeout for this asynchronous request in milliseconds. -
notHandled
Returns a response saying this AsyncRequestHandler doesn't handle this request.- Returns:
- an
AsyncRequestHandlerResponse.
-
isAsync
Returns whether the request should be processed asynchronously or not. -
getExecutor
Returns theExecutorto be used to process the request. -
getRequest
Returns the request to be used withServletRequest.startAsync()or null. -
getResponse
Returns the response to be used withServletRequest.startAsync()or null. -
getListener
Returns the listener to be added to the asynchronous request or null. -
isHasRequestAndResponse
Returns whether a request and a response were set in this object. -
getTimeout
Returns the timeout, in milliseconds, for the asynchronous request. Any value less than or equal zero is considered not having set a timeout. -
toString
-