01 /*
02 * Copyright 2004 The Apache Software Foundation
03 *
04 * Licensed under the Apache License, Version 2.0 (the "License");
05 * you may not use this file except in compliance with the License.
06 * You may obtain a copy of the License at
07 *
08 * http://www.apache.org/licenses/LICENSE-2.0
09 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package javax.servlet;
17
18 /**
19 * Ensures that servlets handle
20 * only one request at a time. This interface has no methods.
21 *
22 * <p>If a servlet implements this interface, you are <i>guaranteed</i>
23 * that no two threads will execute concurrently in the
24 * servlet's <code>service</code> method. The servlet container
25 * can make this guarantee by synchronizing access to a single
26 * instance of the servlet, or by maintaining a pool of servlet
27 * instances and dispatching each new request to a free servlet.
28 *
29 * <p>Note that SingleThreadModel does not solve all thread safety
30 * issues. For example, session attributes and static variables can
31 * still be accessed by multiple requests on multiple threads
32 * at the same time, even when SingleThreadModel servlets are used.
33 * It is recommended that a developer take other means to resolve
34 * those issues instead of implementing this interface, such as
35 * avoiding the usage of an instance variable or synchronizing
36 * the block of the code accessing those resources.
37 * This interface is deprecated in Servlet API version 2.4.
38 *
39 *
40 * @author Various
41 * @version $Version$
42 *
43 * @deprecated As of Java Servlet API 2.4, with no direct
44 * replacement.
45 */
46
47 public interface SingleThreadModel {
48 }
|