]> WPIA git - gigi.git/blob - lib/servlet-api/javax/servlet/AsyncContext.java
adding servlet api (from tomcat)
[gigi.git] / lib / servlet-api / javax / servlet / AsyncContext.java
1 /*
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
8 *
9 *     http://www.apache.org/licenses/LICENSE-2.0
10 *
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.
16 */
17 package javax.servlet;
18
19 /**
20  * TODO SERVLET3 - Add comments
21  * @since Servlet 3.0
22  */
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";
34
35     ServletRequest getRequest();
36
37     ServletResponse getResponse();
38
39     boolean hasOriginalRequestAndResponse();
40
41     /**
42      *
43      * @throws IllegalStateException
44      */
45     void dispatch();
46
47     /**
48      *
49      * @param path
50      * @throws IllegalStateException
51      */
52     void dispatch(String path);
53
54     /**
55      *
56      * @param context
57      * @param path
58      * @throws IllegalStateException
59      */
60     void dispatch(ServletContext context, String path);
61
62     void complete();
63
64     void start(Runnable run);
65
66     void addListener(AsyncListener listener);
67
68     void addListener(AsyncListener listener, ServletRequest request,
69             ServletResponse response);
70
71     <T extends AsyncListener> T createListener(Class<T> clazz)
72     throws ServletException;
73
74     /**
75      * Set timeout in milliseconds. 0 or less indicates no timeout.
76      */
77     void setTimeout(long timeout);
78
79     /**
80      * Get timeout in milliseconds. 0 or less indicates no timeout.
81      */
82     long getTimeout();
83 }