001    /*
002     * Licensed to the Apache Software Foundation (ASF) under one
003     * or more contributor license agreements.  See the NOTICE file
004     * distributed with this work for additional information
005     * regarding copyright ownership.  The ASF licenses this file
006     * to you under the Apache License, Version 2.0 (the
007     * "License"); you may not use this file except in compliance
008     * with the License.  You may obtain a copy of the License at
009     *
010     *  http://www.apache.org/licenses/LICENSE-2.0
011     *
012     * Unless required by applicable law or agreed to in writing,
013     * software distributed under the License is distributed on an
014     * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015     * KIND, either express or implied.  See the License for the
016     * specific language governing permissions and limitations
017     * under the License.
018     */
019    
020    package javax.servlet;
021    
022    /**
023     * Ensures that servlets handle
024     * only one request at a time. This interface has no methods.
025     *
026     * <p>If a servlet implements this interface, you are <i>guaranteed</i>
027     * that no two threads will execute concurrently in the
028     * servlet's <code>service</code> method. The servlet container
029     * can make this guarantee by synchronizing access to a single
030     * instance of the servlet, or by maintaining a pool of servlet
031     * instances and dispatching each new request to a free servlet.
032     *
033     * <p>Note that SingleThreadModel does not solve all thread safety
034     * issues.  For example, session attributes and static variables can
035     * still be accessed by multiple requests on multiple threads
036     * at the same time, even when SingleThreadModel servlets are used.
037     * It is recommended that a developer take other means to resolve
038     * those issues instead of implementing this interface, such as
039     * avoiding the usage of an instance variable or synchronizing
040     * the block of the code accessing those resources.
041     * This interface is deprecated in Servlet API version 2.4.
042     *
043     *
044     * @author      Various
045     * @version     $Version$
046     *
047     * @deprecated  As of Java Servlet API 2.4, with no direct
048     *      replacement.
049     */
050    
051    public interface SingleThreadModel {
052    }