| org.apache.catalina.Container
All known Subclasses: org.apache.catalina.core.ContainerBase,
Container | public interface Container (Code) | | 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
(which may support multiple servlet instances if the servlet itself
implements SingleThreadModel).
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 author: Remy Maucherat version: $Revision: 1.7 $ $Date: 2001/11/09 19:37:50 $ |
Field Summary | |
final public static String | ADD_CHILD_EVENT The ContainerEvent event type sent when a child container is added
by addChild() . | final public static String | ADD_MAPPER_EVENT The ContainerEvent event type sent when a Mapper is added
by addMapper() . | final public static String | ADD_VALVE_EVENT The ContainerEvent event type sent when a valve is added
by addValve() , if this Container supports pipelines. | final public static String | REMOVE_CHILD_EVENT The ContainerEvent event type sent when a child container is removed
by removeChild() . | final public static String | REMOVE_MAPPER_EVENT The ContainerEvent event type sent when a Mapper is removed
by removeMapper() . | final public static String | REMOVE_VALVE_EVENT The ContainerEvent event type sent when a valve is removed
by removeValve() , if this Container supports pipelines. |
Method Summary | |
public void | addChild(Container child) Add a new child Container to those associated with this Container,
if supported. | public void | addContainerListener(ContainerListener listener) Add a container event listener to this component. | public void | addMapper(Mapper mapper) Add the specified Mapper associated with this Container. | public void | addPropertyChangeListener(PropertyChangeListener listener) Add a property change listener to this component. | public Container | findChild(String name) | public Container[] | findChildren() Return the set of children Containers associated with this Container. | public ContainerListener[] | findContainerListeners() Return the set of container listeners associated with this Container. | public Mapper | findMapper(String protocol) Return the Mapper associated with the specified protocol, if there
is one. | public Mapper[] | findMappers() Return the set of Mappers associated with this Container. | public Cluster | getCluster() Return the Cluster with which this Container is associated. | public String | getInfo() Return descriptive information about this Container implementation and
the corresponding version number, in the format
<description>/<version> . | public Loader | getLoader() Return the Loader with which this Container is associated. | public Logger | getLogger() Return the Logger with which this Container is associated. | public Manager | getManager() Return the Manager with which this Container is associated. | public String | getName() Return a name string (suitable for use by humans) that describes this
Container. | public Container | getParent() Return the Container for which this Container is a child, if there is
one. | public ClassLoader | getParentClassLoader() Return the parent class loader (if any) for web applications. | public Realm | getRealm() Return the Realm with which this Container is associated. | public DirContext | getResources() Return the Resources with which this Container is associated. | public void | invoke(Request request, Response response) Process the specified Request, and generate the corresponding Response,
according to the design of this particular Container. | public Container | map(Request request, boolean update) Return the child Container that should be used to process this Request,
based upon its characteristics. | public void | removeChild(Container child) Remove an existing child Container from association with this parent
Container. | public void | removeContainerListener(ContainerListener listener) Remove a container event listener from this component. | public void | removeMapper(Mapper mapper) Remove a Mapper associated with this Container, if any. | public void | removePropertyChangeListener(PropertyChangeListener listener) Remove a property change listener from this component. | public void | setCluster(Cluster cluster) Set the Cluster with which this Container is associated. | public void | setLoader(Loader loader) Set the Loader with which this Container is associated. | public void | setLogger(Logger logger) Set the Logger with which this Container is associated. | public void | setManager(Manager manager) Set the Manager with which this Container is associated. | public void | setName(String name) Set a name string (suitable for use by humans) that describes this
Container. | public void | setParent(Container container) Set the parent Container to which this Container is being added as a
child. | public void | setParentClassLoader(ClassLoader parent) Set the parent class loader (if any) for web applications. | public void | setRealm(Realm realm) Set the Realm with which this Container is associated. | public void | setResources(DirContext resources) Set the Resources object with which this Container is associated. |
ADD_CHILD_EVENT | final public static String ADD_CHILD_EVENT(Code) | | The ContainerEvent event type sent when a child container is added
by addChild() .
|
ADD_MAPPER_EVENT | final public static String ADD_MAPPER_EVENT(Code) | | The ContainerEvent event type sent when a Mapper is added
by addMapper() .
|
ADD_VALVE_EVENT | final public static String ADD_VALVE_EVENT(Code) | | The ContainerEvent event type sent when a valve is added
by addValve() , if this Container supports pipelines.
|
REMOVE_CHILD_EVENT | final public static String REMOVE_CHILD_EVENT(Code) | | The ContainerEvent event type sent when a child container is removed
by removeChild() .
|
REMOVE_MAPPER_EVENT | final public static String REMOVE_MAPPER_EVENT(Code) | | The ContainerEvent event type sent when a Mapper is removed
by removeMapper() .
|
REMOVE_VALVE_EVENT | final public static String REMOVE_VALVE_EVENT(Code) | | The ContainerEvent event type sent when a valve is removed
by removeValve() , if this Container supports pipelines.
|
addChild | public void addChild(Container child)(Code) | | Add a new child Container to those associated with this Container,
if supported. Prior to adding this Container to the set of children,
the child's setParent() method must be called, with this
Container as an argument. This method may thrown an
IllegalArgumentException if this Container chooses not
to be attached to the specified Container, in which case it is not added
Parameters: child - New child Container to be added exception: IllegalArgumentException - if this exception is thrown bythe setParent() method of the child Container exception: IllegalArgumentException - if the new child does not havea name unique from that of existing children of this Container exception: IllegalStateException - if this Container does not supportchild Containers |
addContainerListener | public void addContainerListener(ContainerListener listener)(Code) | | Add a container event listener to this component.
Parameters: listener - The listener to add |
addMapper | public void addMapper(Mapper mapper)(Code) | | Add the specified Mapper associated with this Container.
Parameters: mapper - The corresponding Mapper implementation exception: IllegalArgumentException - if this exception is thrown bythe setContainer() method of the Mapper |
addPropertyChangeListener | public void addPropertyChangeListener(PropertyChangeListener listener)(Code) | | Add a property change listener to this component.
Parameters: listener - The listener to add |
findChild | public Container findChild(String name)(Code) | | Return the child Container, associated with this Container, with
the specified name (if any); otherwise, return null
Parameters: name - Name of the child Container to be retrieved |
findChildren | public Container[] findChildren()(Code) | | Return the set of children Containers associated with this Container.
If this Container has no children, a zero-length array is returned.
|
findContainerListeners | public ContainerListener[] findContainerListeners()(Code) | | Return the set of container listeners associated with this Container.
If this Container has no registered container listeners, a zero-length
array is returned.
|
findMapper | public Mapper findMapper(String protocol)(Code) | | Return the Mapper associated with the specified protocol, if there
is one. If there is only one defined Mapper, use it for all protocols.
If there is no matching Mapper, return null .
Parameters: protocol - Protocol for which to find a Mapper |
findMappers | public Mapper[] findMappers()(Code) | | Return the set of Mappers associated with this Container. If this
Container has no Mappers, a zero-length array is returned.
|
getCluster | public Cluster getCluster()(Code) | | Return the Cluster with which this Container is associated. If there is
no associated Cluster, return the Cluster associated with our parent
Container (if any); otherwise return null .
|
getInfo | public String getInfo()(Code) | | Return descriptive information about this Container implementation and
the corresponding version number, in the format
<description>/<version> .
|
getLoader | public Loader getLoader()(Code) | | Return the Loader with which this Container is associated. If there is
no associated Loader, return the Loader associated with our parent
Container (if any); otherwise, return null .
|
getLogger | public Logger getLogger()(Code) | | Return the Logger with which this Container is associated. If there is
no associated Logger, return the Logger associated with our parent
Container (if any); otherwise return null .
|
getManager | public Manager getManager()(Code) | | Return the Manager with which this Container is associated. If there is
no associated Manager, return the Manager associated with our parent
Container (if any); otherwise return null .
|
getName | public String getName()(Code) | | Return a name string (suitable for use by humans) that describes this
Container. Within the set of child containers belonging to a particular
parent, Container names must be unique.
|
getParent | public Container getParent()(Code) | | Return the Container for which this Container is a child, if there is
one. If there is no defined parent, return null .
|
getParentClassLoader | public ClassLoader getParentClassLoader()(Code) | | Return the parent class loader (if any) for web applications.
|
getRealm | public Realm getRealm()(Code) | | Return the Realm with which this Container is associated. If there is
no associated Realm, return the Realm associated with our parent
Container (if any); otherwise return null .
|
getResources | public DirContext getResources()(Code) | | Return the Resources with which this Container is associated. If there
is no associated Resources object, return the Resources associated with
our parent Container (if any); otherwise return null .
|
invoke | public void invoke(Request request, Response response) throws IOException, ServletException(Code) | | Process the specified Request, and generate the corresponding Response,
according to the design of this particular Container.
Parameters: request - Request to be processed Parameters: response - Response to be produced exception: IOException - if an input/output error occurred whileprocessing exception: ServletException - if a ServletException was thrownwhile processing this request |
map | public Container map(Request request, boolean update)(Code) | | Return the child Container that should be used to process this Request,
based upon its characteristics. If no such child Container can be
identified, return null instead.
Parameters: request - Request being processed Parameters: update - Update the Request to reflect the mapping selection? |
removeChild | public void removeChild(Container child)(Code) | | Remove an existing child Container from association with this parent
Container.
Parameters: child - Existing child Container to be removed |
removeContainerListener | public void removeContainerListener(ContainerListener listener)(Code) | | Remove a container event listener from this component.
Parameters: listener - The listener to remove |
removeMapper | public void removeMapper(Mapper mapper)(Code) | | Remove a Mapper associated with this Container, if any.
Parameters: mapper - The Mapper to be removed |
removePropertyChangeListener | public void removePropertyChangeListener(PropertyChangeListener listener)(Code) | | Remove a property change listener from this component.
Parameters: listener - The listener to remove |
setCluster | public void setCluster(Cluster cluster)(Code) | | Set the Cluster with which this Container is associated.
Parameters: connector - The Connector to be added |
setLoader | public void setLoader(Loader loader)(Code) | | Set the Loader with which this Container is associated.
Parameters: loader - The newly associated loader |
setLogger | public void setLogger(Logger logger)(Code) | | Set the Logger with which this Container is associated.
Parameters: logger - The newly associated Logger |
setManager | public void setManager(Manager manager)(Code) | | Set the Manager with which this Container is associated.
Parameters: manager - The newly associated Manager |
setName | public void setName(String name)(Code) | | Set a name string (suitable for use by humans) that describes this
Container. Within the set of child containers belonging to a particular
parent, Container names must be unique.
Parameters: name - New name of this container exception: IllegalStateException - if this Container has already beenadded to the children of a parent Container (after which the namemay not be changed) |
setParent | public void setParent(Container container)(Code) | | Set the parent Container to which this Container is being added as a
child. This Container may refuse to become attached to the specified
Container by throwing an exception.
Parameters: container - Container to which this Container is being addedas a child exception: IllegalArgumentException - if this Container refuses to becomeattached to the specified Container |
setParentClassLoader | public void setParentClassLoader(ClassLoader parent)(Code) | | Set the parent class loader (if any) for web applications.
This call is meaningful only before a Loader has
been configured, and the specified value (if non-null) should be
passed as an argument to the class loader constructor.
Parameters: parent - The new parent class loader |
setRealm | public void setRealm(Realm realm)(Code) | | Set the Realm with which this Container is associated.
Parameters: realm - The newly associated Realm |
setResources | public void setResources(DirContext resources)(Code) | | Set the Resources object with which this Container is associated.
Parameters: resources - The newly associated Resources |
|
|