SingleThreadModel

Java Servlet Programming, 2nd Edition > A. Servlet API Quick Reference > SingleThreadModel

 
< BACKCONTINUE >
SingleThreadModel

Synopsis

Interface Name: javax.servlet.SingleThreadModel

Superinterface: None

Immediate Subinterfaces: None

Implemented By: None

Availability: Servlet API 2.0 and later

Description

SingleThreadModel 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 Declaration

public interface SingleThreadModel { }


Last updated on 3/20/2003
Java Servlet Programming, 2nd Edition, © 2001 O'Reilly

< BACKCONTINUE >


Java servlet programming
Java Servlet Programming (Java Series)
ISBN: 0596000405
EAN: 2147483647
Year: 2000
Pages: 223

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net