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