A
Container is an object that can execute requests received from a client, and return responses based on those requests. A Container may optionally support a pipeline of Valves that process the request in an order configured at runtime, by implementing the
Pipeline interface as well.
Containers will exist at several conceptual levels within Tomcat. The following examples represent common cases:
- Engine - Representation of the entire Tomcat servlet engine, most likely containing one or more subcontainers that are either Host or Context implementations, or other custom groups.
- Host - Representation of a virtual host containing a number of Contexts.
- Context - Representation of a single ServletContext, which will typically contain one or more Wrappers for the supported servlets.
- Wrapper - Representation of an individual servlet definition (which may support multiple servlet instances if the servlet itself implements SingleThreadModel).
A given deployment of Tomcat need not include Containers at all of the levels described above. For example, an administration application embedded within a network device (such as a router) might only contain a single Context and a few Wrappers, or even a single Wrapper if the application is relatively small. Therefore, Container implementations need to be designed so that they will operate correctly in the absence of parent Containers in a given deployment.
A Container may also be associated with a number of support components that provide functionality which might be shared (by attaching it to a parent Container) or individually customized. The following support components are currently recognized:
- Loader - Class loader to use for integrating new Java classes for this Container into the JVM in which Tomcat is running.
- Logger - Implementation of the
log()
method signatures of the ServletContext
interface. - Manager - Manager for the pool of Sessions associated with this Container.
- Realm - Read-only interface to a security domain, for authenticating user identities and their corresponding roles.
- Resources - Implementation of the resource access method signatures of the
ServletContext
interface, enabling custom linkages to existing server components when Tomcat is embedded in a larger server.
@author Craig R. McClanahan
@version $Revision: 1.5 $ $Date: 2000/04/10 18:44:39 $