Skip to Main Content
Java Servlet Programming, 2nd Edition
book

Java Servlet Programming, 2nd Edition

by Jason Hunter, William Crawford
April 2001
Intermediate to advanced content levelIntermediate to advanced
780 pages
23h 48m
English
O'Reilly Media, Inc.
Content preview from Java Servlet Programming, 2nd Edition

Name

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 {
}
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java Servlet Programming

Java Servlet Programming

Jason Hunter

Publisher Resources

ISBN: 0596000405Supplemental ContentErrata Page