Java Servlet Programming, 2nd Edition > A. Servlet API Quick Reference > SingleThreadModel |
SynopsisInterface Name: javax.servlet.SingleThreadModel Superinterface: None Immediate Subinterfaces: None Implemented By: None Availability: Servlet API 2.0 and later DescriptionSingleThreadModel is a tag interface with no methods. If a servlet implements this interface, the servlet container ensures that each instance of the servlet handles only one service request at a time. For example, a servlet container may implement this functionality by maintaining a pool of servlet instances and dispatching incoming requests to free servlets within the pool. Using SingleThreadModel makes the servlet itself thread safe; however, using this interface does not prevent synchronization problems that result from servlets accessing shared resources such as static class variables or variables not local to the servlet. There are very few situations in which this interface is useful. Interface Declarationpublic interface SingleThreadModel { }
|