public void dispatchResume(HttpServletRequest request,
HttpServletResponse response,
Invocation invocation)
throws ServletException, IOException
{
HttpServletRequestWrapper parentRequest = null;
HttpServletRequestImpl bottomRequest = null;
HttpServletResponseImpl bottomResponse = null;
HttpServletRequest req = request;
while (req != null && req instanceof HttpServletRequestWrapper) {
parentRequest = (HttpServletRequestWrapper) req;
req = (HttpServletRequest) parentRequest.getRequest();
}
if (! (req instanceof HttpServletRequestImpl)) {
throw new IllegalStateException(L.l("Wrapped async requests must use HttpServletRequestWrapper around the original request"));
}
bottomRequest = (HttpServletRequestImpl) req;
HttpServletResponse res = response;
while (res != null && res instanceof HttpServletResponseWrapper) {
HttpServletResponseWrapper parentResponse
= (HttpServletResponseWrapper) res;
res = (HttpServletResponse) parentResponse.getResponse();
}
if (! (res instanceof HttpServletResponseImpl)) {
throw new IllegalStateException(L.l("Wrapped async requests must use HttpServletRequestWrapper around the original request"));
}
bottomResponse = (HttpServletResponseImpl) res;
AsyncRequest asyncRequest
= new AsyncRequest(bottomRequest, bottomResponse, invocation);
if (parentRequest != null) {
parentRequest.setRequest(asyncRequest);
}
else {
request = asyncRequest;
}