private static boolean isAsyncSupported(HttpServletRequest request) { try { return request.isAsyncSupported(); } catch (LinkageError error) { // The code above might throw an AbstractMethodError or a // NoSuchMethodError, // if it does, it means async is not supported return false; } } }
@Override public boolean isAsyncSupported() { try { return b.request.isAsyncSupported(); } catch (Throwable ex) { // Servlet 2.5 incompatible API. logger.trace("", ex); return false; } }
/** * Constructor accepting a request and response pair that are expected to be of type * {@link ServletServerHttpRequest} and {@link ServletServerHttpResponse} * respectively. */ public ServletServerHttpAsyncRequestControl(ServletServerHttpRequest request, ServletServerHttpResponse response) { Assert.notNull(request, "request is required"); Assert.notNull(response, "response is required"); Assert.isTrue(request.getServletRequest().isAsyncSupported(), "Async support must be enabled on a servlet and for all filters involved " + "in async request processing. This is done in Java code using the Servlet API " + "or by adding \"<async-supported>true</async-supported>\" to servlet and " + "filter declarations in web.xml. Also you must use a Servlet 3.0+ container"); this.request = request; this.response = response; }
/** * Constructor accepting a request and response pair that are expected to be of type * {@link ServletServerHttpRequest} and {@link ServletServerHttpResponse} * respectively. */ public ServletServerHttpAsyncRequestControl(ServletServerHttpRequest request, ServletServerHttpResponse response) { Assert.notNull(request, "request is required"); Assert.notNull(response, "response is required"); Assert.isTrue(request.getServletRequest().isAsyncSupported(), "Async support must be enabled on a servlet and for all filters involved " + "in async request processing. This is done in Java code using the Servlet API " + "or by adding \"<async-supported>true</async-supported>\" to servlet and " + "filter declarations in web.xml. Also you must use a Servlet 3.0+ container"); this.request = request; this.response = response; }
@Override public void startAsync() { Assert.state(getRequest().isAsyncSupported(), "Async support must be enabled on a servlet and for all filters involved " + "in async request processing. This is done in Java code using the Servlet API " + "or by adding \"<async-supported>true</async-supported>\" to servlet and " + "filter declarations in web.xml."); Assert.state(!isAsyncComplete(), "Async processing has already completed"); if (isAsyncStarted()) { return; } this.asyncContext = getRequest().startAsync(getRequest(), getResponse()); this.asyncContext.addListener(this); if (this.timeout != null) { this.asyncContext.setTimeout(this.timeout); } }
@Override public void startAsync() { Assert.state(getRequest().isAsyncSupported(), "Async support must be enabled on a servlet and for all filters involved " + "in async request processing. This is done in Java code using the Servlet API " + "or by adding \"<async-supported>true</async-supported>\" to servlet and " + "filter declarations in web.xml."); Assert.state(!isAsyncComplete(), "Async processing has already completed"); if (isAsyncStarted()) { return; } this.asyncContext = getRequest().startAsync(getRequest(), getResponse()); this.asyncContext.addListener(this); if (this.timeout != null) { this.asyncContext.setTimeout(this.timeout); } }
@Override public boolean isAsyncSupported() { return getRequest().isAsyncSupported(); }
protected void setupContinuation(Message inMessage, final HttpServletRequest req, final HttpServletResponse resp) { try { if (isServlet3 && req.isAsyncSupported()) { inMessage.put(ContinuationProvider.class.getName(), new Servlet3ContinuationProvider(req, resp, inMessage)); } else if (cproviderFactory != null) { ContinuationProvider p = cproviderFactory.createContinuationProvider(inMessage, req, resp); if (p != null) { inMessage.put(ContinuationProvider.class.getName(), p); } } } catch (Throwable ex) { // the request may not implement the Servlet3 API } } protected String getBasePath(String contextPath) throws IOException {
@Override public boolean isAsyncSupported() { return _request.isAsyncSupported(); }
@Override public boolean isAsyncSupported() { return _request.isAsyncSupported(); }
@Override public boolean isAsyncSupported() { return delegate.isAsyncSupported(); }
/** * {@inheritDoc} */ @Override public boolean isAsyncSupported() { // Delegate call return (request != null) && request.isAsyncSupported(); }
/** * Returns true if the request supports async * * @since Servlet 3.0 */ public boolean isAsyncSupported() { return getRequest().isAsyncSupported(); }
public boolean isAsyncSupported() { return get().isAsyncSupported(); }
@Override public boolean isAsyncSupported() { return get().isAsyncSupported(); }
public Sleeper createSleeper(HttpServletRequest request, HttpServletResponse response, RealScriptSession scriptSession, ScriptConduit conduit) throws IOException { if (request.isAsyncSupported()) { return new Servlet30Sleeper(request, response, scriptSession, conduit); } else { return new ThreadWaitSleeper(response, scriptSession, conduit); } } }
@Override public boolean isAsyncSupported() { return _invocation.isAsyncSupported() && getRequest().isAsyncSupported(); }
@Override public boolean isAsyncSupported() { return _invocation.isAsyncSupported() && getRequest().isAsyncSupported(); }
@Override public boolean isAsyncSupported() { return _invocation.isAsyncSupported() && getRequest().isAsyncSupported(); }
@Override public boolean isAsyncSupported() { return _invocation.isAsyncSupported() && getRequest().isAsyncSupported(); }