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 theExecutor
to be used to process the request.javax.servlet.AsyncListener
Returns the listener to be added to the asynchronous request or null.javax.servlet.http.HttpServletRequest
Returns the request to be used withServletRequest.startAsync()
or null.javax.servlet.http.HttpServletResponse
Returns the response to be used withServletRequest.startAsync()
or null.long
Returns the timeout, in milliseconds, for the asynchronous request.boolean
isAsync()
Returns whether the request should be processed asynchronously or not.boolean
Returns whether a request and a response were set in this object.static AsyncRequestHandlerResponse
Returns 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 theExecutor
to 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
-