2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 package javax.servlet;
20 * TODO SERVLET3 - Add comments
23 public interface AsyncContext {
24 public static final String ASYNC_REQUEST_URI =
25 "javax.servlet.async.request_uri";
26 public static final String ASYNC_CONTEXT_PATH =
27 "javax.servlet.async.context_path";
28 public static final String ASYNC_PATH_INFO =
29 "javax.servlet.async.path_info";
30 public static final String ASYNC_SERVLET_PATH =
31 "javax.servlet.async.servlet_path";
32 public static final String ASYNC_QUERY_STRING =
33 "javax.servlet.async.query_string";
35 ServletRequest getRequest();
37 ServletResponse getResponse();
39 boolean hasOriginalRequestAndResponse();
43 * @throws IllegalStateException
50 * @throws IllegalStateException
52 void dispatch(String path);
58 * @throws IllegalStateException
60 void dispatch(ServletContext context, String path);
64 void start(Runnable run);
66 void addListener(AsyncListener listener);
68 void addListener(AsyncListener listener, ServletRequest request,
69 ServletResponse response);
71 <T extends AsyncListener> T createListener(Class<T> clazz)
72 throws ServletException;
75 * Set timeout in milliseconds. 0 or less indicates no timeout.
77 void setTimeout(long timeout);
80 * Get timeout in milliseconds. 0 or less indicates no timeout.