Interface Container

All Superinterfaces:
Lifecycle
All Known Subinterfaces:
Context, Engine, Host, Wrapper
All Known Implementing Classes:
ContainerBase, FailedContext, ReplicatedContext, StandardContext, StandardEngine, StandardHost, StandardWrapper, Tomcat.ExistingStandardWrapper

public interface Container extends Lifecycle
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 Catalina. The following examples represent common cases:

  • Engine - Representation of the entire Catalina 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.
A given deployment of Catalina 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 Catalina 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 - JNDI directory context enabling access to static resources, enabling custom linkages to existing server components when Catalina is embedded in a larger server.
Author:
Craig R. McClanahan, Remy Maucherat