📄 container.java
字号:
/*
* $Header: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/Container.java,v 1.6 2003/07/18 18:48:58 remm Exp $
* $Revision: 1.6 $
* $Date: 2003/07/18 18:48:58 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* [Additional notices, if required by prior licensing conditions]
*
*/
package org.apache.catalina;
import java.beans.PropertyChangeListener;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.naming.directory.DirContext;
/**
* A <b>Container</b> 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 <b>Pipeline</b> interface
* as well.
* <p>
* Containers will exist at several conceptual levels within Catalina. The
* following examples represent common cases:
* <ul>
* <li><b>Engine</b> - 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.
* <li><b>Host</b> - Representation of a virtual host containing a number
* of Contexts.
* <li><b>Context</b> - Representation of a single ServletContext, which will
* typically contain one or more Wrappers for the supported servlets.
* <li><b>Wrapper</b> - Representation of an individual servlet definition
* (which may support multiple servlet instances if the servlet itself
* implements SingleThreadModel).
* </ul>
* 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.
* <p>
* 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:
* <ul>
* <li><b>Loader</b> - Class loader to use for integrating new Java classes
* for this Container into the JVM in which Catalina is running.
* <li><b>Logger</b> - Implementation of the <code>log()</code> method
* signatures of the <code>ServletContext</code> interface.
* <li><b>Manager</b> - Manager for the pool of Sessions associated with
* this Container.
* <li><b>Realm</b> - Read-only interface to a security domain, for
* authenticating user identities and their corresponding roles.
* <li><b>Resources</b> - JNDI directory context enabling access to static
* resources, enabling custom linkages to existing server components when
* Catalina is embedded in a larger server.
* </ul>
*
* @author Craig R. McClanahan
* @author Remy Maucherat
* @version $Revision: 1.6 $ $Date: 2003/07/18 18:48:58 $
*/
public interface Container {
// ----------------------------------------------------- Manifest Constants
/**
* The ContainerEvent event type sent when a child container is added
* by <code>addChild()</code>.
*/
public static final String ADD_CHILD_EVENT = "addChild";
/**
* The ContainerEvent event type sent when a Mapper is added
* by <code>addMapper()</code>.
*/
public static final String ADD_MAPPER_EVENT = "addMapper";
/**
* The ContainerEvent event type sent when a valve is added
* by <code>addValve()</code>, if this Container supports pipelines.
*/
public static final String ADD_VALVE_EVENT = "addValve";
/**
* The ContainerEvent event type sent when a child container is removed
* by <code>removeChild()</code>.
*/
public static final String REMOVE_CHILD_EVENT = "removeChild";
/**
* The ContainerEvent event type sent when a Mapper is removed
* by <code>removeMapper()</code>.
*/
public static final String REMOVE_MAPPER_EVENT = "removeMapper";
/**
* The ContainerEvent event type sent when a valve is removed
* by <code>removeValve()</code>, if this Container supports pipelines.
*/
public static final String REMOVE_VALVE_EVENT = "removeValve";
// ------------------------------------------------------------- Properties
/**
* Return descriptive information about this Container implementation and
* the corresponding version number, in the format
* <code><description>/<version></code>.
*/
public String getInfo();
/**
* 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 <code>null</code>.
*/
public Loader getLoader();
/**
* Set the Loader with which this Container is associated.
*
* @param loader The newly associated loader
*/
public void setLoader(Loader loader);
/**
* 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 <code>null</code>.
*/
public Logger getLogger();
/**
* Set the Logger with which this Container is associated.
*
* @param logger The newly associated Logger
*/
public void setLogger(Logger logger);
/**
* 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 <code>null</code>.
*/
public Manager getManager();
/**
* Set the Manager with which this Container is associated.
*
* @param manager The newly associated Manager
*/
public void setManager(Manager manager);
/**
* Return an object which may be utilized for mapping to this component.
*/
public Object getMappingObject();
/**
* Return the Pipeline object that manages the Valves associated with
* this Container.
*/
public Pipeline getPipeline();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -