1 2 3 /* 4 * The contents of this file are subject to the terms 5 * of the Common Development and Distribution License 6 * (the "License"). You may not use this file except 7 * in compliance with the License. 8 * 9 * You can obtain a copy of the license at 10 * glassfish/bootstrap/legal/CDDLv1.0.txt or 11 * https://glassfish.dev.java.net/public/CDDLv1.0.html. 12 * See the License for the specific language governing 13 * permissions and limitations under the License. 14 * 15 * When distributing Covered Code, include this CDDL 16 * HEADER in each file and include the License file at 17 * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable, 18 * add the following below this CDDL HEADER, with the 19 * fields enclosed by brackets "[]" replaced with your 20 * own identifying information: Portions Copyright [yyyy] 21 * [name of copyright owner] 22 * 23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 24 * 25 * Portions Copyright Apache Software Foundation. 26 */ 27 28 package javax.servlet; 29 30 /** 31 * Ensures that servlets handle 32 * only one request at a time. This interface has no methods. 33 * 34 * <p>If a servlet implements this interface, you are <i>guaranteed</i> 35 * that no two threads will execute concurrently in the 36 * servlet's <code>service</code> method. The servlet container 37 * can make this guarantee by synchronizing access to a single 38 * instance of the servlet, or by maintaining a pool of servlet 39 * instances and dispatching each new request to a free servlet. 40 * 41 * <p>Note that SingleThreadModel does not solve all thread safety 42 * issues. For example, session attributes and static variables can 43 * still be accessed by multiple requests on multiple threads 44 * at the same time, even when SingleThreadModel servlets are used. 45 * It is recommended that a developer take other means to resolve 46 * those issues instead of implementing this interface, such as 47 * avoiding the usage of an instance variable or synchronizing 48 * the block of the code accessing those resources. 49 * This interface is deprecated in Servlet API version 2.4. 50 * 51 * 52 * @author Various 53 * 54 * @deprecated As of Java Servlet API 2.4, with no direct 55 * replacement. 56 */ 57 58 public interface SingleThreadModel { 59 }