You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by cr...@locus.apache.org on 2000/08/11 07:24:47 UTC

cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina Authenticator.java Connector.java Container.java ContainerEvent.java ContainerListener.java Context.java Engine.java Host.java HttpRequest.java HttpResponse.java InstanceEvent.java InstanceListener.java Lifecycle.java LifecycleEvent.java LifecycleException.java LifecycleListener.java Loader.java Logger.java Manager.java Mapper.java Pipeline.java Realm.java Request.java Resources.java Response.java Server.java Session.java Store.java Valve.java Wrapper.java

craigmcc    00/08/10 22:24:46

  Added:       catalina/src/share/org/apache/catalina Authenticator.java
                        Connector.java Container.java ContainerEvent.java
                        ContainerListener.java Context.java Engine.java
                        Host.java HttpRequest.java HttpResponse.java
                        InstanceEvent.java InstanceListener.java
                        Lifecycle.java LifecycleEvent.java
                        LifecycleException.java LifecycleListener.java
                        Loader.java Logger.java Manager.java Mapper.java
                        Pipeline.java Realm.java Request.java
                        Resources.java Response.java Server.java
                        Session.java Store.java Valve.java Wrapper.java
  Log:
  Migrate top level Catalina interfaces to Tomcat 4.0.
  
  Revision  Changes    Path
  1.1                  jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Authenticator.java
  
  Index: Authenticator.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Authenticator.java,v 1.1 2000/08/11 05:24:03 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/08/11 05:24:03 $
   *
   * ====================================================================
   *
   * 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;
  
  
  /**
   * An <b>Authenticator</b> is a component (usually a Valve or Container) that
   * provides some sort of authentication service.  The interface itself has no
   * functional significance,  but is used as a tagging mechanism so that other
   * components can detect the presence (via an "instanceof Authenticator" test)
   * of an already configured authentication service.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/08/11 05:24:03 $
   */
  
  public interface Authenticator {
  
  
  }
  
  
  
  1.1                  jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Connector.java
  
  Index: Connector.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Connector.java,v 1.1 2000/08/11 05:24:03 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/08/11 05:24:03 $
   *
   * ====================================================================
   *
   * 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;
  
  
  /**
   * A <b>Connector</b> is a component responsible receiving requests from,
   * and returning responses to, a client application.  A Connector performs
   * the following general logic:
   * <ul>
   * <li>Receive a request from the client application.
   * <li>Create (or allocate from a pool) appropriate Request and Response
   *     instances, and populate their properties based on the contents of
   *     the received request, as described below.
   *     <ul>
   *     <li>For all Requests, the <code>connector</code>,
   *         <code>protocol</code>, <code>remoteAddr</code>,
   *         <code>response</code>, <code>scheme</code>,
   *         <code>secure</code>, <code>serverName</code>,
   *         <code>serverPort</code> and <code>stream</code>
   *         properties <b>MUST</b> be set. The <code>contentLength</code>
   *         and <code>contentType</code> properties are also generally set.
   *     <li>For HttpRequests, the <code>method</code>, <code>queryString</code>,
   *         <code>requestedSessionCookie</code>,
   *         <code>requestedSessionId</code>, <code>requestedSessionURL</code>,
   *         <code>requestURI</code>, and <code>secure</code> properties
   *         <b>MUST</b> be set.  In addition, the various <code>addXxx</code>
   *         methods must be called to record the presence of cookies, headers,
   *         and locales in the original request.
   *     <li>For all Responses, the <code>connector</code>, <code>request</code>,
   *         and <code>stream</code> properties <b>MUST</b> be set.
   *     <li>No additional headers must be set by the Connector for
   *         HttpResponses.
   *     </ul>
   * <li>Identify an appropriate Container to use for processing this request.
   *     For a stand alone Catalina installation, this will probably be a
   *     (singleton) Engine implementation.  For a Connector attaching Catalina
   *     to a web server such as Apache, this step could take advantage of
   *     parsing already performed within the web server to identify the
   *     Context, and perhaps even the Wrapper, to utilize in satisfying this
   *     Request.
   * <li>Call the <code>invoke()</code> method of the selected Container,
   *     passing the initialized Request and Response instances as arguments.
   * <li>Return any response created by the Container to the client, or
   *     return an appropriate error message if an exception of any type
   *     was thrown.
   * <li>If utilizing a pool of Request and Response objects, recycle the pair
   *     of instances that was just used.
   * </ul>
   * It is expected that the implementation details of various Connectors will
   * vary widely, so the logic above should considered typical rather than
   * normative.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/08/11 05:24:03 $
   */
  
  public interface Connector {
  
  
      // ------------------------------------------------------------- Properties
  
  
      /**
       * Return the Container used for processing requests received by this
       * Connector.
       */
      public Container getContainer();
  
  
      /**
       * Set the Container used for processing requests received by this
       * Connector.
       *
       * @param container The new Container to use
       */
      public void setContainer(Container container);
  
  
      /**
       * Return descriptive information about this Connector implementation.
       */
      public String getInfo();
  
  
      /**
       * Return the scheme that will be assigned to requests received
       * through this connector.  Default value is "http".
       */
      public String getScheme();
  
  
      /**
       * Set the scheme that will be assigned to requests received through
       * this connector.
       *
       * @param scheme The new scheme
       */
      public void setScheme(String scheme);
  
  
      /**
       * Return the secure connection flag that will be assigned to requests
       * received through this connector.  Default value is "false".
       */
      public boolean getSecure();
  
  
      /**
       * Set the secure connection flag that will be assigned to requests
       * received through this connector.
       *
       * @param secure The new secure connection flag
       */
      public void setSecure(boolean secure);
  
  
      // --------------------------------------------------------- Public Methods
  
  
      /**
       * Create (or allocate) and return a Request object suitable for
       * specifying the contents of a Request to the responsible Container.
       */
      public Request createRequest();
  
  
      /**
       * Create (or allocate) and return a Response object suitable for
       * receiving the contents of a Response from the responsible Container.
       */
      public Response createResponse();
  
  
  }
  
  
  
  1.1                  jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Container.java
  
  Index: Container.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Container.java,v 1.1 2000/08/11 05:24:03 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/08/11 05:24:03 $
   *
   * ====================================================================
   *
   * 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;
  
  
  /**
   * 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> - Implementation of the resource access method
   *     signatures of the <code>ServletContext</code> interface, enabling
   *     custom linkages to existing server components when Catalina is embedded
   *     in a larger server.
   * </ul>
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/08/11 05:24:03 $
   */
  
  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>&lt;description&gt;/&lt;version&gt;</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 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.
       */
      public String getName();
  
  
      /**
       * 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.
       *
       * @param name New name of this container
       *
       * @exception IllegalStateException if this Container has already been
       *  added to the children of a parent Container (after which the name
       *  may not be changed)
       */
      public void setName(String name);
  
  
      /**
       * Return the Container for which this Container is a child, if there is
       * one.  If there is no defined parent, return <code>null</code>.
       */
      public Container getParent();
  
  
      /**
       * 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.
       *
       * @param container Container to which this Container is being added
       *  as a child
       *
       * @exception IllegalArgumentException if this Container refuses to become
       *  attached to the specified Container
       */
      public void setParent(Container container);
  
  
      /**
       * 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 <code>null</code>.
       */
      public Realm getRealm();
  
  
      /**
       * Set the Realm with which this Container is associated.
       *
       * @param realm The newly associated Realm
       */
      public void setRealm(Realm realm);
  
  
      /**
       * 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 <code>null</code>.
       */
      public Resources getResources();
  
  
      /**
       * Set the Resources object with which this Container is associated.
       *
       * @param resources The newly associated Resources
       */
      public void setResources(Resources resources);
  
  
      // --------------------------------------------------------- Public Methods
  
  
      /**
       * 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 <code>setParent()</code> method must be called, with this
       * Container as an argument.  This method may thrown an
       * <code>IllegalArgumentException</code> if this Container chooses not
       * to be attached to the specified Container, in which case it is not added
       *
       * @param child New child Container to be added
       *
       * @exception IllegalArgumentException if this exception is thrown by
       *  the <code>setParent()</code> method of the child Container
       * @exception IllegalArgumentException if the new child does not have
       *  a name unique from that of existing children of this Container
       * @exception IllegalStateException if this Container does not support
       *  child Containers
       */
      public void addChild(Container child);
  
  
      /**
       * Add a container event listener to this component.
       *
       * @param listener The listener to add
       */
      public void addContainerListener(ContainerListener listener);
  
  
      /**
       * Add the specified Mapper associated with this Container.
       *
       * @param mapper The corresponding Mapper implementation
       *
       * @exception IllegalArgumentException if this exception is thrown by
       *  the <code>setContainer()</code> method of the Mapper
       */
      public void addMapper(Mapper mapper);
  
  
      /**
       * Add a property change listener to this component.
       *
       * @param listener The listener to add
       */
      public void addPropertyChangeListener(PropertyChangeListener listener);
  
  
      /**
       * Return the child Container, associated with this Container, with
       * the specified name (if any); otherwise, return <code>null</code>
       *
       * @param name Name of the child Container to be retrieved
       */
      public Container findChild(String name);
  
  
      /**
       * Return the set of children Containers associated with this Container.
       * If this Container has no children, a zero-length array is returned.
       */
      public Container[] findChildren();
  
  
      /**
       * 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 <code>null</code>.
       *
       * @param protocol Protocol for which to find a Mapper
       */
      public Mapper findMapper(String protocol);
  
  
      /**
       * Return the set of Mappers associated with this Container.  If this
       * Container has no Mappers, a zero-length array is returned.
       */
      public Mapper[] findMappers();
  
  
      /**
       * Process the specified Request, and generate the corresponding Response,
       * according to the design of this particular Container.
       *
       * @param request Request to be processed
       * @param response Response to be produced
       *
       * @exception IOException if an input/output error occurred while
       *  processing
       * @exception ServletException if a ServletException was thrown
       *  while processing this request
       */
      public void invoke(Request request, Response response)
  	throws IOException, ServletException;
  
  
      /**
       * 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 <code>null</code> instead.
       *
       * @param request Request being processed
       * @param update Update the Request to reflect the mapping selection?
       */
      public Container map(Request request, boolean update);
  
  
      /**
       * Remove an existing child Container from association with this parent
       * Container.
       *
       * @param child Existing child Container to be removed
       */
      public void removeChild(Container child);
  
  
      /**
       * Remove a container event listener from this component.
       *
       * @param listener The listener to remove
       */
      public void removeContainerListener(ContainerListener listener);
  
  
      /**
       * Remove a Mapper associated with this Container, if any.
       *
       * @param mapper The Mapper to be removed
       */
      public void removeMapper(Mapper mapper);
  
  
      /**
       * Remove a property change listener from this component.
       *
       * @param listener The listener to remove
       */
      public void removePropertyChangeListener(PropertyChangeListener listener);
  
  
  }
  
  
  
  1.1                  jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/ContainerEvent.java
  
  Index: ContainerEvent.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/ContainerEvent.java,v 1.1 2000/08/11 05:24:04 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/08/11 05:24:04 $
   *
   * ====================================================================
   *
   * 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.util.EventObject;
  
  
  /**
   * General event for notifying listeners of significant changes on a Container.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/08/11 05:24:04 $
   */
  
  public final class ContainerEvent
      extends EventObject {
  
  
      /**
       * The Container on which this event occurred.
       */
      private Container container = null;
  
  
      /**
       * The event data associated with this event.
       */
      private Object data = null;
  
  
      /**
       * The event type this instance represents.
       */
      private String type = null;
  
  
      /**
       * Construct a new ContainerEvent with the specified parameters.
       *
       * @param container Container on which this event occurred
       * @param type Event type
       * @param data Event data
       */
      public ContainerEvent(Container container, String type, Object data) {
  
  	super(container);
  	this.container = container;
  	this.type = type;
  	this.data = data;
  
      }
  
  
      /**
       * Return the event data of this event.
       */
      public Object getData() {
  
  	return (this.data);
  
      }
  
  
      /**
       * Return the Container on which this event occurred.
       */
      public Container getContainer() {
  
  	return (this.container);
  
      }
  
  
      /**
       * Return the event type of this event.
       */
      public String getType() {
  
  	return (this.type);
  
      }
  
  
      /**
       * Return a string representation of this event.
       */
      public String toString() {
  
  	return ("ContainerEvent['" + getContainer().getName() + "','" +
  		getType() + "']");
  
      }
  
  
  }
  
  
  
  1.1                  jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/ContainerListener.java
  
  Index: ContainerListener.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/ContainerListener.java,v 1.1 2000/08/11 05:24:05 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/08/11 05:24:05 $
   *
   * ====================================================================
   *
   * 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.util.EventObject;
  
  
  /**
   * Interface defining a listener for significant Container generated events.
   * Note that "container start" and "container stop" events are normally
   * LifecycleEvents, not ContainerEvents.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/08/11 05:24:05 $
   */
  
  public interface ContainerListener {
  
  
      /**
       * Acknowledge the occurrence of the specified event.
       *
       * @param event ContainerEvent that has occurred
       */
      public void containerEvent(ContainerEvent event);
  
  
  }
  
  
  
  1.1                  jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Context.java
  
  Index: Context.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Context.java,v 1.1 2000/08/11 05:24:05 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/08/11 05:24:05 $
   *
   * ====================================================================
   *
   * 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 javax.servlet.ServletContext;
  import org.apache.catalina.deploy.ContextEjb;
  import org.apache.catalina.deploy.ContextEnvironment;
  import org.apache.catalina.deploy.ContextResource;
  import org.apache.catalina.deploy.ErrorPage;
  import org.apache.catalina.deploy.LoginConfig;
  import org.apache.catalina.deploy.SecurityConstraint;
  
  
  /**
   * A <b>Context</b> is a Container that represents a servlet context, and
   * therefore an individual web applicaiton, in the Catalina servlet engine.
   * It is therefore useful in almost every deploymentof Catalina (even if a
   * Connector attached to a web server (such as Apache) uses the web server's
   * facilities to identify the appropriate Wrapper to handle this request.
   * It also provides a convenient mechanism to use Interceptors that see
   * every request processed by this particular web application.
   * <p>
   * The parent Container attached to a Context is generally a Host, but may
   * be some other implementation, or may be omitted if it is not necessary.
   * <p>
   * The child containers attached to a Context are generally implementations
   * of Wrapper (representing individual servlet definitions).
   * <p>
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/08/11 05:24:05 $
   */
  
  public interface Context extends Container {
  
  
      // ------------------------------------------------------------- Properties
  
  
      /**
       * Return the "use cookies for session ids" flag.
       */
      public boolean getCookies();
  
  
      /**
       * Set the "use cookies for session ids" flag.
       *
       * @param cookies The new flag
       */
      public void setCookies(boolean cookies);
  
  
      /**
       * Return the distributable flag for this web application.
       */
      public boolean getDistributable();
      
      
      /**
       * Set the distributable flag for this web application.
       *
       * @param distributable The new distributable flag
       */
      public void setDistributable(boolean distributable);
  
  
      /**
       * Return the document root for this Context.  This can be an absolute
       * pathname, a relative pathname, or a URL.
       */
      public String getDocBase();
  
  
      /**
       * Set the document root for this Context.  This can be an absolute
       * pathname, a relative pathname, or a URL.
       *
       * @param docBase The new document root
       */
      public void setDocBase(String docBase);
  
  
      /**
       * Return the login configuration descriptor for this web application.
       */
      public LoginConfig getLoginConfig();
  
  
      /**
       * Set the login configuration descriptor for this web application.
       *
       * @param config The new login configuration
       */
      public void setLoginConfig(LoginConfig config);
  
  
      /**
       * Return the context path for this web application.
       */
      public String getPath();
  
  
      /**
       * Set the context path for this web application.
       *
       * @param path The new context path
       */
      public void setPath(String path);
  
  
      /**
       * Return the reloadable flag for this web application.
       */
      public boolean getReloadable();
  
  
      /**
       * Set the reloadable flag for this web application.
       *
       * @param reloadable The new reloadable flag
       */
      public void setReloadable(boolean reloadable);
  
  
      /**
       * Return the servlet context for which this Context is a facade.
       */
      public ServletContext getServletContext();
  
  
      /**
       * Return the default session timeout (in minutes) for this
       * web application.
       */
      public int getSessionTimeout();
  
  
      /**
       * Set the default session timeout (in minutes) for this
       * web application.
       *
       * @param timeout The new default session timeout
       */
      public void setSessionTimeout(int timeout);
  
  
      /**
       * Return the Java class name of the Wrapper implementation used
       * for servlets registered in this Context.
       */
      public String getWrapperClass();
  
  
      /**
       * Set the Java class name of the Wrapper implementation used
       * for servlets registered in this Context.
       *
       * @param wrapperClass The new wrapper class
       */
      public void setWrapperClass(String wrapperClass);
  
  
      // --------------------------------------------------------- Public Methods
  
  
      /**
       * Add a security constraint to the set for this web application.
       */
      public void addConstraint(SecurityConstraint constraint);
  
  
      /**
       * Add an EJB resource reference for this web application.
       *
       * @param ejb New EJB resource reference
       */
      public void addEjb(ContextEjb ejb);
  
  
      /**
       * Add an environment entry for this web application.
       *
       * @param environment New environment entry
       */
      public void addEnvironment(ContextEnvironment environment);
  
  
      /**
       * Add an error page for the specified error or Java exception.
       *
       * @param errorPage The error page definition to be added
       */
      public void addErrorPage(ErrorPage errorPage);
  
  
      /**
       * Add the classname of an InstanceListener to be added to each
       * Wrapper appended to this Context.
       *
       * @param listener Java class name of an InstanceListener class
       */
      public void addInstanceListener(String listener);
  
  
      /**
       * Add a new MIME mapping, replacing any existing mapping for
       * the specified extension.
       *
       * @param extension Filename extension being mapped
       * @param mimeType Corresponding MIME type
       */
      public void addMimeMapping(String extension, String mimeType);
  
  
      /**
       * Add a new context initialization parameter, replacing any existing
       * value for the specified name.
       *
       * @param name Name of the new parameter
       * @param value Value of the new  parameter
       */
      public void addParameter(String name, String value);
  
  
      /**
       * Add a resource reference for this web application.
       *
       * @param resource New resource reference
       */
      public void addResource(ContextResource resource);
  
  
      /**
       * Add a security role reference for this web application.
       *
       * @param role Security role used in the application
       * @param link Actual security role to check for
       */
      public void addRoleMapping(String role, String link);
  
  
      /**
       * Add a new security role for this web application.
       *
       * @param role New security role
       */
      public void addSecurityRole(String role);
  
  
      /**
       * Add a new servlet mapping, replacing any existing mapping for
       * the specified pattern.
       *
       * @param pattern URL pattern to be mapped
       * @param name Name of the corresponding servlet to execute
       */
      public void addServletMapping(String pattern, String name);
  
  
      /**
       * Add a JSP tag library for the specified URI.
       *
       * @param uri URI, relative to the web.xml file, of this tag library
       * @param location Location of the tag library descriptor
       */
      public void addTaglib(String uri, String location);
  
  
      /**
       * Add a new welcome file to the set recognized by this Context.
       *
       * @param name New welcome file name
       */
      public void addWelcomeFile(String name);
  
  
      /**
       * Add the classname of a LifecycleListener to be added to each
       * Wrapper appended to this Context.
       *
       * @param listener Java class name of a LifecycleListener class
       */
      public void addWrapperLifecycle(String listener);
  
  
      /**
       * Add the classname of a ContainerListener to be added to each
       * Wrapper appended to this Context.
       *
       * @param listener Java class name of a ContainerListener class
       */
      public void addWrapperListener(String listener);
  
  
      /**
       * Factory method to create and return a new Wrapper instance, of
       * the Java implementation class appropriate for this Context
       * implementation.  The constructor of the instantiated Wrapper
       * will have been called, but no properties will have been set.
       */
      public Wrapper createWrapper();
  
  
      /**
       * Return the set of security constraints for this web application.
       * If there are none, a zero-length array is returned.
       */
      public SecurityConstraint[] findConstraints();
  
  
      /**
       * Return the EJB resource reference with the specified name, if any;
       * otherwise, return <code>null</code>.
       *
       * @param name Name of the desired EJB resource reference
       */
      public ContextEjb findEjb(String name);
  
  
      /**
       * Return the defined EJB resource references for this application.
       * If there are none, a zero-length array is returned.
       */
      public ContextEjb[] findEjbs();
  
  
      /**
       * Return the environment entry with the specified name, if any;
       * otherwise, return <code>null</code>.
       *
       * @param name Name of the desired environment entry
       */
      public ContextEnvironment findEnvironment(String name);
  
  
      /**
       * Return the set of defined environment entries for this web
       * application.  If none have been defined, a zero-length array
       * is returned.
       */
      public ContextEnvironment[] findEnvironments();
  
  
      /**
       * Return the error page entry for the specified HTTP error code,
       * if any; otherwise return <code>null</code>.
       *
       * @param errorCode Error code to look up
       */
      public ErrorPage findErrorPage(int errorCode);
  
  
      /**
       * Return the error page entry for the specified Java exception type,
       * if any; otherwise return <code>null</code>.
       *
       * @param exceptionType Exception type to look up
       */
      public ErrorPage findErrorPage(String exceptionType);
  
  
      /**
       * Return the set of defined error pages for all specified error codes
       * and exception types.
       */
      public ErrorPage[] findErrorPages();
  
  
      /**
       * Return the set of InstanceListener classes that will be added to
       * newly created Wrappers automatically.
       */
      public String[] findInstanceListeners();
  
  
      /**
       * Return the MIME type to which the specified extension is mapped,
       * if any; otherwise return <code>null</code>.
       *
       * @param extension Extension to map to a MIME type
       */
      public String findMimeMapping(String extension);
  
  
      /**
       * Return the extensions for which MIME mappings are defined.  If there
       * are none, a zero-length array is returned.
       */
      public String[] findMimeMappings();
  
  
      /**
       * Return the value for the specified context initialization
       * parameter name, if any; otherwise return <code>null</code>.
       *
       * @param name Name of the parameter to return
       */
      public String findParameter(String name);
  
  
      /**
       * Return the names of all defined context initialization parameters
       * for this Context.  If no parameters are defined, a zero-length
       * array is returned.
       */
      public String[] findParameters();
  
  
      /**
       * Return the resource reference with the specified name, if any;
       * otherwise return <code>null</code>.
       *
       * @param name Name of the desired resource reference
       */
      public ContextResource findResource(String name);
  
  
      /**
       * Return the defined resource references for this application.  If
       * none have been defined, a zero-length array is returned.
       */
      public ContextResource[] findResources();
  
  
      /**
       * For the given security role (as used by an application), return the
       * corresponding role name (as defined by the underlying Realm) if there
       * is one.  Otherwise, return the specified role unchanged.
       *
       * @param role Security role to map
       */
      public String findRoleMapping(String role);
  
  
      /**
       * Return <code>true</code> if the specified security role is defined
       * for this application; otherwise return <code>false</code>.
       *
       * @param role Security role to verify
       */
      public boolean findSecurityRole(String role);
  
  
      /**
       * Return the security roles defined for this application.  If none
       * have been defined, a zero-length array is returned.
       */
      public String[] findSecurityRoles();
  
  
      /**
       * Return the servlet name mapped by the specified pattern (if any);
       * otherwise return <code>null</code>.
       *
       * @param pattern Pattern for which a mapping is requested
       */
      public String findServletMapping(String pattern);
  
  
      /**
       * Return the patterns of all defined servlet mappings for this
       * Context.  If no mappings are defined, a zero-length array is returned.
       */
      public String[] findServletMappings();
  
  
      /**
       * Return the tag library descriptor location for the specified taglib
       * URI, if any; otherwise, return <code>null</code>.
       *
       * @param uri URI, relative to the web.xml file
       */
      public String findTaglib(String uri);
  
  
      /**
       * Return the URIs of all tag libraries for which a tag library
       * descriptor location has been specified.  If none are specified,
       * a zero-length array is returned.
       */
      public String[] findTaglibs();
  
  
      /**
       * Return <code>true</code> if the specified welcome file is defined
       * for this Context; otherwise return <code>false</code>.
       *
       * @param name Welcome file to verify
       */
      public boolean findWelcomeFile(String name);
  
  
      /**
       * Return the set of welcome files defined for this Context.  If none are
       * defined, a zero-length array is returned.
       */
      public String[] findWelcomeFiles();
  
  
      /**
       * Return the set of LifecycleListener classes that will be added to
       * newly created Wrappers automatically.
       */
      public String[] findWrapperLifecycles();
  
  
      /**
       * Return the set of ContainerListener classes that will be added to
       * newly created Wrappers automatically.
       */
      public String[] findWrapperListeners();
  
  
      /**
       * Reload this web application, if reloading is supported.
       *
       * @exception IllegalStateException if the <code>reloadable</code>
       *  property is set to <code>false</code>.
       */
      public void reload();
  
  
      /**
       * Remove the specified security constraint from this web application.
       *
       * @param constraint Constraint to be removed
       */
      public void removeConstraint(SecurityConstraint constraint);
  
  
      /**
       * Remove any EJB resource reference with the specified name.
       *
       * @param name Name of the EJB resource reference to remove
       */
      public void removeEjb(String name);
  
  
      /**
       * Remove any environment entry with the specified name.
       *
       * @param name Name of the environment entry to remove
       */
      public void removeEnvironment(String name);
  
  
      /**
       * Remove the error page for the specified error code or
       * Java language exception, if it exists; otherwise, no action is taken.
       *
       * @param errorPage The error page definition to be removed
       */
      public void removeErrorPage(ErrorPage errorPage);
  
  
      /**
       * Remove a class name from the set of InstanceListener classes that
       * will be added to newly created Wrappers.
       *
       * @param listener Class name of an InstanceListener class to be removed
       */
      public void removeInstanceListener(String listener);
  
  
      /**
       * Remove the MIME mapping for the specified extension, if it exists;
       * otherwise, no action is taken.
       *
       * @param extension Extension to remove the mapping for
       */
      public void removeMimeMapping(String extension);
  
  
      /**
       * Remove the context initialization parameter with the specified
       * name, if it exists; otherwise, no action is taken.
       *
       * @param name Name of the parameter to remove
       */
      public void removeParameter(String name);
  
  
      /**
       * Remove any resource reference with the specified name.
       *
       * @param name Name of the resource reference to remove
       */
      public void removeResource(String name);
  
  
      /**
       * Remove any security role reference for the specified name
       *
       * @param role Security role (as used in the application) to remove
       */
      public void removeRoleMapping(String role);
  
  
      /**
       * Remove any security role with the specified name.
       *
       * @param role Security role to remove
       */
      public void removeSecurityRole(String role);
  
  
      /**
       * Remove any servlet mapping for the specified pattern, if it exists;
       * otherwise, no action is taken.
       *
       * @param pattern URL pattern of the mapping to remove
       */
      public void removeServletMapping(String pattern);
  
  
      /**
       * Remove the tag library location forthe specified tag library URI.
       *
       * @param uri URI, relative to the web.xml file
       */
      public void removeTaglib(String uri);
  
  
      /**
       * Remove the specified welcome file name from the list recognized
       * by this Context.
       *
       * @param name Name of the welcome file to be removed
       */
      public void removeWelcomeFile(String name);
  
  
      /**
       * Remove a class name from the set of ContainerListener classes that
       * will be added to newly created Wrappers.
       *
       * @param listener Class name of a ContainerListener class to be removed
       */
      public void removeWrapperListener(String listener);
  
  
  }
  
  
  
  1.1                  jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Engine.java
  
  Index: Engine.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Engine.java,v 1.1 2000/08/11 05:24:06 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/08/11 05:24:06 $
   *
   * ====================================================================
   *
   * 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;
  
  
  /**
   * An <b>Engine</b> is a Container that represents the entire Catalina servlet
   * engine.  It is useful in the following types of scenarios:
   * <ul>
   * <li>You wish to use Interceptors that see every single request processed
   *     by the entire engine.
   * <li>You wish to run Catalina in with a standalone HTTP connector, but still
   *     want support for multiple virtual hosts.
   * </ul>
   * In general, you would not use an Engine when deploying Catalina connected
   * to a web server (such as Apache), because the Connector will have
   * utilized the web server's facilities to determine which Context (or
   * perhaps even which Wrapper) should be utilized to process this request.
   * <p>
   * The child containers attached to an Engine are generally implementations
   * of Host (representing a virtual host) or Context (representing individual
   * an individual servlet context), depending upon the Engine implementation.
   * <p>
   * If used, an Engine is always the top level Container in a Catalina
   * hierarchy. Therefore, the implementation's <code>setParent()</code> method
   * should throw <code>IllegalArgumentException</code>.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/08/11 05:24:06 $
   */
  
  public interface Engine extends Container {
  
  
      // --------------------------------------------------------- Public Methods
  
  
  }
  
  
  
  1.1                  jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Host.java
  
  Index: Host.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Host.java,v 1.1 2000/08/11 05:24:06 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/08/11 05:24:06 $
   *
   * ====================================================================
   *
   * 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 javax.servlet.ServletContext;
  
  
  /**
   * A <b>Host</b> is a Container that represents a virtual host in the
   * Catalina servlet engine.  It is useful in the following types of scenarios:
   * <ul>
   * <li>You wish to use Interceptors that see every single request processed
   *     by this particular virtual host.
   * <li>You wish to run Catalina in with a standalone HTTP connector, but still
   *     want support for multiple virtual hosts.
   * </ul>
   * In general, you would not use a Host when deploying Catalina connected
   * to a web server (such as Apache), because the Connector will have
   * utilized the web server's facilities to determine which Context (or
   * perhaps even which Wrapper) should be utilized to process this request.
   * <p>
   * The parent Container attached to a Host is generally an Engine, but may
   * be some other implementation, or may be omitted if it is not necessary.
   * <p>
   * The child containers attached to a Host are generally implementations
   * of Host (representing a virtual host) or Context (representing individual
   * an individual servlet context), depending upon the Engine implementation.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/08/11 05:24:06 $
   */
  
  public interface Host extends Container {
  
  
      // ----------------------------------------------------- Manifest Constants
  
  
      /**
       * The ContainerEvent event type sent when a new alias is added
       * by <code>addAlias()</code>.
       */
      public static final String ADD_ALIAS_EVENT = "addAlias";
  
  
      /**
       * The ContainerEvent event type sent when an old alias is removed
       * by <code>removeAlias()</code>.
       */
      public static final String REMOVE_ALIAS_EVENT = "removeAlias";
  
  
      // ------------------------------------------------------------- Properties
  
  
      /**
       * Return the application root for this Host.  This can be an absolute
       * pathname, a relative pathname, or a URL.
       */
      public String getAppBase();
  
  
      /**
       * Set the application root for this Host.  This can be an absolute
       * pathname, a relative pathname, or a URL.
       *
       * @param appBase The new application root
       */
      public void setAppBase(String appBase);
  
  
      /**
       * Return the canonical, fully qualified, name of the virtual host
       * this Container represents.
       */
      public String getName();
  
  
      /**
       * Set the canonical, fully qualified, name of the virtual host
       * this Container represents.
       *
       * @param name Virtual host name
       *
       * @exception IllegalArgumentException if name is null
       */
      public void setName(String name);
  
  
      /**
       * Return a specialized ServletContext instance that wraps the
       * resources of the underlying virtual host; or <code>null</code>
       * if access to these resources is not supported or not allowed.
       * In general, this method will be used when a servlet calls
       * <code>ServletContext.getContext("/")</code>.
       */
      public ServletContext getRootContext();
  
  
      // --------------------------------------------------------- Public Methods
  
  
      /**
       * Add an alias name that should be mapped to this same Host.
       *
       * @param alias The alias to be added
       */
      public void addAlias(String alias);
  
  
      /**
       * Return the set of alias names for this Host.  If none are defined,
       * a zero length array is returned.
       */
      public String[] findAliases();
  
  
      /**
       * Return the Context that would be used to process the specified
       * host-relative request URI, if any; otherwise return <code>null</code>.
       *
       * @param uri Request URI to be mapped
       */
      public Context map(String uri);
  
  
      /**
       * Remove the specified alias name from the aliases for this Host.
       *
       * @param alias Alias name to be removed
       */
      public void removeAlias(String alias);
  
  
  }
  
  
  
  1.1                  jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/HttpRequest.java
  
  Index: HttpRequest.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/HttpRequest.java,v 1.1 2000/08/11 05:24:06 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/08/11 05:24:06 $
   *
   * ====================================================================
   *
   * 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.security.Principal;
  import java.util.Locale;
  import javax.servlet.http.Cookie;
  
  
  /**
   * An <b>HttpRequest</b> is the Catalina internal facade for an
   * <code>HttpServletRequest</code> that is to be processed, in order to
   * produce the corresponding <code>HttpResponse</code>.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/08/11 05:24:06 $
   */
  
  public interface HttpRequest extends Request {
  
  
      // --------------------------------------------------------- Public Methods
  
  
      /**
       * Add a Cookie to the set of Cookies associated with this Request.
       *
       * @param cookie The new cookie
       */
      public void addCookie(Cookie cookie);
  
  
      /**
       * Add a Header to the set of Headers associated with this Request.
       *
       * @param name The new header name
       * @param value The new header value
       */
      public void addHeader(String name, String value);
  
  
      /**
       * Add a Locale to the set of preferred Locales for this Request.  The
       * first added Locale will be the first one returned by getLocales().
       *
       * @param locale The new preferred Locale
       */
      public void addLocale(Locale locale);
  
  
      /**
       * Clear the collection of Cookies associated with this Request.
       */
      public void clearCookies();
  
  
      /**
       * Clear the collection of Headers associated with this Request.
       */
      public void clearHeaders();
  
  
      /**
       * Clear the collection of Locales associated with this Request.
       */
      public void clearLocales();
  
  
      /**
       * Set the authentication type used for this request, if any; otherwise
       * set the type to <code>null</code>.  Typical values are "BASIC",
       * "DIGEST", or "SSL".
       *
       * @param type The authentication type used
       */
      public void setAuthType(String type);
  
  
      /**
       * Set the context path for this Request.  This will normally be called
       * when the associated Context is mapping the Request to a particular
       * Wrapper.
       *
       * @param path The context path
       */
      public void setContextPath(String path);
  
  
      /**
       * Set the HTTP request method used for this Request.
       *
       * @param method The request method
       */
      public void setMethod(String method);
  
  
      /**
       * Set the query string for this Request.  This will normally be called
       * by the HTTP Connector, when it parses the request headers.
       *
       * @param query The query string
       */
      public void setQueryString(String query);
  
  
      /**
       * Set the path information for this Request.  This will normally be called
       * when the associated Context is mapping the Request to a particular
       * Wrapper.
       *
       * @param path The path information
       */
      public void setPathInfo(String path);
  
  
      /**
       * Set a flag indicating whether or not the requested session ID for this
       * request came in through a cookie.  This is normally called by the
       * HTTP Connector, when it parses the request headers.
       *
       * @param flag The new flag
       */
      public void setRequestedSessionCookie(boolean flag);
  
  
      /**
       * Set the requested session ID for this request.  This is normally called
       * by the HTTP Connector, when it parses the request headers.
       *
       * @param id The new session id
       */
      public void setRequestedSessionId(String id);
  
  
      /**
       * Set a flag indicating whether or not the requested session ID for this
       * request came in through a URL.  This is normally called by the
       * HTTP Connector, when it parses the request headers.
       *
       * @param flag The new flag
       */
      public void setRequestedSessionURL(boolean flag);
  
  
      /**
       * Set the unparsed request URI for this Request.  This will normally be
       * called by the HTTP Connector, when it parses the request headers.
       *
       * @param uri The request URI
       */
      public void setRequestURI(String uri);
  
  
      /**
       * Set the servlet path for this Request.  This will normally be called
       * when the associated Context is mapping the Request to a particular
       * Wrapper.
       *
       * @param path The servlet path
       */
      public void setServletPath(String path);
  
  
      /**
       * Set the Principal who has been authenticated for this Request.  This
       * value is also used to calculate the value to be returned by the
       * <code>getRemoteUser()</code> method.
       *
       * @param principal The user Principal
       */
      public void setUserPrincipal(Principal principal);
  
  
  }
  
  
  
  1.1                  jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/HttpResponse.java
  
  Index: HttpResponse.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/HttpResponse.java,v 1.1 2000/08/11 05:24:06 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/08/11 05:24:06 $
   *
   * ====================================================================
   *
   * 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;
  
  
  /**
   * An <b>HttpResponse</b> is the Catalina-internal facade for an
   * <code>HttpServletResponse</code> that is to be produced,
   * based on the processing of a corresponding <code>HttpRequest</code>.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/08/11 05:24:06 $
   */
  
  public interface HttpResponse
      extends Response {
  
  
      // --------------------------------------------------------- Public Methods
  
  
      /**
       * Return the value for the specified header, or <code>null</code> if this
       * header has not been set.  If more than one value was added for this
       * name, only the first is returned; use getHeaderValues() to retrieve all
       * of them.
       *
       * @param name Header name to look up
       */
      public String getHeader(String name);
  
  
      /**
       * Return an array of all the header names set for this response, or
       * a zero-length array if no headers have been set.
       */
      public String[] getHeaderNames();
  
  
      /**
       * Return an array of all the header values associated with the
       * specified header name, or an zero-length array if there are no such
       * header values.
       *
       * @param name Header name to look up
       */
      public String[] getHeaderValues(String name);
  
  
      /**
       * Return the error message that was set with <code>sendError()</code>
       * for this Response.
       */
      public String getMessage();
  
  
      /**
       * Return the HTTP status code associated with this Response.
       */
      public int getStatus();
  
  
  }
  
  
  
  1.1                  jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/InstanceEvent.java
  
  Index: InstanceEvent.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/InstanceEvent.java,v 1.1 2000/08/11 05:24:07 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/08/11 05:24:07 $
   *
   * ====================================================================
   *
   * 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.util.EventObject;
  import javax.servlet.Servlet;
  
  
  /**
   * General event for notifying listeners of significant events related to
   * a specific instance of a servlet, as opposed to the Wrapper component
   * that manages it.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/08/11 05:24:07 $
   */
  
  public final class InstanceEvent
      extends EventObject {
  
  
      // ----------------------------------------------------- Manifest Constants
  
  
      /**
       * The event indicating that the <code>init()</code> method is about
       * to be called for this instance.
       */
      public static final String BEFORE_INIT_EVENT = "beforeInit";
  
  
      /**
       * The event indicating that the <code>init()</code> method has returned.
       */
      public static final String AFTER_INIT_EVENT = "afterInit";
  
  
      /**
       * The event indicating that the <code>service()</code> method is about
       * to be called for this instance.
       */
      public static final String BEFORE_SERVICE_EVENT = "beforeService";
  
  
      /**
       * The event indicating that the <code>service()</code> method has
       * returned.
       */
      public static final String AFTER_SERVICE_EVENT = "afterService";
  
  
      /**
       * The event indicating that the <code>destroy</code> method is about
       * to be called for this instance.
       */
      public static final String BEFORE_DESTROY_EVENT = "beforeDestroy";
  
  
      /**
       * The event indicating that the <code>destroy()</code> method has
       * returned.
       */
      public static final String AFTER_DESTROY_EVENT = "afterDestroy";
  
  
      // ----------------------------------------------------------- Constructors
  
  
      /**
       * Construct a new InstanceEvent with the specified parameters.
       *
       * @param wrapper Wrapper managing this servlet instance
       * @param servlet Servlet instance for which this event occurred
       * @param type Event type (required)
       */
      public InstanceEvent(Wrapper wrapper, Servlet servlet, String type) {
  
        super(wrapper);
        this.wrapper = wrapper;
        this.servlet = servlet;
        this.type = type;
  
      }
  
  
      // ----------------------------------------------------- Instance Variables
  
  
      /**
       * The Servlet instance for which this event occurred.
       */
      private Servlet servlet = null;
  
  
      /**
       * The event type this instance represents.
       */
      private String type = null;
  
  
      /**
       * The Wrapper managing the servlet instance for which this event occurred.
       */
      private Wrapper wrapper = null;
  
  
      // ------------------------------------------------------------- Properties
  
  
      /**
       * Return the servlet instance for which this event occurred.
       */
      public Servlet getServlet() {
  
  	return (this.servlet);
  
      }
  
  
      /**
       * Return the event type of this event.
       */
      public String getType() {
  
  	return (this.type);
  
      }
  
  
      /**
       * Return the Wrapper managing the servlet instance for which this
       * event occurred.
       */
      public Wrapper getWrapper() {
  
  	return (this.wrapper);
  
      }
  
  
  }
  
  
  
  1.1                  jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/InstanceListener.java
  
  Index: InstanceListener.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/InstanceListener.java,v 1.1 2000/08/11 05:24:07 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/08/11 05:24:07 $
   *
   * ====================================================================
   *
   * 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;
  
  
  /**
   * Interface defining a listener for significant events related to a
   * specific servlet instance, rather than to the Wrapper component that
   * is managing that instance.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/08/11 05:24:07 $
   */
  
  public interface InstanceListener {
  
  
      /**
       * Acknowledge the occurrence of the specified event.
       *
       * @param event InstanceEvent that has occurred
       */
      public void instanceEvent(InstanceEvent event);
  
  
  }
  
  
  
  1.1                  jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Lifecycle.java
  
  Index: Lifecycle.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Lifecycle.java,v 1.1 2000/08/11 05:24:07 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/08/11 05:24:07 $
   *
   * ====================================================================
   *
   * 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;
  
  
  /**
   * Common interface for component life cycle methods.  Catalina components
   * may, but are not required to, implement this interface (as well as the
   * appropriate interface(s) for the functionality they support) in order to
   * provide a consistent mechanism to start and stop the component.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/08/11 05:24:07 $
   */
  
  public interface Lifecycle {
  
  
      // ----------------------------------------------------- Manifest Constants
  
  
      /**
       * The LifecycleEvent type for the "component start" event.
       */
      public static final String START_EVENT = "start";
  
  
      /**
       * The LifecycleEvent type for the "component stop" event.
       */
      public static final String STOP_EVENT = "stop";
  
  
      // --------------------------------------------------------- Public Methods
  
  
  
      /**
       * Add a LifecycleEvent listener to this component.
       *
       * @param listener The listener to add
       */
      public void addLifecycleListener(LifecycleListener listener);
  
  
      /**
       * Remove a LifecycleEvent listener from this component.
       *
       * @param listener The listener to remove
       */
      public void removeLifecycleListener(LifecycleListener listener);
  
  
      /**
       * Prepare for the beginning of active use of the public methods of this
       * component.  This method should be called before any of the public
       * methods of this component are utilized.  It should also send a
       * LifecycleEvent of type START_EVENT to any registered listeners.
       *
       * @exception IllegalStateException if this component has already been
       *  started
       * @exception LifecycleException if this component detects a fatal error
       *  that prevents this component from being used
       */
      public void start() throws LifecycleException;
  
  
      /**
       * Gracefully terminate the active use of the public methods of this
       * component.  This method should be the last one called on a given
       * instance of this component.  It should also send a LifecycleEvent
       * of type STOP_EVENT to any registered listeners.
       *
       * @exception IllegalStateException if this component has not been started
       * @exception LifecycleException if this component detects a fatal error
       *  that needs to be reported
       */
      public void stop() throws LifecycleException;
  
  
  }
  
  
  
  1.1                  jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/LifecycleEvent.java
  
  Index: LifecycleEvent.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/LifecycleEvent.java,v 1.1 2000/08/11 05:24:08 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/08/11 05:24:08 $
   *
   * ====================================================================
   *
   * 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.util.EventObject;
  
  
  /**
   * General event for notifying listeners of significant changes on a component
   * that implements the Lifecycle interface.  In particular, this will be useful
   * on Containers, where these events replace the ContextInterceptor concept in
   * Tomcat 3.x.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/08/11 05:24:08 $
   */
  
  public final class LifecycleEvent
      extends EventObject {
  
  
      // ----------------------------------------------------------- Constructors
  
  
      /**
       * Construct a new LifecycleEvent with the specified parameters.
       *
       * @param lifecycle Component on which this event occurred
       * @param type Event type (required)
       */
      public LifecycleEvent(Lifecycle lifecycle, String type) {
  
  	this(lifecycle, type, null);
  
      }
  
  
      /**
       * Construct a new LifecycleEvent with the specified parameters.
       *
       * @param lifecycle Component on which this event occurred
       * @param type Event type (required)
       * @param data Event data (if any)
       */
      public LifecycleEvent(Lifecycle lifecycle, String type, Object data) {
  
  	super(lifecycle);
  	this.lifecycle = lifecycle;
  	this.type = type;
  	this.data = data;
  
      }
  
  
      // ----------------------------------------------------- Instance Variables
  
  
      /**
       * The event data associated with this event.
       */
      private Object data = null;
  
  
      /**
       * The Lifecycle on which this event occurred.
       */
      private Lifecycle lifecycle = null;
  
  
      /**
       * The event type this instance represents.
       */
      private String type = null;
  
  
      // ------------------------------------------------------------- Properties
  
  
      /**
       * Return the event data of this event.
       */
      public Object getData() {
  
  	return (this.data);
  
      }
  
  
      /**
       * Return the Lifecycle on which this event occurred.
       */
      public Lifecycle getLifecycle() {
  
  	return (this.lifecycle);
  
      }
  
  
      /**
       * Return the event type of this event.
       */
      public String getType() {
  
  	return (this.type);
  
      }
  
  
  }
  
  
  
  1.1                  jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/LifecycleException.java
  
  Index: LifecycleException.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/LifecycleException.java,v 1.1 2000/08/11 05:24:08 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/08/11 05:24:08 $
   *
   * ====================================================================
   *
   * 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;
  
  
  /**
   * General purpose exception that is thrown to indicate a lifecycle related
   * problem.  Such exceptions should generally be considered fatal to the
   * operation of the application containing this component.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/08/11 05:24:08 $
   */
  
  public final class LifecycleException extends Exception {
  
  
      //------------------------------------------------------------ Constructors
  
  
      /**
       * Construct a new LifecycleException with no other information.
       */
      public LifecycleException() {
  
  	this(null, null);
  
      }
  
  
      /**
       * Construct a new LifecycleException for the specified message.
       *
       * @param message Message describing this exception
       */
      public LifecycleException(String message) {
  
  	this(message, null);
  
      }
  
  
      /**
       * Construct a new LifecycleException for the specified throwable.
       *
       * @param throwable Throwable that caused this exception
       */
      public LifecycleException(Throwable throwable) {
  
  	this(null, throwable);
  
      }
  
  
      /**
       * Construct a new LifecycleException for the specified message
       * and throwable.
       *
       * @param message Message describing this exception
       * @param throwable Throwable that caused this exception
       */
      public LifecycleException(String message, Throwable throwable) {
  
  	super();
  	this.message = message;
  	this.throwable = throwable;
  
      }
  
  
      //------------------------------------------------------ Instance Variables
  
  
      /**
       * The error message passed to our constructor (if any)
       */
      protected String message = null;
  
  
      /**
       * The underlying exception or error passed to our constructor (if any)
       */
      protected Throwable throwable = null;
  
  
      //---------------------------------------------------------- Public Methods
  
  
      /**
       * Returns the message associated with this exception, if any.
       */
      public String getMessage() {
  
  	return (message);
  
      }
  
  
      /**
       * Returns the throwable that caused this exception, if any.
       */
      public Throwable getThrowable() {
  
  	return (throwable);
  
      }
  
  
      /**
       * Return a formatted string that describes this exception.
       */
      public String toString() {
  
  	StringBuffer sb = new StringBuffer("LifecycleException:  ");
  	if (message != null) {
  	    sb.append(message);
  	    if (throwable != null) {
  		sb.append(":  ");
  	    }
  	}
  	if (throwable != null) {
  	    sb.append(throwable.toString());
  	}
  	return (sb.toString());
  
      }
  
  
  }
  
  
  
  1.1                  jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/LifecycleListener.java
  
  Index: LifecycleListener.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/LifecycleListener.java,v 1.1 2000/08/11 05:24:08 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/08/11 05:24:08 $
   *
   * ====================================================================
   *
   * 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.util.EventObject;
  
  
  /**
   * Interface defining a listener for significant events (including "component
   * start" and "component stop" generated by a component that implements the
   * Lifecycle interface.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/08/11 05:24:08 $
   */
  
  public interface LifecycleListener {
  
  
      /**
       * Acknowledge the occurrence of the specified event.
       *
       * @param event LifecycleEvent that has occurred
       */
      public void lifecycleEvent(LifecycleEvent event);
  
  
  }
  
  
  
  1.1                  jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Loader.java
  
  Index: Loader.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Loader.java,v 1.1 2000/08/11 05:24:08 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/08/11 05:24:08 $
   *
   * ====================================================================
   *
   * 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;
  
  
  /**
   * A <b>Loader</b> represents a Java ClassLoader implementation that can
   * be used by a Container to load class files (within a repository associated
   * with the Loader) that are designed to be reloaded upon request, as well as
   * a mechanism to detect whether changes have occurred in the underlying
   * repository.
   * <p>
   * In order for a <code>Loader</code> implementation to successfully operate
   * with a <code>Context</code> implementation that implements reloading, it
   * must obey the following constraints:
   * <ul>
   * <li>Must implement <code>Lifecycle</code> so that the Context can indicate
   *     that a new class loader is required.
   * <li>The <code>start()</code> method must unconditionally create a new
   *     <code>ClassLoader</code> implementation.
   * <li>The <code>stop()</code> method must throw away its reference to the
   *     <code>ClassLoader</code> previously utilized, so that the class loader,
   *     all classes loaded by it, and all objects of those classes, can be
   *     garbage collected.
   * <li>Must allow a call to <code>stop()</code> to be followed by a call to
   *     <code>start()</code> on the same <code>Loader</code> instance.
   * <li>Based on a policy chosen by the implementation, must call the
   *     <code>Context.reload()</code> method on the owning <code>Context</code>
   *     when a change to one or more of the class files loaded by this class
   *     loader is detected.
   * </ul>
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/08/11 05:24:08 $
   */
  
  public interface Loader {
  
  
      // ------------------------------------------------------------- Properties
  
  
      /**
       * Return the Java class loader to be used by this Container.
       */
      public ClassLoader getClassLoader();
  
  
      /**
       * Return the Container with which this Loader has been associated.
       */
      public Container getContainer();
  
  
      /**
       * Set the Container with which this Loader has been associated.
       *
       * @param container The associated Container
       */
      public void setContainer(Container container);
  
  
      /**
       * Return descriptive information about this Loader implementation and
       * the corresponding version number, in the format
       * <code>&lt;description&gt;/&lt;version&gt;</code>.
       */
      public String getInfo();
  
  
      /**
       * Return the reloadable flag for this Loader.
       */
      public boolean getReloadable();
  
  
      /**
       * Set the reloadable flag for this Loader.
       *
       * @param reloadable The new reloadable flag
       */
      public void setReloadable(boolean reloadable);
  
  
      // --------------------------------------------------------- Public Methods
  
  
      /**
       * Add a property change listener to this component.
       *
       * @param listener The listener to add
       */
      public void addPropertyChangeListener(PropertyChangeListener listener);
  
  
      /**
       * Add a new repository to the set of repositories for this class loader.
       *
       * @param repository Repository to be added
       */
      public void addRepository(String repository);
  
  
      /**
       * Return the set of repositories defined for this class loader.
       * If none are defined, a zero-length array is returned.
       */
      public String[] findRepositories();
  
  
      /**
       * Has the internal repository associated with this Loader been modified,
       * such that the loaded classes should be reloaded?
       */
      public boolean modified();
  
  
      /**
       * Remove a property change listener from this component.
       *
       * @param listener The listener to remove
       */
      public void removePropertyChangeListener(PropertyChangeListener listener);
  
  
      /**
       * Remove a repository from the set of repositories for this loader.
       *
       * @param repository Repository to be removed
       */
      public void removeRepository(String repository);
  
  
  }
  
  
  
  1.1                  jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Logger.java
  
  Index: Logger.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Logger.java,v 1.1 2000/08/11 05:24:09 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/08/11 05:24:09 $
   *
   * ====================================================================
   *
   * 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;
  
  
  /**
   * A <b>Logger</b> is a generic interface for the message and exception
   * logging methods of the ServletContext interface.  Loggers can be
   * attached at any Container level, but will typically only be attached
   * to a Context, or higher level, Container.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/08/11 05:24:09 $
   */
  
  public interface Logger {
  
  
      // ----------------------------------------------------- Manifest Constants
  
  
      /**
       * Verbosity level constants for log messages that may be filtered
       * by the underlying logger.
       */
  
      public static final int FATAL = Integer.MIN_VALUE;
  
      public static final int ERROR = 1;
  
      public static final int WARNING = 2;
  
      public static final int INFORMATION = 3;
  
      public static final int DEBUG = 4;
  
  
      // ------------------------------------------------------------- Properties
  
  
      /**
       * Return the Container with which this Logger has been associated.
       */
      public Container getContainer();
  
  
      /**
       * Set the Container with which this Logger has been associated.
       *
       * @param container The associated Container
       */
      public void setContainer(Container container);
  
  
      /**
       * Return descriptive information about this Logger implementation and
       * the corresponding version number, in the format
       * <code>&lt;description&gt;/&lt;version&gt;</code>.
       */
      public String getInfo();
  
  
      /**
       * Return the verbosity level of this logger.  Messages logged with a
       * higher verbosity than this level will be silently ignored.
       */
      public int getVerbosity();
  
  
      /**
       * Set the verbosity level of this logger.  Messages logged with a
       * higher verbosity than this level will be silently ignored.
       *
       * @param verbosity The new verbosity level
       */
      public void setVerbosity(int verbosity);
  
  
      // --------------------------------------------------------- Public Methods
  
  
      /**
       * Add a property change listener to this component.
       *
       * @param listener The listener to add
       */
      public void addPropertyChangeListener(PropertyChangeListener listener);
  
  
      /**
       * Writes the specified message to a servlet log file, usually an event
       * log.  The name and type of the servlet log is specific to the
       * servlet container.  This message will be logged unconditionally.
       *
       * @param message A <code>String</code> specifying the message to be
       *  written to the log file
       */
      public void log(String message);
  
  
      /**
       * Writes the specified exception, and message, to a servlet log file.
       * The implementation of this method should call
       * <code>log(msg, exception)</code> instead.  This method is deprecated
       * in the ServletContext interface, but not deprecated here to avoid
       * many useless compiler warnings.  This message will be logged
       * unconditionally.
       *
       * @param exception An <code>Exception</code> to be reported
       * @param msg The associated message string
       */
      public void log(Exception exception, String msg);
  
  
      /**
       * Writes an explanatory message and a stack trace for a given
       * <code>Throwable</code> exception to the servlet log file.  The name
       * and type of the servlet log file is specific to the servlet container,
       * usually an event log.  This message will be logged unconditionally.
       *
       * @param message A <code>String</code> that describes the error or
       *  exception
       * @param throwable The <code>Throwable</code> error or exception
       */
      public void log(String message, Throwable throwable);
  
  
      /**
       * Writes the specified message to the servlet log file, usually an event
       * log, if the logger is set to a verbosity level equal to or higher than
       * the specified value for this message.
       *
       * @param message A <code>String</code> specifying the message to be
       *  written to the log file
       * @param verbosity Verbosity level of this message
       */
      public void log(String message, int verbosity);
  
  
      /**
       * Writes the specified message and exception to the servlet log file,
       * usually an event log, if the logger is set to a verbosity level equal
       * to or higher than the specified value for this message.
       *
       * @param message A <code>String</code> that describes the error or
       *  exception
       * @param throwable The <code>Throwable</code> error or exception
       * @param verbosity Verbosity level of this message
       */
      public void log(String message, Throwable throwable, int verbosity);
  
  
      /**
       * Remove a property change listener from this component.
       *
       * @param listener The listener to remove
       */
      public void removePropertyChangeListener(PropertyChangeListener listener);
  
  
  }
  
  
  
  1.1                  jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Manager.java
  
  Index: Manager.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Manager.java,v 1.1 2000/08/11 05:24:09 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/08/11 05:24:09 $
   *
   * ====================================================================
   *
   * 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;
  
  
  /**
   * A <b>Manager</b> manages the pool of Sessions that are associated with a
   * particular Container.  Different Manager implementations may support
   * value-added features such as the persistent storage of session data,
   * as well as migrating sessions for distributable web applications.
   * <p>
   * In order for a <code>Manager</code> implementation to successfully operate
   * with a <code>Context</code> implementation that implements reloading, it
   * must obey the following constraints:
   * <ul>
   * <li>Must implement <code>Lifecycle</code> so that the Context can indicate
   *     that a restart is required.
   * <li>Must allow a call to <code>stop()</code> to be followed by a call to
   *     <code>start()</code> on the same <code>Manager</code> instance.
   * </ul>
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/08/11 05:24:09 $
   */
  
  public interface Manager {
  
  
      // ------------------------------------------------------------- Properties
  
  
      /**
       * Return the Container with which this Manager is associated.
       */
      public Container getContainer();
  
  
      /**
       * Set the Container with which this Manager is associated.
       *
       * @param container The newly associated Container
       */
      public void setContainer(Container container);
  
  
      /**
       * Return the distributable flag for the sessions supported by
       * this Manager.
       */
      public boolean getDistributable();
  
  
      /**
       * Set the distributable flag for the sessions supported by this
       * Manager.  If this flag is set, all user data objects added to
       * sessions associated with this manager must implement Serializable.
       *
       * @param distributable The new distributable flag
       */
      public void setDistributable(boolean distributable);
  
  
      /**
       * Return descriptive information about this Manager implementation and
       * the corresponding version number, in the format
       * <code>&lt;description&gt;/&lt;version&gt;</code>.
       */
      public String getInfo();
  
  
      /**
       * Return the default maximum inactive interval (in seconds)
       * for Sessions created by this Manager.
       */
      public int getMaxInactiveInterval();
  
  
      /**
       * Set the default maximum inactive interval (in seconds)
       * for Sessions created by this Manager.
       *
       * @param interval The new default value
       */
      public void setMaxInactiveInterval(int interval);
  
  
      // --------------------------------------------------------- Public Methods
  
  
      /**
       * Add a property change listener to this component.
       *
       * @param listener The listener to add
       */
      public void addPropertyChangeListener(PropertyChangeListener listener);
  
  
      /**
       * Construct and return a new session object, based on the default
       * settings specified by this Manager's properties.  The session
       * id will be assigned by this method, and available via the getId()
       * method of the returned session.  If a new session cannot be created
       * for any reason, return <code>null</code>.
       *
       * @exception IllegalStateException if a new session cannot be
       *  instantiated for any reason
       */
      public Session createSession();
  
  
      /**
       * Return the active Session, associated with this Manager, with the
       * specified session id (if any); otherwise return <code>null</code>.
       *
       * @param id The session id for the session to be returned
       *
       * @exception IllegalStateException if a new session cannot be
       *  instantiated for any reason
       * @exception IOException if an input/output error occurs while
       *  processing this request
       */
      public Session findSession(String id) throws IOException;
  
  
      /**
       * Return the set of active Sessions associated with this Manager.
       * If this Manager has no active Sessions, a zero-length array is returned.
       */
      public Session[] findSessions();
  
  
      /**
       * Remove a property change listener from this component.
       *
       * @param listener The listener to remove
       */
      public void removePropertyChangeListener(PropertyChangeListener listener);
  
  
  }
  
  
  
  1.1                  jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Mapper.java
  
  Index: Mapper.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Mapper.java,v 1.1 2000/08/11 05:24:09 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/08/11 05:24:09 $
   *
   * ====================================================================
   *
   * 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;
  
  
  /**
   * Interface defining methods that a parent Container may implement to select
   * a subordinate Container to process a particular Request, optionally
   * modifying the properties of the Request to reflect the selections made.
   * <p>
   * A typical Container may be associated with a single Mapper that processes
   * all requests to that Container, or a Mapper per request protocol that allows
   * the same Container to support multiple protocols at once.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/08/11 05:24:09 $
   */
  
  public interface Mapper {
  
  
      // ------------------------------------------------------------- Properties
  
  
      /**
       * Return the Container with which this Mapper is associated.
       */
      public Container getContainer();
  
  
      /**
       * Set the Container with which this Mapper is associated.
       *
       * @param container The newly associated Container
       *
       * @exception IllegalArgumentException if this Container is not
       *  acceptable to this Mapper
       */
      public void setContainer(Container container);
  
  
      /**
       * Return the protocol for which this Mapper is responsible.
       */
      public String getProtocol();
  
  
      /**
       * Set the protocol for which this Mapper is responsible.
       *
       * @param protocol The newly associated protocol
       */
      public void setProtocol(String protocol);
  
  
      // --------------------------------------------------------- Public Methods
  
  
      /**
       * 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 <code>null</code> instead.
       *
       * @param request Request being processed
       * @param update Update the Request to reflect the mapping selection?
       */
      public Container map(Request request, boolean update);
  
  
  }
  
  
  
  1.1                  jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Pipeline.java
  
  Index: Pipeline.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Pipeline.java,v 1.1 2000/08/11 05:24:10 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/08/11 05:24:10 $
   *
   * ====================================================================
   *
   * 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;
  
  
  /**
   * An optional interface, normally implemented by a Container, that indicates
   * support for a pipeline of <b>Valves</b> is present.  When pipeline support
   * is present, the Container's <code>invoke()</code> method will call the
   * <code>invoke()</code> method of the first added Valve, which will either
   * generate the response or pass the request on to the next Valve in the
   * pipeline.
   * <p>
   * The Container must ensure that at least one Valve in the pipeline actually
   * generates the response and returns.  Typically, this is accomplished by
   * configuring the Container's normal processing (in the absence of any
   * other Valves) as a Valve that always appears last in the pipeline.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/08/11 05:24:10 $
   */
  
  public interface Pipeline {
  
  
      // --------------------------------------------------------- Public Methods
  
  
      /**
       * Add a new Valve to the end of the pipeline associated with this
       * Container.  Prior to adding the Valve, the Valve's
       * <code>setContainer</code> method must be called, with this Container
       * as an argument.  The method may throw an
       * <code>IllegalArgumentException</code> if this Valve chooses not to
       * be associated with this Container, or <code>IllegalStateException</code>
       * if it is already associated with a different Container.
       *
       * @param valve Valve to be added
       *
       * @exception IllegalArgumentException if this Container refused to
       *  accept the specified Valve
       * @exception IllegalArgumentException if the specifie Valve refuses to be
       *  associated with this Container
       * @exception IllegalStateException if the specified Valve is already
       *  associated with a different Container
       */
      public void addValve(Valve valve);
  
  
      /**
       * Return the first Valve in the pipeline associated with this Container.
       * If there are no such Valves, <code>null</code> is returned.
       */
      public Valve findValves();
  
  
      /**
       * Remove the specified Valve from the pipeline associated with this
       * Container, if it is found; otherwise, do nothing.
       *
       * @param valve Valve to be removed
       */
      public void removeValve(Valve valve);
  
  
  }
  
  
  
  1.1                  jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Realm.java
  
  Index: Realm.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Realm.java,v 1.1 2000/08/11 05:24:10 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/08/11 05:24:10 $
   *
   * ====================================================================
   *
   * 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.security.Principal;
  
  
  /**
   * A <b>Realm</b> is a read-only facade for an underlying security realm
   * used to authenticate individual users, and identify the security roles
   * associated with those users.  Realms can be attached at any Container
   * level, but will typically only be attached to a Context, or higher level,
   * Container.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/08/11 05:24:10 $
   */
  
  public interface Realm {
  
  
      // ------------------------------------------------------------- Properties
  
  
      /**
       * Return the Container with which this Realm has been associated.
       */
      public Container getContainer();
  
  
      /**
       * Set the Container with which this Realm has been associated.
       *
       * @param container The associated Container
       */
      public void setContainer(Container container);
  
  
      /**
       * Return descriptive information about this Realm implementation and
       * the corresponding version number, in the format
       * <code>&lt;description&gt;/&lt;version&gt;</code>.
       */
      public String getInfo();
  
  
      // --------------------------------------------------------- Public Methods
  
  
      /**
       * Add a property change listener to this component.
       *
       * @param listener The listener to add
       */
      public void addPropertyChangeListener(PropertyChangeListener listener);
  
  
      /**
       * Return the Principal associated with the specified username and
       * credentials, if there is one; otherwise return <code>null</code>.
       *
       * @param username Username of the Principal to look up
       * @param credentials Password or other credentials to use in
       *  authenticating this username
       */
      public Principal authenticate(String username, String credentials);
  
  
      /**
       * Return the Principal associated with the specified username and
       * credentials, if there is one; otherwise return <code>null</code>.
       *
       * @param username Username of the Principal to look up
       * @param credentials Password or other credentials to use in
       *  authenticating this username
       */
      public Principal authenticate(String username, byte[] credentials);
  
  
      /**
       * Return the Principal associated with the specified username, which
       * matches the digest calculated using the given parameters using the 
       * method described in RFC 2069; otherwise return <code>null</code>.
       * 
       * @param username Username of the Principal to look up
       * @param digest Digest which has been submitted by the client
       * @param nonce Unique (or supposedly unique) token which has been used
       * for this request
       * @param realm Realm name
       * @param md5a2 Second MD5 digest used to calculate the digest : 
       * MD5(Method + ":" + uri)
       */
      public Principal authenticate(String username, String digest,
                                    String nonce, String nc, String cnonce,
                                    String qop, String realm,
                                    String md5a2);
  
  
      /**
       * Return <code>true</code> if the specified Principal has the specified
       * security role, within the context of this Realm; otherwise return
       * <code>false</code>.
       *
       * @param principal Principal for whom the role is to be checked
       * @param role Security role to be checked
       */
      public boolean hasRole(Principal principal, String role);
  
  
      /**
       * Remove a property change listener from this component.
       *
       * @param listener The listener to remove
       */
      public void removePropertyChangeListener(PropertyChangeListener listener);
  
  
  }
  
  
  
  1.1                  jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Request.java
  
  Index: Request.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Request.java,v 1.1 2000/08/11 05:24:10 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/08/11 05:24:10 $
   *
   * ====================================================================
   *
   * 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.io.InputStream;
  import java.io.IOException;
  import javax.servlet.ServletException;
  import javax.servlet.ServletInputStream;
  import javax.servlet.ServletRequest;
  
  
  /**
   * A <b>Request</b> is the Catalina-internal facade for a
   * <code>ServletRequest</code> that is to be processed, in order to
   * produce the corresponding <code>Response</code>.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/08/11 05:24:10 $
   */
  
  public interface Request {
  
  
      // ------------------------------------------------------------- Properties
  
  
      /**
       * Return the authorization credentials sent with this request.
       */
      public String getAuthorization();
  
  
      /**
       * Set the authorization credentials sent with this request.
       *
       * @param authorization The new authorization credentials
       */
      public void setAuthorization(String authorization);
  
  
      /**
       * Return the Connector through which this Request was received.
       */
      public Connector getConnector();
  
  
      /**
       * Set the Connector through which this Request was received.
       *
       * @param connector The new connector
       */
      public void setConnector(Connector connector);
  
  
      /**
       * Return the Context within which this Request is being processed.
       */
      public Context getContext();
  
  
      /**
       * Set the Context within which this Request is being processed.  This
       * must be called as soon as the appropriate Context is identified, because
       * it identifies the value to be returned by <code>getContextPath()</code>,
       * and thus enables parsing of the request URI.
       *
       * @param context The newly associated Context
       */
      public void setContext(Context context);
  
  
      /**
       * Return descriptive information about this Request implementation and
       * the corresponding version number, in the format
       * <code>&lt;description&gt;/&lt;version&gt;</code>.
       */
      public String getInfo();
  
  
      /**
       * Return the <code>ServletRequest</code> for which this object
       * is the facade.
       */
      public ServletRequest getRequest();
  
  
      /**
       * Return the Response with which this Request is associated.
       */
      public Response getResponse();
  
  
      /**
       * Set the Response with which this Request is associated.
       *
       * @param response The new associated response
       */
      public void setResponse(Response response);
  
  
      /**
       * Return the input stream associated with this Request.
       */
      public InputStream getStream();
  
  
      /**
       * Set the input stream associated with this Request.
       *
       * @param stream The new input stream
       */
      public void setStream(InputStream stream);
  
  
      /**
       * Return the Wrapper within which this Request is being processed.
       */
      public Wrapper getWrapper();
  
  
      /**
       * Set the Wrapper within which this Request is being processed.  This
       * must be called as soon as the appropriate Wrapper is identified, and
       * before the Request is ultimately passed to an application servlet.
       *
       * @param wrapper The newly associated Wrapper
       */
      public void setWrapper(Wrapper wrapper);
  
  
      // --------------------------------------------------------- Public Methods
  
  
      /**
       * Create and return a ServletInputStream to read the content
       * associated with this Request.
       *
       * @exception IOException if an input/output error occurs
       */
      public ServletInputStream createInputStream() throws IOException;
  
  
      /**
       * Perform whatever actions are required to flush and close the input
       * stream or reader, in a single operation.
       *
       * @exception IOException if an input/output error occurs
       */
      public void finishRequest() throws IOException;
  
  
      /**
       * Release all object references, and initialize instance variables, in
       * preparation for reuse of this object.
       */
      public void recycle();
  
  
      /**
       * Set the content length associated with this Request.
       *
       * @param length The new content length
       */
      public void setContentLength(int length);
  
  
      /**
       * Set the content type (and optionally the character encoding)
       * associated with this Request.  For example,
       * <code>text/html; charset=ISO-8859-4</code>.
       *
       * @param type The new content type
       */
      public void setContentType(String type);
  
  
      /**
       * Set the protocol name and version associated with this Request.
       *
       * @param protocol Protocol name and version
       */
      public void setProtocol(String protocol);
  
  
      /**
       * Set the remote IP address associated with this Request.  NOTE:  This
       * value will be used to resolve the value for <code>getRemoteHost()</code>
       * if that method is called.
       *
       * @param remote The remote IP address
       */
      public void setRemoteAddr(String remote);
  
  
      /**
       * Set the name of the scheme associated with this request.  Typical values
       * are <code>http</code>, <code>https</code>, and <code>ftp</code>.
       *
       * @param scheme The scheme
       */
      public void setScheme(String scheme);
  
  
      /**
       * Set the value to be returned by <code>isSecure()</code>
       * for this Request.
       *
       * @param secure The new isSecure value
       */
      public void setSecure(boolean secure);
  
  
      /**
       * Set the name of the server (virtual host) to process this request.
       *
       * @param name The server name
       */
      public void setServerName(String name);
  
  
      /**
       * Set the port number of the server to process this request.
       *
       * @param port The server port
       */
      public void setServerPort(int port);
  
  
  }
  
  
  
  1.1                  jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Resources.java
  
  Index: Resources.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Resources.java,v 1.1 2000/08/11 05:24:10 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/08/11 05:24:10 $
   *
   * ====================================================================
   *
   * 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.InputStream;
  import java.net.MalformedURLException;
  import java.net.URL;
  
  
  /**
   * A <b>Resources</b> is a generic interface for the resource acquisition
   * and lookup methods of the ServletContext interface.
   * <p>
   * A Resources object is generally attached to a Context, or higher level,
   * Container.  However, a Connector may also provide a Resources object
   * associated with a particular Request, which should be treated by any
   * Container processing this request as overriding any Resources object
   * normally configured for this Container.
   *
   * @author Craig R. McClanahan
   * @author Remy Maucherat
   * @version $Revision: 1.1 $ $Date: 2000/08/11 05:24:10 $
   */
  
  public interface Resources {
  
  
      // ------------------------------------------------------------- Properties
  
  
      /**
       * Return the Container with which this Resources has been associated.
       */
      public Container getContainer();
  
  
      /**
       * Set the Container with which this Resources has been associated.
       *
       * @param container The associated Container
       */
      public void setContainer(Container container);
  
  
      /**
       * Return the "expand directory resources into listings" property.
       */
      public boolean getExpand();
  
  
      /**
       * Set the "expand directory resources into listings" property.
       *
       * @param expand The new expand flag
       */
      public void setExpand(boolean expand);
  
  
      /**
       * Return descriptive information about this Resources implementation and
       * the corresponding version number, in the format
       * <code>&lt;description&gt;/&lt;version&gt;</code>.
       */
      public String getInfo();
  
  
      // --------------------------------------------------------- Public Methods
  
  
      /**
       * Add a property change listener to this component.
       *
       * @param listener The listener to add
       */
      public void addPropertyChangeListener(PropertyChangeListener listener);
  
  
      /**
       * Return the MIME type of the specified file, or <code>null</code> if
       * the MIME type is not known.  The MIME type is determined by the
       * configuration of the servlet container, and may be specified in a
       * web application descriptor.  Common MIME types are
       * <code>"text/html"</code> and <code>"image/gif"</code>.
       *
       * @param file Name of the file whose MIME type is to be determined
       */
      public String getMimeType(String file);
  
  
      /**
       * Return the real path for a given virtual path.  For example, the
       * virtual path <code>"/index.html"</code> has a real path of whatever
       * file on the server's filesystem would be served by a request for
       * <code>"/index.html"</code>.
       * <p>
       * The real path returned will be in a form appropriate to the computer
       * and operating system on which the servlet container is running,
       * including the proper path separators.  This method returns
       * <code>null</code> if the servlet container cannot translate the
       * virtual path to a real path for any reason (such as when the content
       * is being made available from a <code>.war</code> archive).
       *
       * @param path The virtual path to be translated
       */
      public String getRealPath(String path);
  
  
      /**
       * Return a URL to the resource that is mapped to the specified path.
       * The path must begin with a "/" and is interpreted as relative to
       * the current context root.
       * <p>
       * This method allows the Container to make a resource available to
       * servlets from any source.  Resources can be located on a local or
       * remote file system, in a database, or in a <code>.war</code> file.
       * <p>
       * The servlet container must implement the URL handlers and
       * <code>URLConnection</code> objects that are necessary to access
       * the resource.
       * <p>
       * This method returns <code>null</code> if no resource is mapped to
       * the pathname.
       * <p>
       * Some Containers may allow writing to the URL returned by this method,
       * using the methods of the URL class.
       * <p>
       * The resource content is returned directly, so be aware that
       * requesting a <code>.jsp</code> page returns the JSP source code.
       * Use a <code>RequestDispatcher</code> instead to include results
       * of an execution.
       * <p>
       * This method has a different purpose than
       * <code>java.lang.Class.getResource()</code>, which looks up resources
       * based on a class loader.  This method does not use class loaders.
       *
       * @param path The path to the desired resource
       *
       * @exception MalformedURLException if the pathname is not given
       *  in the correct form
       */
      public URL getResource(String path) throws MalformedURLException;
  
  
      /**
       * Return the resource located at the named path as an
       * <code>InputStream</code> object.
       * <p>
       * The data in the <code>InputStream</code> can be of any type or length.
       * The path must be specified according to the rules given in
       * <code>getResource()</code>.  This method returns <code>null</code>
       * if no resource exists at the specified path.
       * <p>
       * Meta-information such as content length and content type that is
       * available via the <code>getResource()</code> method is lost when
       * using this method.
       * <p>
       * The servlet container must implement the URL handlers and
       * <code>URLConnection</code> objects that are necessary to access
       * the resource.
       * <p>
       * This method is different from
       * <code>java.lang.Class.getResourceAsStream()</code>, which uses a
       * class loader.  This method allows servlet containers to make a
       * resource available to a servlet from any location, without using
       * a class loader.
       *
       * @param path The path to the desired resource
       */
      public InputStream getResourceAsStream(String path);
  
  
      /**
       * Returns true if a resource exists at the specified path, 
       * where <code>path</code> would be suitable for passing as an argument to
       * <code>getResource()</code> or <code>getResourceAsStream()</code>.  
       * If there is no resource at the specified location, return false.
       *
       * @param path The path to the desired resource
       */
      public boolean exists(String path);
  
  
      /**
       * Return the last modified date/time of the resource at the specified
       * path, where <code>path</code> would be suitable for passing as an
       * argument to <code>getResource()</code> or
       * <code>getResourceAsStream()</code>.  If there is no resource at the
       * specified location, return -1.
       *
       * @param path The path to the desired resource
       */
      public long getResourceModified(String path);
  
  
      /**
       * Return the creation date/time of the resource at the specified
       * path, where <code>path</code> would be suitable for passing as an
       * argument to <code>getResource()</code> or
       * <code>getResourceAsStream()</code>.  If there is no resource at the
       * specified location, return -1. If this time is unknown, the 
       * implementation should return getResourceModified(path).
       *
       * @param path The path to the desired resource
       */
      public long getResourceCreated(String path);
  
  
      /**
       * Return the content length of the resource at the specified
       * path, where <code>path</code> would be suitable for passing as an
       * argument to <code>getResource()</code> or
       * <code>getResourceAsStream()</code>.  If the content length
       * of the resource can't be determinedof if the resource is a collection, 
       * return -1. If no content is available, return 0.
       *
       * @param path The path to the desired resource
       */
      public long getResourceLength(String path);
  
  
      /**
       * Return true if the resource at the specified path is a collection. A
       * collection is a special type of resource which has no content but 
       * contains child resources.
       *
       * @param path The path to the desired resource
       */
      public boolean isCollection(String path);
  
  
      /**
       * Return the children of the resource at the specified path, if any. This
       * will return null if the resource is not a collection, or if it is a 
       * collection but has no children.
       * 
       * @param path The path to the desired resource
       */
      public String[] getCollectionMembers(String path);
  
  
      /**
       * Set the content of the resource at the specified path. If the resource
       * already exists, its previous content is overwritten. If the resource
       * doesn't exist, its immediate parent collection (according to the path 
       * given) exists, then its created, and the given content is associated
       * with it. Return false if either the resource is a collection, or
       * no parent collection exist.
       * 
       * @param path The path to the desired resource
       * @param content InputStream to the content to be set
       */
      public boolean setResource(String path, InputStream content);
  
  
      /**
       * Create a collection at the specified path. A parent collection for this
       * collection must exist. Return false if a resource already exist at the
       * path specified, or if the parent collection doesn't exist.
       * 
       * @param path The path to the desired resource
       */
      public boolean createCollection(String path);
  
  
      /**
       * Delete the specified resource. Non-empty collections cannot be deleted
       * before deleting all their member resources. Return false is deletion
       * fails because either the resource specified doesn't exist, or the 
       * resource is a non-empty collection.
       * 
       * @param path The path to the desired resource
       */
      public boolean deleteResource(String path);
  
  
      /**
       * Remove a property change listener from this component.
       *
       * @param listener The listener to remove
       */
      public void removePropertyChangeListener(PropertyChangeListener listener);
  
  
  }
  
  
  
  
  
  1.1                  jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Response.java
  
  Index: Response.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Response.java,v 1.1 2000/08/11 05:24:11 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/08/11 05:24:11 $
   *
   * ====================================================================
   *
   * 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.io.IOException;
  import java.io.OutputStream;
  import java.io.PrintWriter;
  import javax.servlet.ServletException;
  import javax.servlet.ServletOutputStream;
  import javax.servlet.ServletResponse;
  
  
  /**
   * A <b>Response</b> is the Catalina-internal facade for a
   * <code>ServletResponse</code> that is to be produced,
   * based on the processing of a corresponding <code>Request</code>.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/08/11 05:24:11 $
   */
  
  public interface Response {
  
  
      // ------------------------------------------------------------- Properties
  
  
      /**
       * Return the Connector through which this Response is returned.
       */
      public Connector getConnector();
  
  
      /**
       * Set the Connector through which this Response is returned.
       *
       * @param connector The new connector
       */
      public void setConnector(Connector connector);
  
  
      /**
       * Return the number of bytes actually written to the output stream.
       */
      public int getContentCount();
  
  
      /**
       * Return the Context with which this Response is associated.
       */
      public Context getContext();
  
  
      /**
       * Set the Context with which this Response is associated.  This should
       * be called as soon as the appropriate Context is identified.
       *
       * @param context The associated Context
       */
      public void setContext(Context context);
  
  
      /**
       * Return the "processing inside an include" flag.
       */
      public boolean getIncluded();
  
  
      /**
       * Set the "processing inside an include" flag.
       *
       * @param included <code>true</code> if we are currently inside a
       *  RequestDispatcher.include(), else <code>false</code>
       */
      public void setIncluded(boolean included);
  
  
      /**
       * Return descriptive information about this Response implementation and
       * the corresponding version number, in the format
       * <code>&lt;description&gt;/&lt;version&gt;</code>.
       */
      public String getInfo();
  
  
      /**
       * Return the Request with which this Response is associated.
       */
      public Request getRequest();
  
  
      /**
       * Set the Request with which this Response is associated.
       *
       * @param request The new associated request
       */
      public void setRequest(Request request);
  
  
      /**
       * Return the <code>ServletResponse</code> for which this object
       * is the facade.
       */
      public ServletResponse getResponse();
  
  
      /**
       * Return the output stream associated with this Response.
       */
      public OutputStream getStream();
  
  
      /**
       * Set the output stream associated with this Response.
       *
       * @param stream The new output stream
       */
      public void setStream(OutputStream stream);
  
  
      // --------------------------------------------------------- Public Methods
  
  
      /**
       * Create and return a ServletOutputStream to write the content
       * associated with this Response.
       *
       * @exception IOException if an input/output error occurs
       */
      public ServletOutputStream createOutputStream() throws IOException;
  
  
      /**
       * Perform whatever actions are required to flush and close the output
       * stream or writer, in a single operation.
       *
       * @exception IOException if an input/output error occurs
       */
      public void finishResponse() throws IOException;
  
  
      /**
       * Return the content length that was set or calculated for this Response.
       */
      public int getContentLength();
  
  
      /**
       * Return the content type that was set or calculated for this response,
       * or <code>null</code> if no content type was set.
       */
      public String getContentType();
  
  
      /**
       * Return a PrintWriter that can be used to render error messages,
       * regardless of whether a stream or writer has already been acquired.
       */
      public PrintWriter getReporter();
  
  
      /**
       * Release all object references, and initialize instance variables, in
       * preparation for reuse of this object.
       */
      public void recycle();
  
  
      /**
       * Reset the data buffer but not any status or header information.
       */
      public void resetBuffer();
  
  
  }
  
  
  
  1.1                  jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Server.java
  
  Index: Server.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Server.java,v 1.1 2000/08/11 05:24:11 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/08/11 05:24:11 $
   *
   * ====================================================================
   *
   * 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;
  
  
  /**
   * A <b>Server</b> represents one convenient way to package a set of
   * <code>Connectors</code> associated with a particular <code>Container</code>.
   * You can have several many-to-one relationships (set of Connectors associated
   * with one Container) by adding one or more Connectors first, followed by the
   * corresponding Container, and then repeating this pattern.
   * <p>
   * This interface (and the corresonding implementation) exist to simplify
   * configuring Catalina from a <code>server.xml</code> file.  It has no
   * functional role once the server has been started.
   * <p>
   * Normally, an implementation of this interface will also implement
   * <code>Lifecycle</code>, such that when the <code>start()</code> and
   * <code>stop()</code> methods are called, all of the defined Containers
   * and Connectors are also started or stopped.
   * <p>
   * In between, the implementation must open a server socket on the port number
   * specified by the <code>port</code> property.  When a connection is accepted,
   * the first line is read and compared with the specified shutdown command.
   * If the command matches, shutdown of the server is initiated.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/08/11 05:24:11 $
   */
  
  public interface Server {
  
  
      // ------------------------------------------------------------- Properties
  
  
      /**
       * Return the port number we listen to for shutdown commands.
       */
      public int getPort();
  
  
      /**
       * Set the port number we listen to for shutdown commands.
       *
       * @param port The new port number
       */
      public void setPort(int port);
  
  
      /**
       * Return the shutdown command string we are waiting for.
       */
      public String getShutdown();
  
  
      /**
       * Set the shutdown command we are waiting for.
       *
       * @param shutdown The new shutdown command
       */
      public void setShutdown(String shutdown);
  
  
      // --------------------------------------------------------- Public Methods
  
  
      /**
       * Add a new Connector to the set of defined Connectors.  The newly
       * added Connector will have no associated Container until a later call
       * to <code>addContainer()</code> is made.
       *
       * @param connector The connector to be added
       */
      public void addConnector(Connector connector);
  
  
      /**
       * Add a new Container to the set of defined Containers, and assign this
       * Container to all defined Connectors that have not yet been associated
       * with a Container will be associated with this one.
       *
       * @param container The container to be added
       *
       * @exception IllegalStateException if there are no unassociated
       *  Connectors to associate with (implying calls out of order)
       */
      public void addContainer(Container container);
  
  
      /**
       * Wait until a proper shutdown command is received, then return.
       */
      public void await();
  
  
      /**
       * Return descriptive information about this Server implementation and
       * the corresponding version number, in the format
       * <code>&lt;description&gt;/&lt;version&gt;</code>.
       */
      public String getInfo();
  
  
  }
  
  
  
  1.1                  jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Session.java
  
  Index: Session.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Session.java,v 1.1 2000/08/11 05:24:12 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/08/11 05:24:12 $
   *
   * ====================================================================
   *
   * 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.io.IOException;
  import java.security.Principal;
  import javax.servlet.ServletException;
  import javax.servlet.http.HttpSession;
  
  
  /**
   * A <b>Session</b> is the Catalina-internal facade for an
   * <code>HttpSession</code> that is used to maintain state information
   * between requests for a particular user of a web application.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/08/11 05:24:12 $
   */
  
  public interface Session {
  
  
      // ------------------------------------------------------------- Properties
  
  
      /**
       * Return the creation time for this session.
       */
      public long getCreationTime();
  
  
      /**
       * Set the creation time for this session.  This method is called by the
       * Manager when an existing Session instance is reused.
       *
       * @param time The new creation time
       */
      public void setCreationTime(long time);
  
  
      /**
       * Return the session identifier for this session.
       */
      public String getId();
  
  
      /**
       * Set the session identifier for this session.
       *
       * @param id The new session identifier
       */
      public void setId(String id);
  
  
      /**
       * Return descriptive information about this Session implementation and
       * the corresponding version number, in the format
       * <code>&lt;description&gt;/&lt;version&gt;</code>.
       */
      public String getInfo();
  
  
      /**
       * Return the last time the client sent a request associated with this
       * session, as the number of milliseconds since midnight, January 1, 1970
       * GMT.  Actions that your application takes, such as getting or setting
       * a value associated with the session, do not affect the access time.
       */
      public long getLastAccessedTime();
  
  
      /**
       * Return the Manager within which this Session is valid.
       */
      public Manager getManager();
  
  
      /**
       * Set the Manager within which this Session is valid.
       *
       * @param manager The new Manager
       */
      public void setManager(Manager manager);
  
  
      /**
       * Return the maximum time interval, in seconds, between client requests
       * before the servlet container will invalidate the session.  A negative
       * time indicates that the session should never time out.
       */
      public int getMaxInactiveInterval();
  
  
      /**
       * Set the maximum time interval, in seconds, between client requests
       * before the servlet container will invalidate the session.  A negative
       * time indicates that the session should never time out.
       *
       * @param interval The new maximum interval
       */
      public void setMaxInactiveInterval(int interval);
  
  
      /**
       * Return the authenticated Principal that is associated with this Session.
       * This provides an <code>Authenticator</code> with a means to cache a
       * previously authenticated Principal, and avoid potentially expensive
       * <code>Realm.authenticate()</code> calls on every request.  If there
       * is no current associated Principal, return <code>null</code>.
       */
      public Principal getPrincipal();
  
  
      /**
       * Set the authenticated Principal that is associated with this Session.
       * This provides an <code>Authenticator</code> with a means to cache a
       * previously authenticated Principal, and avoid potentially expensive
       * <code>Realm.authenticate()</code> calls on every request.
       *
       * @param principal The new Principal, or <code>null</code> if none
       */
      public void setPrincipal(Principal principal);
  
  
      /**
       * Return the <code>HttpSession</code> for which this object
       * is the facade.
       */
      public HttpSession getSession();
  
  
      // --------------------------------------------------------- Public Methods
  
  
      /**
       * Update the accessed time information for this session.  This method
       * should be called by the context when a request comes in for a particular
       * session, even if the application does not reference it.
       */
      public void access();
  
  
      /**
       * Perform the internal processing required to invalidate this session,
       * without triggering an exception if the session has already expired.
       */
      public void expire();
  
  
      /**
       * Return the <code>isValid</code> flag for this session.
       */
      public boolean isValid();
  
  
      /**
       * Release all object references, and initialize instance variables, in
       * preparation for reuse of this object.
       */
      public void recycle();
  
  
  }
  
  
  
  1.1                  jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Store.java
  
  Index: Store.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Store.java,v 1.1 2000/08/11 05:24:12 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/08/11 05:24:12 $
   *
   * ====================================================================
   *
   * 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;
  
  
  /**
   * A <b>Store</b> is the abstraction of a Catalina component that provides
   * persistent storage and loading of Sessions and their associated user data.
   * Implementations are free to save and load the Sessions to any media they
   * wish, but it is assumed that saved Sessions are persistent across
   * server or context restarts.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/08/11 05:24:12 $
   */
  
  public interface Store {
  
  
      // ------------------------------------------------------------- Properties
  
  
      /**
       * Return descriptive information about this Store implementation and
       * the corresponding version number, in the format
       * <code>&lt;description&gt;/&lt;version&gt;</code>.
       */
      public String getInfo();
  
  
      /**
       * Return the number of Sessions present in this Store.
       *
       * @exception IOException if an input/output error occurs
       */
      public int getSize() throws IOException;
  
  
      // --------------------------------------------------------- Public Methods
  
  
      /**
       * Add a property change listener to this component.
       *
       * @param listener The listener to add
       */
      public void addPropertyChangeListener(PropertyChangeListener listener);
  
  
      /**
       * Return an array containing the session identifiers of all Sessions
       * currently saved in this Store.  If there are no such Sessions, a
       * zero-length array is returned.
       *
       * @exception IOException if an input/output error occurred
       */
      public String[] keys() throws IOException;
  
  
      /**
       * Load and return the Session associated with the specified session
       * identifier from this Store, without removing it.  If there is no
       * such stored Session, return <code>null</code>.
       *
       * @param id Session identifier of the session to load
       *
       * @exception ClassNotFoundException if a deserialization error occurs
       * @exception IOException if an input/output error occurs
       */
      public Session load(String id)
          throws ClassNotFoundException, IOException;
  
  
      /**
       * Remove the Session with the specified session identifier from
       * this Store, if present.  If no such Session is present, this method
       * takes no action.
       *
       * @param id Session identifier of the Session to be removed
       *
       * @exception IOException if an input/output error occurs
       */
      public void remove(String id) throws IOException;
  
  
      /**
       * Remove a property change listener from this component.
       *
       * @param listener The listener to remove
       */
      public void removePropertyChangeListener(PropertyChangeListener listener);
  
  
      /**
       * Save the specified Session into this Store.  Any previously saved
       * information for the associated session identifier is replaced.
       *
       * @param session Session to be saved
       *
       * @exception IOException if an input/output error occurs
       */
      public void save(Session session) throws IOException;
  
  
  }
  
  
  
  1.1                  jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Valve.java
  
  Index: Valve.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Valve.java,v 1.1 2000/08/11 05:24:12 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/08/11 05:24:12 $
   *
   * ====================================================================
   *
   * 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.io.IOException;
  import javax.servlet.ServletException;
  
  
  /**
   * A <b>Valve</b> is a request processing component associated with a
   * particular Container.  A series of Valves may be associated with the
   * same Container, creating a request processing pipeline.
   * <p>
   * <b>HISTORICAL NOTE</b>:  The "Valve" name was assigned to this concept
   * because a valve is what you use in a real world pipeline to control and/or
   * modify flows through it.
   *
   * @author Craig R. McClanahan
   * @author Gunnar Rjnning
   * @version $Revision: 1.1 $ $Date: 2000/08/11 05:24:12 $
   */
  
  public interface Valve {
  
  
      //-------------------------------------------------------------- Properties
  
  
      /**
       * Return the Container with which this Valve is associated, if any.
       */
      public Container getContainer();
  
  
      /**
       * Set the Container with which this Valve is associated.
       *
       * @param container The newly associated Container
       *
       * @exception IllegalArgumentException if this Valve refused to be
       *  associated with the specified Container
       * @exception IllegalStateException if this Valve is already
       *  associated a different Container.
       */
      public void setContainer(Container container);
  
  
      /**
       * Return descriptive information about this Valve implementation.
       */
      public String getInfo();
  
  
      /**
       * Return the next Valve in the pipeline containing this Valve, if any.
       */
      public Valve getNext();
  
  
      /**
       * Set the next Valve in the pipeline containing this Valve.
       *
       * @param valve The new next valve, or <code>null</code> if none
       */
      public void setNext(Valve valve);
  
  
      /**
       * Return the previous Valve in the pipeline containing this Valve, if any.
       */
      public Valve getPrevious();
  
  
      /**
       * Set the previous Valve in the pipeline containing this Valve.
       *
       * @param valve The new previous valve, or <code>null</code> if none
       */
      public void setPrevious(Valve valve);
  
  
      //---------------------------------------------------------- Public Methods
  
  
      /**
       * Perform request processing as required by this Valve.
       * <p>
       * An individual Valve <b>MAY</b> perform the following actions, in
       * the specified order:
       * <ul>
       * <li>Examine and/or modify the properties of the specified Request and
       *     Response.
       * <li>Examine the properties of the specified Request, completely generate
       *     the corresponding Response, and return control to the caller.
       * <li>Examine the properties of the specified Request and Response, wrap
       *     either or both of these objects to supplement their functionality,
       *     and pass them on.
       * <li>If the corresponding Response was not generated (and control was not
       *     returned, call the next Valve in the pipeline (if there is one) by
       *     executing <code>getNext().invoke()</code>.
       * <li>Examine, but not modify, the properties of the resulting Response
       *     (which was created by a subsequently invoked Valve or Container).
       * </ul>
       * <p>
       * A Valve <b>MUST NOT</b> do any of the following things:
       * <ul>
       * <li>Change request properties that have already been used to direct
       *     the flow of processing control for this request (for instance,
       *     trying to change the virtual host to which a Request should be
       *     sent from a pipeline attached to a Host or Context in the
       *     standard implementation).
       * <li>Create a completed Response <strong>AND</strong> pass this
       *     Request and Response on to the next Valve in the pipeline.
       * <li>Consume bytes from the input stream associated with the Request,
       *     unless it is completely generating the response, or wrapping the
       *     request before passing it on.
       * <li>Modify the HTTP headers included with the Response after the
       *     next <code>invoke()</code> has returned.
       * <li>Perform any actions on the output stream associated with the
       *     specified Response after the next <code>invoke()</code> has
       *     returned.
       * </ul>
       * <p>
       *
       * @param request The servlet request to be processed
       * @param response The servlet response to be created
       *
       * @exception IOException if an input/output error occurs
       * @exception ServletException if a servlet error occurs
       */
      public void invoke(Request request, Response response)
  	throws IOException, ServletException;
  
  
  }
  
  
  
  1.1                  jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Wrapper.java
  
  Index: Wrapper.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Wrapper.java,v 1.1 2000/08/11 05:24:12 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/08/11 05:24:12 $
   *
   * ====================================================================
   *
   * 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 javax.servlet.Servlet;
  import javax.servlet.ServletException;
  
  
  /**
   * A <b>Wrapper</b> is a Container that represents an individual servlet
   * definition from the deployment descriptor of the web application.  It
   * provides a convenient mechanism to use Interceptors that see every single
   * request to the servlet represented by this definition.
   * <p>
   * Implementations of Wrapper are responsible for managing the servlet life
   * cycle for their underlying servlet class, including calling init() and
   * destroy() at appropriate times, as well as respecting the existence of
   * the SingleThreadModel declaration on the servlet class itself.
   * <p>
   * The parent Container attached to a Wrapper will generally be an
   * implementation of Context, representing the servlet context (and
   * therefore the web application) within which this servlet executes.
   * <p>
   * Child Containers are not allowed on Wrapper implementations, so the
   * <code>addChild()</code> method should throw an
   * <code>IllegalArgumentException</code>.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/08/11 05:24:12 $
   */
  
  public interface Wrapper extends Container {
  
  
      // ------------------------------------------------------------- Properties
  
  
      /**
       * Return the available date/time for this servlet, in milliseconds since
       * the epoch.  If this date/time is in the future, any request for this
       * servlet will return an SC_SERVICE_UNAVAILABLE error.  If it is zero,
       * the servlet is currently available.  A value equal to Long.MAX_VALUE
       * is considered to mean that unavailability is permanent.
       */
      public long getAvailable();
  
  
      /**
       * Set the available date/time for this servlet, in milliseconds since the
       * epoch.  If this date/time is in the future, any request for this servlet
       * will return an SC_SERVICE_UNAVAILABLE error.  A value equal to
       * Long.MAX_VALUE is considered to mean that unavailability is permanent.
       *
       * @param available The new available date/time
       */
      public void setAvailable(long available);
  
  
      /**
       * Return the context-relative URI of the JSP file for this servlet.
       */
      public String getJspFile();
  
  
      /**
       * Set the context-relative URI of the JSP file for this servlet.
       *
       * @param jspFile JSP file URI
       */
      public void setJspFile(String jspFile);
  
  
      /**
       * Return the load-on-startup order value (negative value means
       * load on first call).
       */
      public int getLoadOnStartup();
  
  
      /**
       * Set the load-on-startup order value (negative value means
       * load on first call).
       *
       * @param value New load-on-startup value
       */
      public void setLoadOnStartup(int value);
  
  
      /**
       * Return the fully qualified servlet class name for this servlet.
       */
      public String getServletClass();
  
  
      /**
       * Set the fully qualified servlet class name for this servlet.
       *
       * @param servletClass Servlet class name
       */
      public void setServletClass(String servletClass);
  
  
      /**
       * Is this servlet currently unavailable?
       */
      public boolean isUnavailable();
  
  
      // --------------------------------------------------------- Public Methods
  
  
      /**
       * Add a new servlet initialization parameter for this servlet.
       *
       * @param name Name of this initialization parameter to add
       * @param value Value of this initialization parameter to add
       */
      public void addInitParameter(String name, String value);
  
  
      /**
       * Add a new listener interested in InstanceEvents.
       *
       * @param listener The new listener
       */
      public void addInstanceListener(InstanceListener listener);
  
  
      /**
       * Add a new security role reference record to the set of records for
       * this servlet.
       *
       * @param name Role name used within this servlet
       * @param link Role name used within the web application
       * @param description Description of this security role reference
       */
      public void addSecurityReference(String name, String link);
  
  
      /**
       * Allocate an initialized instance of this Servlet that is ready to have
       * its <code>service()</code> method called.  If the servlet class does
       * not implement <code>SingleThreadModel</code>, the (only) initialized
       * instance may be returned immediately.  If the servlet class implements
       * <code>SingleThreadModel</code>, the Wrapper implementation must ensure
       * that this instance is not allocated again until it is deallocated by a
       * call to <code>deallocate()</code>.
       *
       * @exception ServletException if the servlet init() method threw
       *  an exception
       * @exception ServletException if a loading error occurs
       */
      public Servlet allocate() throws ServletException;
  
  
      /**
       * Return this previously allocated servlet to the pool of available
       * instances.  If this servlet class does not implement SingleThreadModel,
       * no action is actually required.
       *
       * @param servlet The servlet to be returned
       *
       * @exception ServletException if a deallocation error occurs
       */
      public void deallocate(Servlet servlet) throws ServletException;
  
  
      /**
       * Return the value for the specified initialization parameter name,
       * if any; otherwise return <code>null</code>.
       *
       * @param name Name of the requested initialization parameter
       */
      public String findInitParameter(String name);
  
  
      /**
       * Return the names of all defined initialization parameters for this
       * servlet.
       */
      public String[] findInitParameters();
  
  
      /**
       * Return the security role link for the specified security role
       * reference name, if any; otherwise return <code>null</code>.
       *
       * @param name Security role reference used within this servlet
       */
      public String findSecurityReference(String name);
  
  
      /**
       * Return the set of security role reference names associated with
       * this servlet, if any; otherwise return a zero-length array.
       */
      public String[] findSecurityReferences();
  
  
      /**
       * Load and initialize an instance of this servlet, if there is not already
       * at least one initialized instance.  This can be used, for example, to
       * load servlets that are marked in the deployment descriptor to be loaded
       * at server startup time.
       *
       * @exception ServletException if the servlet init() method threw
       *  an exception
       * @exception ServletException if some other loading problem occurs
       */
      public void load() throws ServletException;
  
  
      /**
       * Remove the specified initialization parameter from this servlet.
       *
       * @param name Name of the initialization parameter to remove
       */
      public void removeInitParameter(String name);
  
  
      /**
       * Remove a listener no longer interested in InstanceEvents.
       *
       * @param listener The listener to remove
       */
      public void removeInstanceListener(InstanceListener listener);
  
  
      /**
       * Remove any security role reference for the specified role name.
       *
       * @param name Security role used within this servlet to be removed
       */
      public void removeSecurityReference(String name);
  
  
      /**
       * Unload all initialized instances of this servlet, after calling the
       * <code>destroy()</code> method for each instance.  This can be used,
       * for example, prior to shutting down the entire servlet engine, or
       * prior to reloading all of the classes from the Loader associated with
       * our Loader's repository.
       *
       * @exception ServletException if an unload error occurs
       */
      public void unload() throws ServletException;
  
  
  }