tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craig...@locus.apache.org
Subject cvs commit: jakarta-tomcat-4.0/jasper build.xml
Date Sat, 30 Sep 2000 19:15:49 GMT
craigmcc    00/09/30 12:15:48

  Modified:    catalina build.xml
               catalina/src/bin catalina.bat catalina.sh
               catalina/src/conf server.xml
               catalina/src/share/org/apache/catalina Container.java
                        Context.java Server.java
               catalina/src/share/org/apache/catalina/core
                        ContainerBase.java LocalStrings.properties
                        StandardContext.java StandardServer.java
               catalina/src/share/org/apache/catalina/loader
                        StandardClassLoader.java StandardLoader.java
               catalina/src/share/org/apache/catalina/startup
                        Bootstrap.java Catalina.java
               jasper   build.xml
  Added:       catalina/src/share/org/apache/catalina Service.java
               catalina/src/share/org/apache/catalina/core
                        StandardService.java
  Log:
  Implement a new object hierarchy level in server.xml called <Service>.
  
  A Service is defined as a set of one or more Connectors that share the
  same Container (in most cases an Engine) to process their requests.  For
  example, Tomcat 4.0 running stand-alone might typically have a non-SSL
  connector running on port 8080, and an SSL connector running on port 8443.
  At the same time, a separate Service might be present with an Apache
  Connector talking to a specialized Engine imlementation that knows how to
  share configuration information back to Apache (this connector is nearing
  completion).
  
  In addition, a new classloader level for shared server extensions (i.e.
  the contents of the $CATALINA_HOME/lib directory) is now propogated down
  to the Context implementations (via setParentClassLoader) so that it
  becomes the parent classloader for all webapp classloaders.
  
  Remaining steps (later today):
  
  * Add a developer document describing the class loader architecture
    inside Tomcat 4.0.
  
  * Enforce the checking for required packages and versions as described
    in the new spec (the infrastructure is all there now, just not the
    enforcement).
  
  Revision  Changes    Path
  1.16      +1 -1      jakarta-tomcat-4.0/catalina/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/build.xml,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- build.xml	2000/09/22 13:35:38	1.15
  +++ build.xml	2000/09/30 19:15:41	1.16
  @@ -48,7 +48,7 @@
   
       <!-- Shared Extensions -->
       <!--   All applications need the servlet API classes -->
  -    <copyfile src="${servlet.jar}" dest="${catalina.build}/lib/servlet.jar"/>
  +    <copyfile src="${servlet.jar}" dest="${catalina.build}/bin/servlet.jar"/>
   
       <!-- Server Components -->
       <!--   Catalina needs Xerces XML parser -->
  
  
  
  1.9       +3 -2      jakarta-tomcat-4.0/catalina/src/bin/catalina.bat
  
  Index: catalina.bat
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/bin/catalina.bat,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- catalina.bat	2000/09/16 23:56:25	1.8
  +++ catalina.bat	2000/09/30 19:15:42	1.9
  @@ -12,7 +12,7 @@
   rem
   rem   JAVA_HOME     Must point at your Java Development Kit installation.
   rem
  -rem $Id: catalina.bat,v 1.8 2000/09/16 23:56:25 stefano Exp $
  +rem $Id: catalina.bat,v 1.9 2000/09/30 19:15:42 craigmcc Exp $
   rem ---------------------------------------------------------------------------
   
   
  @@ -52,7 +52,8 @@
   
   rem ----- Set Up The Runtime Classpath ----------------------------------------
   
  -set CP=%CATALINA_HOME%\bin\bootstrap.jar
  +set CP=%CATALINA_HOME%\bin\bootstrap.jar;%CATALINA_HOME%\bin\servlet.jar
  +goto installClasspath
   rem Try to determine if CATALINA_HOME contains spaces
   if exist %CATALINA_HOME%\server\catalina.jar goto dynClasspath
   echo Your CATALINA_HOME appears to contain spaces.
  
  
  
  1.5       +5 -5      jakarta-tomcat-4.0/catalina/src/bin/catalina.sh
  
  Index: catalina.sh
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/bin/catalina.sh,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- catalina.sh	2000/09/13 01:54:19	1.4
  +++ catalina.sh	2000/09/30 19:15:42	1.5
  @@ -12,7 +12,7 @@
   #
   #   JAVA_HOME     Must point at your Java Development Kit installation.
   #
  -# $Id: catalina.sh,v 1.4 2000/09/13 01:54:19 craigmcc Exp $
  +# $Id: catalina.sh,v 1.5 2000/09/30 19:15:42 craigmcc Exp $
   # -----------------------------------------------------------------------------
   
   
  @@ -33,11 +33,11 @@
   
   # ----- Set Up The System Classpath -------------------------------------------
   
  -CP=$CATALINA_HOME/bin/bootstrap.jar
  +CP=$CATALINA_HOME/bin/bootstrap.jar:$CATALINA_HOME/bin/servlet.jar
   
  -for i in $CATALINA_HOME/lib/*.jar ; do
  -  CP=$CP:$i
  -done
  +#for i in $CATALINA_HOME/lib/*.jar ; do
  +#  CP=$CP:$i
  +#done
   
   if [ -f $JAVA_HOME/lib/tools.jar ] ; then
     CP=$CP:$JAVA_HOME/lib/tools.jar
  
  
  
  1.8       +137 -112  jakarta-tomcat-4.0/catalina/src/conf/server.xml
  
  Index: server.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/conf/server.xml,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- server.xml	2000/09/24 02:52:57	1.7
  +++ server.xml	2000/09/30 19:15:42	1.8
  @@ -2,125 +2,150 @@
   <!-- Note that component elements are nested corresponding to their
        parent-child relationships with each other -->
   
  +<!-- A "Server" is a singleton element that represents the entire JVM,
  +     which may contain one or more "Service" instances.  The Server
  +     listens for a shutdown command on the indicated port. -->
  +
   <Server port="8005" shutdown="SHUTDOWN" debug="0">
  +
   
  -  <!-- Define all the connectors to associate with the following container -->
  +  <!-- A "Service" is a collection of one or more "Connectors" that share
  +       a single "Container" (and therefore the web applications visible
  +       within that Container).  Normally, that Container is an "Engine",
  +       but this is not required. -->
  +
  +  <!-- Define the Tomcat Stand-Alone Service -->
  +  <Service>
  +
  +    <!-- A "Connector" represents an endpoint by which requests are received
  +         and responses are returned.  Each Connector passes requests on to the
  +         associated "Container" (normally an Engine) for processing.
  +
  +         By default, a non-SSL HTTP/1.1 Connector is established on port 8080.
  +         You can also enable an SSL HTTP/1.1 Connector on port 8443 by
  +         following the instructions below and uncommenting the second Connector
  +         entry.  SSL support requires the following steps:
  +         * Download and install JSSE 1.0.2 or later, and put the JAR files
  +           into "$JAVA_HOME/jre/lib/ext".
  +         * Edit "$JAVA_HOME/jre/lib/security/java.security" and add
  +             security.provider.2=com.sun.net.ssl.internal.ssl.Provider
  +         * Execute: keytool -genkey -alias tomcat -keyalg RSA
  +           with a password value of "changeit".
  +
  +    -->
  +
  +    <!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
  +    <Connector className="org.apache.catalina.connector.http.HttpConnector"
  +               port="8080" minProcessors="5" maxProcessors="75"
  +               acceptCount="10" debug="0"/>
  +
  +    <!-- Define an SSL HTTP/1.1 Connector on port 8443 -->
  +    <!--
  +    <Connector className="org.apache.catalina.connector.http.HttpConnector"
  +               port="8443" minProcessors="5" maxProcessors="75"
  +	       acceptCount="10" debug="0" scheme="https" secure="true">
  +      <Factory className="org.apache.catalina.net.SSLServerSocketFactory"
  +               clientAuth="false" protocol="TLS"/>
  +    </Connector>
  +    -->
  +
  +    <!-- Define a non-SSL HTTP/1.0 Test Connector on port 8081 -->
  +    <!--
  +    <Connector className="org.apache.catalina.connector.test.HttpConnector"
  +               port="8081" minProcessors="5" maxProcessors="75"
  +               acceptCount="10" debug="0"/>
  +    -->
  +
  +    <!-- An Engine represents the entry point (within Catalina) that processes
  +         every request.  The Engine implementation for Tomcat stand alone
  +         analyzes the HTTP headers included with the request, and passes them
  +         on to the appropriate Host (virtual host). -->
   
  -  <Connector className="org.apache.catalina.connector.http.HttpConnector"
  -             port="8080" minProcessors="5" maxProcessors="75"
  -             acceptCount="10" debug="0"/>
  -
  -  <!--
  -            Uncomment this for SSL support. 
  -            You _need_ to set up a server certificate if you want this
  -            to work, and you need JSSE.
  -            1. Add JSSE jars as system extensions by placing them in
  -               "$JAVA_HOME/jre/lib/ext".
  -            2. Edit "$JAVA_HOME/jre/lib/security/java.security" and add
  -
  -               security.provider.2=com.sun.net.ssl.internal.ssl.Provider
  -
  -               in the appropriate place in this file.
  -            3. Do: keytool -genkey -alias tomcat -keyalg RSA
  -               RSA is essential to work with Netscape and IIS.
  -               Use "changeit" as password, or include a "keystorePass"
  -               attribute in the <Factory> element.  See class
  -               org.apache.catalina.net.SSLServerSocketFactory Javadocs
  -               for other options you can set here.
  -               You don't need to sign the certificate.
  -            4. Adjust the port number and other parameters as needed.
  -               On Unix, you will not be able to listen on port 443 unless
  -               you run as root.  
  -  -->
  -  <!--
  -  <Connector className="org.apache.catalina.connector.http.HttpConnector"
  -             port="8443" minProcessors="5" maxProcessors="75"
  -	     acceptCount="10" debug="0" scheme="https" secure="true">
  -    <Factory className="org.apache.catalina.net.SSLServerSocketFactory"
  -             clientAuth="false" protocol="TLS"/>
  -  </Connector>
  -  -->
  -
  -  <!--
  -  <Connector className="org.apache.catalina.connector.test.HttpConnector"
  -             port="8080" minProcessors="5" maxProcessors="75"
  -             acceptCount="10" debug="0"/>
  -  -->
  -
  -
  -  <!-- Define the top level container in our container hierarchy -->
  -
  -  <Engine name="engine" defaultHost="localhost" debug="0">
  -
  -    <!-- Global logger unless overridden at lower levels -->
  -    <Logger className="org.apache.catalina.logger.FileLogger"
  -            prefix="catalina_log." suffix=".txt"
  -	    timestamp="true"/>
  -
  -    <!-- Because this Realm is here, an instance will be shared globally -->
  -    <Realm className="org.apache.catalina.realm.MemoryRealm" />
  -
  -
  -     <!-- UnComment one of the following and comment out the above to get
  -          a JDBC realm -->
  - <!--
  -     <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
  -      driverName="org.gjt.mm.mysql.Driver"
  -      connectionURL="jdbc:mysql://localhost/authority?user=test;password=test"
  -      userTable="users" userNameCol="user_name" userCredCol="user_pass"
  -      userRoleTable="user_roles" roleNameCol="role_name" />
  -
  -     <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
  -      driverName="oracle.jdbc.driver.OracleDriver"
  -      connectionURL="jdbc:oracle:thin:@ntserver:1521:ORCL?user=scott;password=tiger"
  -      userTable="users" userNameCol="user_name" userCredCol="user_pass"
  -      userRoleTable="user_roles" roleNameCol="role_name" />
  -
  -     <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
  -      driverName="sun.jdbc.odbc.JdbcOdbcDriver"
  -      connectionURL="jdbc:odbc:CATALINA"
  -      userTable="users" userNameCol="user_name" userCredCol="user_pass"
  -      userRoleTable="user_roles" roleNameCol="role_name" />
  --->
  -
  -    <Host name="localhost" debug="0" appBase="webapps">
  -
  -      <!-- Access log processes all requests for this virtual host -->
  -      <Valve className="org.apache.catalina.valves.AccessLogValve"
  -             prefix="localhost_access_log." suffix=".txt"
  -             pattern="common"/>
  +    <!-- Define the top level container in our container hierarchy -->
  +    <Engine name="engine" defaultHost="localhost" debug="0">
   
  -      <!-- Logger shared by all Contexts related to this virtual host -->
  +      <!-- Global logger unless overridden at lower levels -->
         <Logger className="org.apache.catalina.logger.FileLogger"
  -              prefix="localhost_log." suffix=".txt"
  -	      timestamp="true"/>
  +              prefix="catalina_log." suffix=".txt"
  +              timestamp="true"/>
  +
  +      <!-- Because this Realm is here, an instance will be shared globally -->
  +
  +      <Realm className="org.apache.catalina.realm.MemoryRealm" />
  +
  +      <!-- Replace the above Realm with one of the following to get a Realm
  +           stored in a database and accessed via JDBC -->
  +
  +      <!--
  +      <Realm  className="org.apache.catalina.realm.JDBCRealm" debug="99"
  +             driverName="org.gjt.mm.mysql.Driver"
  +          connectionURL="jdbc:mysql://localhost/authority?user=test;password=test"
  +              userTable="users" userNameCol="user_name" userCredCol="user_pass"
  +          userRoleTable="user_roles" roleNameCol="role_name" />
  +      -->
  +
  +      <!--
  +      <Realm  className="org.apache.catalina.realm.JDBCRealm" debug="99"
  +             driverName="oracle.jdbc.driver.OracleDriver"
  +          connectionURL="jdbc:oracle:thin:@ntserver:1521:ORCL?user=scott;password=tiger"
  +              userTable="users" userNameCol="user_name" userCredCol="user_pass"
  +          userRoleTable="user_roles" roleNameCol="role_name" />
  +      -->
  +
  +      <!--
  +      <Realm  className="org.apache.catalina.realm.JDBCRealm" debug="99"
  +             driverName="sun.jdbc.odbc.JdbcOdbcDriver"
  +          connectionURL="jdbc:odbc:CATALINA"
  +              userTable="users" userNameCol="user_name" userCredCol="user_pass"
  +          userRoleTable="user_roles" roleNameCol="role_name" />
  +      -->
  +
  +      <!-- Define the default virtual host -->
  +      <Host name="localhost" debug="0" appBase="webapps">
  +
  +        <!-- Access log processes all requests for this virtual host -->
  +        <Valve className="org.apache.catalina.valves.AccessLogValve"
  +                  prefix="localhost_access_log." suffix=".txt"
  +                 pattern="common"/>
  +
  +        <!-- Logger shared by all Contexts related to this virtual host -->
  +        <Logger className="org.apache.catalina.logger.FileLogger"
  +                   prefix="localhost_log." suffix=".txt"
  +	        timestamp="true"/>
  +
  +        <!-- Define properties for each web application.  This is only needed
  +             if you want to set non-default properties, or have web application
  +             document roots in places other than the virtual host's appBase
  +             directory.  -->
  +
  +        <!-- Tomcat Root Context -->
  +        <!--
  +          <Context path="" docBase="ROOT" debug="0"/>
  +        -->
  +
  +        <!-- Tomcat Examples Context -->
  +        <!--
  +        <Context path="/examples" docBase="examples" debug="0"
  +                 reloadable="true">
  +          <Logger className="org.apache.catalina.logger.FileLogger"
  +                     prefix="localhost_examples_log." suffix=".txt"
  +        	  timestamp="true"/>
  +          <Ejb   name="ejb/EmplRecord" type="Entity"
  +                 home="com.wombat.empl.EmployeeRecordHome"
  +               remote="com.wombat.empl.EmployeeRecord"/>
  +          <Environment name="maxExemptions" type="java.lang.Integer"
  +                      value="15"/>
  +          <Parameter name="context.param.name" value="context.param.value"
  +                     override="false"/>
  +          <Resource name="jdbc/EmployeeAppDb" auth="SERVLET"
  +                    type="javax.sql.DataSource"/>
  +        </Context>
  +        -->
   
  -      <!-- Tomcat Root Context -->
  -<!--
  -      <Context path="" docBase="ROOT" debug="0"/>
  --->
  -
  -      <!-- Tomcat Examples Context -->
  -<!--
  -      <Context path="/examples" docBase="examples" debug="0"
  -               reloadable="true">
  -	<Logger className="org.apache.catalina.logger.FileLogger"
  -	        prefix="localhost_examples_log." suffix=".txt"
  -		timestamp="true"/>
  -        <Ejb   name="ejb/EmplRecord" type="Entity"
  -               home="com.wombat.empl.EmployeeRecordHome"
  -             remote="com.wombat.empl.EmployeeRecord"/>
  -        <Environment name="maxExemptions" type="java.lang.Integer"
  -                     value="15"/>
  -        <Parameter name="context.param.name" value="context.param.value"
  -                   override="false"/>
  -        <Resource name="jdbc/EmployeeAppDb" auth="SERVLET"
  -                  type="javax.sql.DataSource"/>
  -      </Context>
  --->
  +      </Host>
   
  -    </Host>
  +    </Engine>
   
  -  </Engine>
  +  </Service>
   
   </Server>
  
  
  
  1.2       +21 -4     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Container.java
  
  Index: Container.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Container.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Container.java	2000/08/11 05:24:03	1.1
  +++ Container.java	2000/09/30 19:15:42	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $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 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Container.java,v 1.2 2000/09/30 19:15:42 craigmcc Exp $
  + * $Revision: 1.2 $
  + * $Date: 2000/09/30 19:15:42 $
    *
    * ====================================================================
    *
  @@ -119,7 +119,7 @@
    * </ul>
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.1 $ $Date: 2000/08/11 05:24:03 $
  + * @version $Revision: 1.2 $ $Date: 2000/09/30 19:15:42 $
    */
   
   public interface Container {
  @@ -270,6 +270,23 @@
        *  attached to the specified Container
        */
       public void setParent(Container container);
  +
  +
  +    /**
  +     * Return the parent class loader (if any) for web applications.
  +     */
  +    public ClassLoader getParentClassLoader();
  +
  +
  +    /**
  +     * Set the parent class loader (if any) for web applications.
  +     * This call is meaningful only <strong>before</strong> a Loader has
  +     * been configured, and the specified value (if non-null) should be
  +     * passed as an argument to the class loader constructor.
  +     *
  +     * @param parent The new parent class loader
  +     */
  +    public void setParentClassLoader(ClassLoader parent);
   
   
       /**
  
  
  
  1.8       +4 -24     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Context.java
  
  Index: Context.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Context.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Context.java	2000/09/27 02:12:59	1.7
  +++ Context.java	2000/09/30 19:15:43	1.8
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Context.java,v 1.7 2000/09/27 02:12:59 craigmcc Exp $
  - * $Revision: 1.7 $
  - * $Date: 2000/09/27 02:12:59 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Context.java,v 1.8 2000/09/30 19:15:43 craigmcc Exp $
  + * $Revision: 1.8 $
  + * $Date: 2000/09/30 19:15:43 $
    *
    * ====================================================================
    *
  @@ -95,7 +95,7 @@
    * <p>
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.7 $ $Date: 2000/09/27 02:12:59 $
  + * @version $Revision: 1.8 $ $Date: 2000/09/30 19:15:43 $
    */
   
   public interface Context extends Container {
  @@ -209,26 +209,6 @@
        * @param config The new login configuration
        */
       public void setLoginConfig(LoginConfig config);
  -
  -
  -    /**
  -     * Return the parent class loader (if any) for this web application.
  -     * This call is meaningful only <strong>after</strong> a Loader has
  -     * been configured.
  -     */
  -    public ClassLoader getParentClassLoader();
  -
  -
  -    /**
  -     * Set the parent class loader (if any) for this web application.
  -     * This call is meaningful only <strong>before</strong> a Loader has
  -     * been configured, and the specified value (if non-null) should be
  -     * passed as an argument to the class loader constructor.
  -     *
  -     *
  -     * @param parent The new parent class loader
  -     */
  -    public void setParentClassLoader(ClassLoader parent);
   
   
       /**
  
  
  
  1.2       +24 -24    jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Server.java
  
  Index: Server.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Server.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Server.java	2000/08/11 05:24:11	1.1
  +++ Server.java	2000/09/30 19:15:43	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $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 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Server.java,v 1.2 2000/09/30 19:15:43 craigmcc Exp $
  + * $Revision: 1.2 $
  + * $Date: 2000/09/30 19:15:43 $
    *
    * ====================================================================
    *
  @@ -87,7 +87,7 @@
    * 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 $
  + * @version $Revision: 1.2 $ $Date: 2000/09/30 19:15:43 $
    */
   
   public interface Server {
  @@ -97,6 +97,14 @@
   
   
       /**
  +     * 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();
  +
  +
  +    /**
        * Return the port number we listen to for shutdown commands.
        */
       public int getPort();
  @@ -128,40 +136,32 @@
   
   
       /**
  -     * 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.
  +     * Add a new Service to the set of defined Services.
        *
  -     * @param connector The connector to be added
  +     * @param service The Service to be added
        */
  -    public void addConnector(Connector connector);
  +    public void addService(Service service);
   
   
       /**
  -     * 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)
  +     * Wait until a proper shutdown command is received, then return.
        */
  -    public void addContainer(Container container);
  +    public void await();
   
   
       /**
  -     * Wait until a proper shutdown command is received, then return.
  +     * Return the set of Services defined within this Server.
        */
  -    public void await();
  +    public Service[] findServices();
   
   
       /**
  -     * Return descriptive information about this Server implementation and
  -     * the corresponding version number, in the format
  -     * <code>&lt;description&gt;/&lt;version&gt;</code>.
  +     * Remove the specified Service from the set associated from this
  +     * Server.
  +     *
  +     * @param service The Service to be removed
        */
  -    public String getInfo();
  +    public void removeService(Service service);
   
   
   }
  
  
  
  1.1                  jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Service.java
  
  Index: Service.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Service.java,v 1.1 2000/09/30 19:15:43 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/09/30 19:15:43 $
   *
   * ====================================================================
   *
   * 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 <strong>Service</strong> is a group of one or more
   * <strong>Connectors</strong> that share a single <strong>Container</strong>
   * to process their incoming requests.  This arrangement allows, for example,
   * a non-SSL and SSL connector to share the same population of web apps.
   * <p>
   * A given JVM can contain any number of Service instances; however, they are
   * completely independent of each other and share only the basic JVM facilities
   * and classes on the system class path.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/09/30 19:15:43 $
   */
  
  public interface Service {
  
  
      // ------------------------------------------------------------- Properties
  
  
      /**
       * Return the <code>Container</code> that handles requests for all
       * <code>Connectors</code> associated with this Service.
       */
      public Container getContainer();
  
  
      /**
       * Set the <code>Container</code> that handles requests for all
       * <code>Connectors</code> associated with this Service.
       *
       * @param container The new Container
       */
      public void setContainer(Container container);
  
  
      /**
       * Return descriptive information about this Service implementation and
       * the corresponding version number, in the format
       * <code>&lt;description&gt;/&lt;version&gt;</code>.
       */
      public String getInfo();
  
  
      // --------------------------------------------------------- Public Methods
  
  
      /**
       * Add a new Connector to the set of defined Connectors, and associate it
       * with this Service's Container.
       *
       * @param connector The Connector to be added
       */
      public void addConnector(Connector connector);
  
  
      /**
       * Find and return the set of Connectors associated with this Service.
       */
      public Connector[] findConnectors();
  
  
      /**
       * Remove the specified Connector from the set associated from this
       * Service.  The removed Connector will also be disassociated from our
       * Container.
       *
       * @param connector The Connector to be removed
       */
      public void removeConnector(Connector connector);
  
  
  }
  
  
  
  1.4       +45 -4     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ContainerBase.java
  
  Index: ContainerBase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ContainerBase.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ContainerBase.java	2000/09/09 03:20:50	1.3
  +++ ContainerBase.java	2000/09/30 19:15:45	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ContainerBase.java,v 1.3 2000/09/09 03:20:50 craigmcc Exp $
  - * $Revision: 1.3 $
  - * $Date: 2000/09/09 03:20:50 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ContainerBase.java,v 1.4 2000/09/30 19:15:45 craigmcc Exp $
  + * $Revision: 1.4 $
  + * $Date: 2000/09/30 19:15:45 $
    *
    * ====================================================================
    *
  @@ -150,7 +150,7 @@
    * class comments of the implementation class.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.3 $ $Date: 2000/09/09 03:20:50 $
  + * @version $Revision: 1.4 $ $Date: 2000/09/30 19:15:45 $
    */
   
   public abstract class ContainerBase
  @@ -245,6 +245,12 @@
   
   
       /**
  +     * The parent class loader to be configured when we install a Loader.
  +     */
  +    private ClassLoader parentClassLoader = null;
  +
  +
  +    /**
        * The Realm with which this Container is associated.
        */
       protected Realm realm = null;
  @@ -622,6 +628,41 @@
   	Container oldParent = this.parent;
   	this.parent = container;
   	support.firePropertyChange("parent", oldParent, this.parent);
  +
  +    }
  +
  +
  +    /**
  +     * Return the parent class loader (if any) for this web application.
  +     * This call is meaningful only <strong>after</strong> a Loader has
  +     * been configured.
  +     */
  +    public ClassLoader getParentClassLoader() {
  +
  +        if (parentClassLoader != null)
  +            return (parentClassLoader);
  +        if (parent != null)
  +            return (parent.getParentClassLoader());
  +        return (ClassLoader.getSystemClassLoader());
  +
  +    }
  +
  +
  +    /**
  +     * Set the parent class loader (if any) for this web application.
  +     * This call is meaningful only <strong>before</strong> a Loader has
  +     * been configured, and the specified value (if non-null) should be
  +     * passed as an argument to the class loader constructor.
  +     *
  +     *
  +     * @param parent The new parent class loader
  +     */
  +    public void setParentClassLoader(ClassLoader parent) {
  +
  +        ClassLoader oldParentClassLoader = this.parentClassLoader;
  +        this.parentClassLoader = parent;
  +        support.firePropertyChange("parentClassLoader", oldParentClassLoader,
  +                                   this.parentClassLoader);
   
       }
   
  
  
  
  1.9       +2 -0      jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/LocalStrings.properties
  
  Index: LocalStrings.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/LocalStrings.properties,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- LocalStrings.properties	2000/09/20 17:11:09	1.8
  +++ LocalStrings.properties	2000/09/30 19:15:45	1.9
  @@ -60,6 +60,8 @@
   standardServer.start.connectors=At least one connector is not associated with any container
   standardServer.start.started=This server has already been started
   standardServer.stop.notStarted=This server has not yet been started
  +standardService.start.started=This service has already been started
  +standardService.stop.notStarted=This service has not yet been started
   standardWrapper.allocate=Error allocating a servlet instance
   standardWrapper.allocateException=Allocate exception for servlet {0}
   standardWrapper.containerServlet=Loading container servlet {0}
  
  
  
  1.16      +4 -38     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java
  
  Index: StandardContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- StandardContext.java	2000/09/27 02:13:01	1.15
  +++ StandardContext.java	2000/09/30 19:15:45	1.16
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java,v 1.15 2000/09/27 02:13:01 craigmcc Exp $
  - * $Revision: 1.15 $
  - * $Date: 2000/09/27 02:13:01 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java,v 1.16 2000/09/30 19:15:45 craigmcc Exp $
  + * $Revision: 1.16 $
  + * $Date: 2000/09/30 19:15:45 $
    *
    * ====================================================================
    *
  @@ -106,7 +106,7 @@
    * requests directed to a particular servlet.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.15 $ $Date: 2000/09/27 02:13:01 $
  + * @version $Revision: 1.16 $ $Date: 2000/09/30 19:15:45 $
    */
   
   public final class StandardContext
  @@ -276,12 +276,6 @@
   
   
       /**
  -     * The parent class loader to be configured when we install a Loader.
  -     */
  -    private ClassLoader parentClassLoader = null;
  -
  -
  -    /**
        * The request processing pause flag (while reloading occurs)
        */
       private boolean paused = false;
  @@ -588,34 +582,6 @@
   	this.loginConfig = config;
   	support.firePropertyChange("loginConfig",
   				   oldLoginConfig, this.loginConfig);
  -
  -    }
  -
  -
  -    /**
  -     * Return the parent class loader (if any) for this web application.
  -     * This call is meaningful only <strong>after</strong> a Loader has
  -     * been configured.
  -     */
  -    public ClassLoader getParentClassLoader() {
  -
  -        return (this.parentClassLoader);
  -
  -    }
  -
  -
  -    /**
  -     * Set the parent class loader (if any) for this web application.
  -     * This call is meaningful only <strong>before</strong> a Loader has
  -     * been configured, and the specified value (if non-null) should be
  -     * passed as an argument to the class loader constructor.
  -     *
  -     *
  -     * @param parent The new parent class loader
  -     */
  -    public void setParentClassLoader(ClassLoader parent) {
  -
  -        this.parentClassLoader = parent;
   
       }
   
  
  
  
  1.2       +88 -89    jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardServer.java
  
  Index: StandardServer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardServer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- StandardServer.java	2000/08/11 23:40:45	1.1
  +++ StandardServer.java	2000/09/30 19:15:45	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardServer.java,v 1.1 2000/08/11 23:40:45 craigmcc Exp $
  - * $Revision: 1.1 $
  - * $Date: 2000/08/11 23:40:45 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardServer.java,v 1.2 2000/09/30 19:15:45 craigmcc Exp $
  + * $Revision: 1.2 $
  + * $Date: 2000/09/30 19:15:45 $
    *
    * ====================================================================
    *
  @@ -70,13 +70,12 @@
   import java.net.InetAddress;
   import java.net.ServerSocket;
   import java.net.Socket;
  -import org.apache.catalina.Connector;
  -import org.apache.catalina.Container;
   import org.apache.catalina.Lifecycle;
   import org.apache.catalina.LifecycleEvent;
   import org.apache.catalina.LifecycleException;
   import org.apache.catalina.LifecycleListener;
   import org.apache.catalina.Server;
  +import org.apache.catalina.Service;
   import org.apache.catalina.util.LifecycleSupport;
   import org.apache.catalina.util.StringManager;
   
  @@ -87,7 +86,7 @@
    * (but not required) when deploying and starting Catalina.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.1 $ $Date: 2000/08/11 23:40:45 $
  + * @version $Revision: 1.2 $ $Date: 2000/09/30 19:15:45 $
    */
   
   public final class StandardServer
  @@ -98,18 +97,6 @@
   
   
       /**
  -     * The set of Connectors associated with this Server.
  -     */
  -    private Connector connectors[] = new Connector[0];
  -
  -
  -    /**
  -     * The set of Containers associated with this Server.
  -     */
  -    private Container containers[] = new Container[0];
  -
  -
  -    /**
        * Descriptive information about this Server implementation.
        */
       private static final String info =
  @@ -129,6 +116,12 @@
   
   
       /**
  +     * The set of Services associated with this Server.
  +     */
  +    private Service services[] = new Service[0];
  +
  +
  +    /**
        * The shutdown command string we are looking for.
        */
       private String shutdown = "SHUTDOWN";
  @@ -151,6 +144,18 @@
   
   
       /**
  +     * 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() {
  +
  +	return (info);
  +
  +    }
  +
  +
  +    /**
        * Return the port number we listen to for shutdown commands.
        */
       public int getPort() {
  @@ -198,53 +203,26 @@
   
   
       /**
  -     * 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.
  +     * Add a new Service to the set of defined Services.
        *
  -     * @param connector The connector to be added
  +     * @param service The Service to be added
        */
  -    public void addConnector(Connector connector) {
  +    public void addService(Service service) {
   
  -	connector.setContainer(null);
  -	synchronized (connectors) {
  -	    Connector results[] = new Connector[connectors.length + 1];
  -	    for (int i = 0; i < connectors.length; i++)
  -		results[i] = connectors[i];
  -	    results[connectors.length] = connector;
  -	    connectors = results;
  -	}
  -	    
  -    }
  -
  +	synchronized (services) {
  +	    Service results[] = new Service[services.length + 1];
  +            System.arraycopy(services, 0, results, 0, services.length);
  +            results[services.length] = service;
  +            services = results;
  +            if (started && (service instanceof Lifecycle)) {
  +                try {
  +                    ((Lifecycle) service).start();
  +                } catch (LifecycleException e) {
  +                    ;
  +                }
  +            }
  +        }
   
  -    /**
  -     * 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) {
  -
  -	synchronized (containers) {
  -	    Container results[] = new Container[containers.length + 1];
  -	    for (int i = 0; i < containers.length; i++)
  -		results[i] = containers[i];
  -	    results[containers.length] = container;
  -	    containers = results;
  -	}
  -
  -	synchronized (connectors) {
  -	    for (int i = 0; i < connectors.length; i++) {
  -		if (connectors[i].getContainer() == null)
  -		    connectors[i].setContainer(container);
  -	    }
  -	}
  -
       }
   
   
  @@ -336,17 +314,52 @@
   
   
       /**
  -     * Return descriptive information about this Server implementation and
  -     * the corresponding version number, in the format
  -     * <code>&lt;description&gt;/&lt;version&gt;</code>.
  +     * Return the set of Services defined within this Server.
        */
  -    public String getInfo() {
  +    public Service[] findServices() {
   
  -	return (info);
  +        return (services);
   
       }
   
   
  +    /**
  +     * Remove the specified Service from the set associated from this
  +     * Server.
  +     *
  +     * @param service The Service to be removed
  +     */
  +    public void removeService(Service service) {
  +
  +        synchronized (services) {
  +            int j = -1;
  +            for (int i = 0; i < services.length; i++) {
  +                if (service == services[i]) {
  +                    j = i;
  +                    break;
  +                }
  +            }
  +            if (j < 0)
  +                return;
  +            if (services[j] instanceof Lifecycle) {
  +                try {
  +                    ((Lifecycle) services[j]).stop();
  +                } catch (LifecycleException e) {
  +                    ;
  +                }
  +            }
  +            int k = 0;
  +            Service results[] = new Service[services.length - 1];
  +            for (int i = 0; i < services.length; i++) {
  +                if (i != j)
  +                    results[k++] = services[i];
  +            }
  +            services = results;
  +        }
  +
  +    }
  +
  +
       // -------------------------------------------------------- Private Methods
   
   
  @@ -433,20 +446,12 @@
   
   	lifecycle.fireLifecycleEvent(START_EVENT, null);
   	started = true;
  -
  -	// Start our defined Containers first
  -	synchronized (containers) {
  -	    for (int i = 0; i < containers.length; i++) {
  -		if (containers[i] instanceof Lifecycle)
  -		    ((Lifecycle) containers[i]).start();
  -	    }
  -	}
   
  -	// Start our defined Connectors second
  -	synchronized (connectors) {
  -	    for (int i = 0; i < connectors.length; i++) {
  -		if (connectors[i] instanceof Lifecycle)
  -		    ((Lifecycle) connectors[i]).start();
  +	// Start our defined Services
  +	synchronized (services) {
  +	    for (int i = 0; i < services.length; i++) {
  +		if (services[i] instanceof Lifecycle)
  +		    ((Lifecycle) services[i]).start();
   	    }
   	}
   
  @@ -471,17 +476,11 @@
   		(sm.getString("standardServer.stop.notStarted"));
   	lifecycle.fireLifecycleEvent(STOP_EVENT, null);
   	started = false;
  -
  -	// Stop our defined Connectors first
  -	for (int i = 0; i < connectors.length; i++) {
  -	    if (connectors[i] instanceof Lifecycle)
  -		((Lifecycle) connectors[i]).stop();
  -	}
   
  -	// Stop our defined Containers second
  -	for (int i = 0; i < containers.length; i++) {
  -	    if (containers[i] instanceof Lifecycle)
  -		((Lifecycle) containers[i]).stop();
  +	// Stop our defined Services
  +	for (int i = 0; i < services.length; i++) {
  +	    if (services[i] instanceof Lifecycle)
  +		((Lifecycle) services[i]).stop();
   	}
   
       }
  
  
  
  1.1                  jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardService.java
  
  Index: StandardService.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardService.java,v 1.1 2000/09/30 19:15:45 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/09/30 19:15:45 $
   *
   * ====================================================================
   *
   * 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.core;
  
  
  import org.apache.catalina.Connector;
  import org.apache.catalina.Container;
  import org.apache.catalina.Lifecycle;
  import org.apache.catalina.LifecycleEvent;
  import org.apache.catalina.LifecycleException;
  import org.apache.catalina.LifecycleListener;
  import org.apache.catalina.Server;
  import org.apache.catalina.Service;
  import org.apache.catalina.util.LifecycleSupport;
  import org.apache.catalina.util.StringManager;
  
  
  /**
   * Standard implementation of the <code>Service</code> interface.  The
   * associated Container is generally an instance of Engine, but this is
   * not required.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/09/30 19:15:45 $
   */
  
  public final class StandardService
      implements Lifecycle, Service {
  
  
      // ----------------------------------------------------- Instance Variables
  
  
      /**
       * The set of Connectors associated with this Service.
       */
      private Connector connectors[] = new Connector[0];
  
  
      /**
       * The Container associated with this Service.
       */
      private Container container = null;
  
  
      /**
       * Descriptive information about this component implementation.
       */
      private static final String info =
          "org.apache.catalina.core.StandardService/1.0";
  
  
      /**
       * The lifecycle event support for this component.
       */
      private LifecycleSupport lifecycle = new LifecycleSupport(this);
  
  
      /**
       * The string manager for this package.
       */
      private static final StringManager sm =
  	StringManager.getManager(Constants.Package);
  
  
      /**
       * Has this component been started?
       */
      private boolean started = false;
  
  
      // ------------------------------------------------------------- Properties
  
  
      /**
       * Return the <code>Container</code> that handles requests for all
       * <code>Connectors</code> associated with this Service.
       */
      public Container getContainer() {
  
          return (this.container);
  
      }
  
  
      /**
       * Set the <code>Container</code> that handles requests for all
       * <code>Connectors</code> associated with this Service.
       *
       * @param container The new Container
       */
      public void setContainer(Container container) {
  
          Container oldContainer = this.container;
          this.container = container;
          if (started && (this.container != null) &&
              (this.container instanceof Lifecycle)) {
              try {
                  ((Lifecycle) this.container).start();
              } catch (LifecycleException e) {
                  ;
              }
          }
          synchronized (connectors) {
              for (int i = 0; i < connectors.length; i++)
                  connectors[i].setContainer(this.container);
          }
          if (started && (oldContainer != null) &&
              (oldContainer instanceof Lifecycle)) {
              try {
                  ((Lifecycle) oldContainer).stop();
              } catch (LifecycleException e) {
                  ;
              }
          }
  
      }
  
  
      /**
       * Return descriptive information about this Service implementation and
       * the corresponding version number, in the format
       * <code>&lt;description&gt;/&lt;version&gt;</code>.
       */
      public String getInfo() {
  
          return (this.info);
  
      }
  
  
      // --------------------------------------------------------- Public Methods
  
  
      /**
       * Add a new Connector to the set of defined Connectors, and associate it
       * with this Service's Container.
       *
       * @param connector The Connector to be added
       */
      public void addConnector(Connector connector) {
  
          synchronized (connectors) {
              connector.setContainer(this.container);
              Connector results[] = new Connector[connectors.length + 1];
              System.arraycopy(connectors, 0, results, 0, connectors.length);
              results[connectors.length] = connector;
              connectors = results;
              if (started && (connector instanceof Lifecycle)) {
                  try {
                      ((Lifecycle) connector).start();
                  } catch (LifecycleException e) {
                      ;
                  }
              }
          }
  
      }
  
  
      /**
       * Find and return the set of Connectors associated with this Service.
       */
      public Connector[] findConnectors() {
  
          return (connectors);
  
      }
  
  
      /**
       * Remove the specified Connector from the set associated from this
       * Service.  The removed Connector will also be disassociated from our
       * Container.
       *
       * @param connector The Connector to be removed
       */
      public void removeConnector(Connector connector) {
  
          synchronized (connectors) {
              int j = -1;
              for (int i = 0; i < connectors.length; i++) {
                  if (connector == connectors[i]) {
                      j = i;
                      break;
                  }
              }
              if (j < 0)
                  return;
              if (started && (connectors[j] instanceof Lifecycle)) {
                  try {
                      ((Lifecycle) connectors[j]).stop();
                  } catch (LifecycleException e) {
                      ;
                  }
              }
              connectors[j].setContainer(null);
              int k = 0;
              Connector results[] = new Connector[connectors.length - 1];
              for (int i = 0; i < connectors.length; i++) {
                  if (i != j)
                      results[k++] = connectors[i];
              }
              connectors = results;
          }
  
      }
  
  
      // ------------------------------------------------------ Lifecycle Methods
  
  
      /**
       * Add a LifecycleEvent listener to this component.
       *
       * @param listener The listener to add
       */
      public void addLifecycleListener(LifecycleListener listener) {
  
  	lifecycle.addLifecycleListener(listener);
  
      }
  
  
      /**
       * Remove a LifecycleEvent listener from this component.
       *
       * @param listener The listener to remove
       */
      public void removeLifecycleListener(LifecycleListener listener) {
  
  	lifecycle.removeLifecycleListener(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 {
  
  	// Validate and update our current component state
  	if (started)
  	    throw new LifecycleException
  		(sm.getString("standardService.start.started"));
  
  	lifecycle.fireLifecycleEvent(START_EVENT, null);
  	started = true;
  
  	// Start our defined Container first
  	synchronized (container) {
              if ((container != null) && (container instanceof Lifecycle))
                  ((Lifecycle) container).start();
  	}
  
  	// Start our defined Connectors second
  	synchronized (connectors) {
  	    for (int i = 0; i < connectors.length; i++) {
  		if (connectors[i] instanceof Lifecycle)
  		    ((Lifecycle) connectors[i]).start();
  	    }
  	}
  
      }
  
  
      /**
       * 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 {
  
  	// Validate and update our current component state
  	if (!started)
  	    throw new LifecycleException
  		(sm.getString("standardService.stop.notStarted"));
  	lifecycle.fireLifecycleEvent(STOP_EVENT, null);
  	started = false;
  
  	// Stop our defined Connectors first
          synchronized (connectors) {
              for (int i = 0; i < connectors.length; i++) {
                  if (connectors[i] instanceof Lifecycle)
                      ((Lifecycle) connectors[i]).stop();
              }
          }
  
  	// Stop our defined Container second
          synchronized (container) {
              if ((container != null) && (container instanceof Lifecycle))
                  ((Lifecycle) container).stop();
          }
  
      }
  
  
  }
  
  
  
  1.4       +59 -4     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/StandardClassLoader.java
  
  Index: StandardClassLoader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/StandardClassLoader.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- StandardClassLoader.java	2000/09/29 20:44:07	1.3
  +++ StandardClassLoader.java	2000/09/30 19:15:46	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/StandardClassLoader.java,v 1.3 2000/09/29 20:44:07 craigmcc Exp $
  - * $Revision: 1.3 $
  - * $Date: 2000/09/29 20:44:07 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/StandardClassLoader.java,v 1.4 2000/09/30 19:15:46 craigmcc Exp $
  + * $Revision: 1.4 $
  + * $Date: 2000/09/30 19:15:46 $
    *
    * ====================================================================
    *
  @@ -99,7 +99,7 @@
    * independently.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.3 $ $Date: 2000/09/29 20:44:07 $
  + * @version $Revision: 1.4 $ $Date: 2000/09/30 19:15:46 $
    */
   
   public class StandardClassLoader
  @@ -566,6 +566,61 @@
   
           // No classes have been modified
           return (false);
  +
  +    }
  +
  +
  +    /**
  +     * Render a String representation of this object.
  +     */
  +    public String toString() {
  +
  +        StringBuffer sb = new StringBuffer("StandardClassLoader\r\n");
  +        sb.append("  allowed: ");
  +        for (int i = 0; i < allowed.length; i++) {
  +            if (i > 0)
  +                sb.append(", ");
  +            sb.append(allowed[i]);
  +        }
  +        sb.append("\r\n");
  +        sb.append("  available:\r\n");
  +        Iterator available = this.available.iterator();
  +        while (available.hasNext()) {
  +            sb.append("    ");
  +            sb.append(available.next().toString());
  +            sb.append("\r\n");
  +        }
  +        sb.append("  delegate: ");
  +        sb.append(delegate);
  +        sb.append("\r\n");
  +        sb.append("  repositories:\r\n");
  +        for (int i = 0; i < repositories.length; i++) {
  +            sb.append("    ");
  +            sb.append(repositories[i]);
  +            sb.append("\r\n");
  +        }
  +        sb.append("  required:\r\n");
  +        Iterator required = this.required.iterator();
  +        while (required.hasNext()) {
  +            sb.append("    ");
  +            sb.append(required.next().toString());
  +            sb.append("\r\n");
  +        }
  +        sb.append("  restricted: ");
  +        for (int i = 0; i < restricted.length; i++) {
  +            if (i > 0)
  +                sb.append(", ");
  +            sb.append(restricted[i]);
  +        }
  +        sb.append("\r\n");
  +        sb.append("  systems: ");
  +        for (int i = 0; i < systems.length; i++) {
  +            if (i > 0)
  +                sb.append(", ");
  +            sb.append(systems[i]);
  +        }
  +        sb.append("\r\n");
  +        return (sb.toString());
   
       }
   
  
  
  
  1.7       +37 -14    jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/StandardLoader.java
  
  Index: StandardLoader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/StandardLoader.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- StandardLoader.java	2000/09/24 23:23:49	1.6
  +++ StandardLoader.java	2000/09/30 19:15:46	1.7
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/StandardLoader.java,v 1.6 2000/09/24 23:23:49 craigmcc Exp $
  - * $Revision: 1.6 $
  - * $Date: 2000/09/24 23:23:49 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/StandardLoader.java,v 1.7 2000/09/30 19:15:46 craigmcc Exp $
  + * $Revision: 1.7 $
  + * $Date: 2000/09/30 19:15:46 $
    *
    * ====================================================================
    *
  @@ -70,6 +70,8 @@
   import java.beans.PropertyChangeSupport;
   import java.io.File;
   import java.io.IOException;
  +import java.net.URL;
  +import java.net.URLClassLoader;
   import javax.servlet.ServletContext;
   import org.apache.catalina.Container;
   import org.apache.catalina.Context;
  @@ -97,7 +99,7 @@
    * is not present, the system class loader will be used instead.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.6 $ $Date: 2000/09/24 23:23:49 $
  + * @version $Revision: 1.7 $ $Date: 2000/09/30 19:15:46 $
    */
   
   public final class StandardLoader
  @@ -731,6 +733,7 @@
        */
       private void setClassPath() {
   
  +        // Validate our current state information
   	if (!(container instanceof Context))
   	    return;
   	ServletContext servletContext =
  @@ -738,17 +741,37 @@
   	if (servletContext == null)
   	    return;
   
  +        // Assemble the class path information from our class loader chain
   	StringBuffer classpath = new StringBuffer();
  -	for (int i = 0; i < repositories.length; i++) {
  -	    if (i > 0)
  -		classpath.append(File.pathSeparator);
  -            String repository = repositories[i];
  -            if (repository.startsWith("file:"))
  -                repository = repository.substring(5);
  -            if (repository.endsWith("/"))
  -                repository = repository.substring(0, repository.length() - 1);
  -            classpath.append(repository);
  -	}
  +        ClassLoader loader = getClassLoader();
  +        int layers = 0;
  +        int n = 0;
  +        while ((layers < 3) && (loader != null)) {
  +            if (!(loader instanceof URLClassLoader))
  +                break;
  +            URL repositories[] =
  +                ((URLClassLoader) loader).getURLs();
  +            for (int i = 0; i < repositories.length; i++) {
  +                String repository = repositories[i].toString();
  +                if (repository.startsWith("file://"))
  +                    repository = repository.substring(7);
  +                else if (repository.startsWith("file:"))
  +                    repository = repository.substring(5);
  +                else
  +                    continue;
  +                if (repository.endsWith("/"))
  +                    repository =
  +                        repository.substring(0, repository.length() - 1);
  +                if (n > 0)
  +                    classpath.append(File.pathSeparator);
  +                classpath.append(repository);
  +                n++;
  +            }
  +            loader = loader.getParent();
  +            layers++;
  +        }
  +
  +        // Store the assembled class path as a servlet context attribute
   	servletContext.setAttribute(Globals.CLASS_PATH_ATTR,
   				    classpath.toString());
   
  
  
  
  1.5       +5 -5      jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Bootstrap.java
  
  Index: Bootstrap.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Bootstrap.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Bootstrap.java	2000/09/29 20:44:07	1.4
  +++ Bootstrap.java	2000/09/30 19:15:47	1.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Bootstrap.java,v 1.4 2000/09/29 20:44:07 craigmcc Exp $
  - * $Revision: 1.4 $
  - * $Date: 2000/09/29 20:44:07 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Bootstrap.java,v 1.5 2000/09/30 19:15:47 craigmcc Exp $
  + * $Revision: 1.5 $
  + * $Date: 2000/09/30 19:15:47 $
    *
    * ====================================================================
    *
  @@ -84,7 +84,7 @@
    * class path and therefore not visible to application level classes.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.4 $ $Date: 2000/09/29 20:44:07 $
  + * @version $Revision: 1.5 $ $Date: 2000/09/30 19:15:47 $
    */
   
   public final class Bootstrap {
  @@ -113,7 +113,7 @@
   	    Object startupInstance = startupClass.newInstance();
   
               // Set the shared extensions class loader
  -            String methodName = "setSharedLoader";
  +            String methodName = "setParentClassLoader";
               Class paramTypes[] = new Class[1];
               paramTypes[0] = Class.forName("java.lang.ClassLoader");
               Object paramValues[] = new Object[1];
  
  
  
  1.6       +255 -165  jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Catalina.java
  
  Index: Catalina.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Catalina.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Catalina.java	2000/09/29 20:44:07	1.5
  +++ Catalina.java	2000/09/30 19:15:47	1.6
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Catalina.java,v 1.5 2000/09/29 20:44:07 craigmcc Exp $
  - * $Revision: 1.5 $
  - * $Date: 2000/09/29 20:44:07 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Catalina.java,v 1.6 2000/09/30 19:15:47 craigmcc Exp $
  + * $Revision: 1.6 $
  + * $Date: 2000/09/30 19:15:47 $
    *
    * ====================================================================
    *
  @@ -71,6 +71,7 @@
   import java.lang.reflect.InvocationTargetException;
   import java.net.Socket;
   import java.util.Stack;
  +import org.apache.catalina.Container;
   import org.apache.catalina.Lifecycle;
   import org.apache.catalina.LifecycleException;
   import org.apache.catalina.LifecycleListener;
  @@ -94,7 +95,7 @@
    * </u>
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.5 $ $Date: 2000/09/29 20:44:07 $
  + * @version $Revision: 1.6 $ $Date: 2000/09/30 19:15:47 $
    */
   
   public class Catalina {
  @@ -116,15 +117,16 @@
   
   
       /**
  -     * The server component we are starting or stopping
  +     * The shared extensions class loader for this server.
        */
  -    protected Server server = null;
  +    protected ClassLoader parentClassLoader =
  +        ClassLoader.getSystemClassLoader();
   
   
       /**
  -     * The shared extensions class loader for this server.
  +     * The server component we are starting or stopping
        */
  -    protected ClassLoader sharedLoader = ClassLoader.getSystemClassLoader();
  +    protected Server server = null;
   
   
       /**
  @@ -175,25 +177,25 @@
   
   
       /**
  -     * Set the server instance we are configuring.
  +     * Set the shared extensions class loader.
        *
  -     * @param server The new server
  +     * @param parentClassLoader The shared extensions class loader.
        */
  -    public void setServer(Server server) {
  +    public void setParentClassLoader(ClassLoader parentClassLoader) {
   
  -        this.server = server;
  +        this.parentClassLoader = parentClassLoader;
   
       }
   
   
       /**
  -     * Set the shared extensions class loader.
  +     * Set the server instance we are configuring.
        *
  -     * @param sharedLoader The shared extensions class loader.
  +     * @param server The new server
        */
  -    public void setSharedLoader(ClassLoader sharedLoader) {
  +    public void setServer(Server server) {
   
  -        this.sharedLoader = sharedLoader;
  +        this.server = server;
   
       }
   
  @@ -270,256 +272,294 @@
           mapper.addRule("Server", mapper.addChild
   		       ("setServer", "org.apache.catalina.Server"));
   
  -	mapper.addRule("Server/Connector", mapper.objectCreate
  +        mapper.addRule("Server/Service", mapper.objectCreate
  +                    ("org.apache.catalina.core.StandardService", "className"));
  +        mapper.addRule("Server/Service", mapper.setProperties());
  +        mapper.addRule("Server/Service", mapper.addChild
  +                       ("addService", "org.apache.catalina.Service"));
  +
  +        mapper.addRule("Server/Service/Connector", mapper.objectCreate
   		       ("org.apache.catalina.connector.http.HttpConnector",
   			"className"));
  -	mapper.addRule("Server/Connector", mapper.setProperties());
  -	mapper.addRule("Server/Connector", mapper.addChild
  +	mapper.addRule("Server/Service/Connector", mapper.setProperties());
  +	mapper.addRule("Server/Service/Connector", mapper.addChild
   		       ("addConnector", "org.apache.catalina.Connector"));
   
  -        mapper.addRule("Server/Connector/Factory", mapper.objectCreate
  +        mapper.addRule("Server/Service/Connector/Factory", mapper.objectCreate
                          ("org.apache.catalina.net.DefaultServerSocketFactory",
                           "className"));
  -        mapper.addRule("Server/Connector/Factory", mapper.setProperties());
  -        mapper.addRule("Server/Connector/Factory", mapper.addChild
  +        mapper.addRule("Server/Service/Connector/Factory",
  +                       mapper.setProperties());
  +        mapper.addRule("Server/Service/Connector/Factory", mapper.addChild
                          ("setFactory",
                           "org.apache.catalina.net.ServerSocketFactory"));
   
  -	mapper.addRule("Server/Connector/Listener", mapper.objectCreate
  +	mapper.addRule("Server/Service/Connector/Listener", mapper.objectCreate
   		       (null, "className"));
  -	mapper.addRule("Server/Connector/Listener", mapper.setProperties());
  -	mapper.addRule("Server/Connector/Listener", mapper.addChild
  +	mapper.addRule("Server/Service/Connector/Listener",
  +                       mapper.setProperties());
  +	mapper.addRule("Server/Service/Connector/Listener", mapper.addChild
   		       ("addLifecycleListener",
   			"org.apache.catalina.LifecycleListener"));
   
  -	mapper.addRule("Server/Engine", mapper.objectCreate
  +	mapper.addRule("Server/Service/Engine", mapper.objectCreate
   		       ("org.apache.catalina.core.StandardEngine",
   			"className"));
  -	mapper.addRule("Server/Engine", mapper.setProperties());
  -	mapper.addRule("Server/Engine",
  +	mapper.addRule("Server/Service/Engine", mapper.setProperties());
  +	mapper.addRule("Server/Service/Engine",
   		       new LifecycleListenerAction
   			   ("org.apache.catalina.startup.EngineConfig",
   			    "configClass"));
  -	mapper.addRule("Server/Engine", mapper.addChild
  -		       ("addContainer", "org.apache.catalina.Container"));
  +        mapper.addRule("Server/Service/Engine",
  +                       new SetParentClassLoaderAction(parentClassLoader));
  +	mapper.addRule("Server/Service/Engine", mapper.addChild
  +		       ("setContainer", "org.apache.catalina.Container"));
   
  -	mapper.addRule("Server/Engine/Host", mapper.objectCreate
  +        createStartMapperContext("Server/Service/Engine/Context", mapper);
  +
  +	mapper.addRule("Server/Service/Engine/Host", mapper.objectCreate
   		       ("org.apache.catalina.core.StandardHost",
   			"className"));
  -	mapper.addRule("Server/Engine/Host", mapper.setProperties());
  -	mapper.addRule("Server/Engine/Host",
  +	mapper.addRule("Server/Service/Engine/Host", mapper.setProperties());
  +	mapper.addRule("Server/Service/Engine/Host",
   		       new LifecycleListenerAction
   			   ("org.apache.catalina.startup.HostConfig",
  -			    "configClass"));
  -	mapper.addRule("Server/Engine/Host", mapper.addChild
  -		       ("addChild", "org.apache.catalina.Container"));
  -
  -	mapper.addRule("Server/Engine/Host/Context", mapper.objectCreate
  -		       ("org.apache.catalina.core.StandardContext",
  -			"className"));
  -	mapper.addRule("Server/Engine/Host/Context", mapper.setProperties());
  -	mapper.addRule("Server/Engine/Host/Context",
  -		       new LifecycleListenerAction
  -			   ("org.apache.catalina.startup.ContextConfig",
   			    "configClass"));
  -	mapper.addRule("Server/Engine/Host/Context", mapper.addChild
  +	mapper.addRule("Server/Service/Engine/Host", mapper.addChild
   		       ("addChild", "org.apache.catalina.Container"));
   
  -        mapper.addRule("Server/Engine/Host/Context/Ejb", mapper.objectCreate
  -                       ("org.apache.catalina.deploy.ContextEjb"));
  -        mapper.addRule("Server/Engine/Host/Context/Ejb",
  -                       mapper.setProperties());
  -        mapper.addRule("Server/Engine/Host/Context/Ejb", mapper.addChild
  -                       ("addEjb", "org.apache.catalina.deploy.ContextEjb"));
  +        createStartMapperContext("Server/Service/Engine/Host/Context", mapper);
   
  -        mapper.addRule("Server/Engine/Host/Context/Environment",
  +	mapper.addRule("Server/Service/Engine/Host/Listener",
                          mapper.objectCreate
  -                       ("org.apache.catalina.deploy.ContextEnvironment"));
  -        mapper.addRule("Server/Engine/Host/Context/Environment",
  -                       mapper.setProperties());
  -        mapper.addRule("Server/Engine/Host/Context/Environment",
  -                       mapper.addChild
  -                       ("addEnvironment",
  -                        "org.apache.catalina.deploy.ContextEnvironment"));
  -
  -	mapper.addRule("Server/Engine/Host/Context/InstanceListener",
  -		       mapper.methodSetter("addInstanceListener", 0));
  -
  -	mapper.addRule("Server/Engine/Host/Context/Listener",
  -		       mapper.objectCreate
   		       (null, "className"));
  -	mapper.addRule("Server/Engine/Host/Context/Listener",
  -		       mapper.setProperties());
  -	mapper.addRule("Server/Engine/Host/Context/Listener", mapper.addChild
  +	mapper.addRule("Server/Service/Engine/Host/Listener",
  +                       mapper.setProperties());
  +	mapper.addRule("Server/Service/Engine/Host/Listener", mapper.addChild
   		       ("addLifecycleListener",
   			"org.apache.catalina.LifecycleListener"));
   
  -	mapper.addRule("Server/Engine/Host/Context/Loader",
  -		       mapper.objectCreate
  +	mapper.addRule("Server/Service/Engine/Host/Loader", mapper.objectCreate
   		       ("org.apache.catalina.core.StandardLoader",
   			"className"));
  -	mapper.addRule("Server/Engine/Host/Context/Loader",
  -		       mapper.setProperties());
  -	mapper.addRule("Server/Engine/Host/Context/Loader", mapper.addChild
  +	mapper.addRule("Server/Service/Engine/Host/Loader",
  +                       mapper.setProperties());
  +	mapper.addRule("Engine/Service/Engine/Host/Loader", mapper.addChild
   		       ("setLoader", "org.apache.catalina.Loader"));
   
  -	mapper.addRule("Server/Engine/Host/Context/Logger", mapper.objectCreate
  +	mapper.addRule("Server/Service/Engine/Host/Logger", mapper.objectCreate
   		       (null, "className"));
  -	mapper.addRule("Server/Engine/Host/Context/Logger",
  -		       mapper.setProperties());
  -	mapper.addRule("Server/Engine/Host/Context/Logger", mapper.addChild
  +	mapper.addRule("Server/Service/Engine/Host/Logger",
  +                       mapper.setProperties());
  +	mapper.addRule("Server/Service/Engine/Host/Logger", mapper.addChild
   		       ("setLogger", "org.apache.catalina.Logger"));
   
  -	mapper.addRule("Server/Engine/Host/Context/Manager",
  -		       mapper.objectCreate
  +	mapper.addRule("Server/Service/Engine/Host/Manager",
  +                       mapper.objectCreate
   		       ("org.apache.catalina.session.StandardManager",
   			"className"));
  -	mapper.addRule("Server/Engine/Host/Context/Manager",
  -		       mapper.setProperties());
  -	mapper.addRule("Server/Engine/Host/Context/Manager", mapper.addChild
  -		       ("setManager", "org.apache.catalina.Manager"));
  -
  -        mapper.addRule("Server/Engine/Host/Context/Parameter", mapper.objectCreate
  -                       ("org.apache.catalina.deploy.ApplicationParameter"));
  -        mapper.addRule("Server/Engine/Host/Context/Parameter",
  +	mapper.addRule("Server/Service/Engine/Host/Manager",
                          mapper.setProperties());
  -        mapper.addRule("Server/Engine/Host/Context/Parameter", mapper.addChild
  -                       ("addApplicationParameter",
  -                        "org.apache.catalina.deploy.ApplicationParameter"));
  +	mapper.addRule("Server/Service/Engine/Host/Manager", mapper.addChild
  +		       ("setManager", "org.apache.catalina.Manager"));
   
  -	mapper.addRule("Server/Engine/Host/Context/Realm", mapper.objectCreate
  +	mapper.addRule("Server/Service/Engine/Host/Realm", mapper.objectCreate
   		       (null, "className"));
  -	mapper.addRule("Server/Engine/Host/Context/Realm",
  -		       mapper.setProperties());
  -	mapper.addRule("Server/Engine/Host/Context/Realm", mapper.addChild
  +	mapper.addRule("Server/Service/Engine/Host/Realm",
  +                       mapper.setProperties());
  +	mapper.addRule("Server/Service/Engine/Host/Realm", mapper.addChild
   		       ("setRealm", "org.apache.catalina.Realm"));
   
  -        mapper.addRule("Server/Engine/Host/Context/Resource",
  +	mapper.addRule("Server/Service/Engine/Host/Resources",
                          mapper.objectCreate
  -                       ("org.apache.catalina.deploy.ContextResource"));
  -        mapper.addRule("Server/Engine/Host/Context/Resource",
  -                       mapper.setProperties());
  -        mapper.addRule("Server/Engine/Host/Context/Resource",
  -                       mapper.addChild
  -                       ("addResource",
  -                        "org.apache.catalina.deploy.ContextResource"));
  -
  -	mapper.addRule("Server/Engine/Host/Context/Resources",
  -		       mapper.objectCreate
   		       ("org.apache.catalina.core.StandardResources",
   			"className"));
  -	mapper.addRule("Server/Engine/Host/Context/Resources",
  -		       mapper.setProperties());
  -	mapper.addRule("Server/Engine/Host/Context/Resources", mapper.addChild
  +	mapper.addRule("Server/Service/Engine/Host/Resources",
  +                       mapper.setProperties());
  +	mapper.addRule("Server/Service/Engine/Host/Resources", mapper.addChild
   		       ("setResources", "org.apache.catalina.Resources"));
   
  -	mapper.addRule("Server/Engine/Host/Context/Valve", mapper.objectCreate
  +	mapper.addRule("Server/Service/Engine/Host/Valve", mapper.objectCreate
   		       (null, "className"));
  -	mapper.addRule("Server/Engine/Host/Context/Valve",
  -		       mapper.setProperties());
  -	mapper.addRule("Server/Engine/Host/Context/Valve", mapper.addChild
  +	mapper.addRule("Server/Service/Engine/Host/Valve",
  +                       mapper.setProperties());
  +	mapper.addRule("Server/Service/Engine/Host/Valve", mapper.addChild
   		       ("addValve", "org.apache.catalina.Valve"));
   
  -	mapper.addRule("Server/Engine/Host/Context/WrapperLifecycle",
  -		       mapper.methodSetter("addWrapperLifecycle", 0));
  -
  -	mapper.addRule("Server/Engine/Host/Context/WrapperListener",
  -		       mapper.methodSetter("addWrapperListener", 0));
  -
  -	mapper.addRule("Server/Engine/Host/Listener", mapper.objectCreate
  +	mapper.addRule("Server/Service/Engine/Listener", mapper.objectCreate
   		       (null, "className"));
  -	mapper.addRule("Server/Engine/Host/Listener", mapper.setProperties());
  -	mapper.addRule("Server/Engine/Host/Listener", mapper.addChild
  +	mapper.addRule("Server/Service/Engine/Listener",
  +                       mapper.setProperties());
  +	mapper.addRule("Server/Service/Engine/Listener", mapper.addChild
   		       ("addLifecycleListener",
   			"org.apache.catalina.LifecycleListener"));
   
  -	mapper.addRule("Server/Engine/Host/Loader", mapper.objectCreate
  +	mapper.addRule("Server/Service/Engine/Loader", mapper.objectCreate
   		       ("org.apache.catalina.core.StandardLoader",
   			"className"));
  -	mapper.addRule("Server/Engine/Host/Loader", mapper.setProperties());
  -	mapper.addRule("Engine/Host/Loader", mapper.addChild
  +	mapper.addRule("Server/Service/Engine/Loader", mapper.setProperties());
  +	mapper.addRule("Server/Service/Engine/Loader", mapper.addChild
   		       ("setLoader", "org.apache.catalina.Loader"));
   
  -	mapper.addRule("Server/Engine/Host/Logger", mapper.objectCreate
  +	mapper.addRule("Server/Service/Engine/Logger", mapper.objectCreate
   		       (null, "className"));
  -	mapper.addRule("Server/Engine/Host/Logger", mapper.setProperties());
  -	mapper.addRule("Server/Engine/Host/Logger", mapper.addChild
  +	mapper.addRule("Server/Service/Engine/Logger", mapper.setProperties());
  +	mapper.addRule("Server/Service/Engine/Logger", mapper.addChild
   		       ("setLogger", "org.apache.catalina.Logger"));
   
  -	mapper.addRule("Server/Engine/Host/Manager", mapper.objectCreate
  +	mapper.addRule("Server/Service/Engine/Manager", mapper.objectCreate
   		       ("org.apache.catalina.session.StandardManager",
   			"className"));
  -	mapper.addRule("Server/Engine/Host/Manager", mapper.setProperties());
  -	mapper.addRule("Server/Engine/Host/Manager", mapper.addChild
  +	mapper.addRule("Server/Service/Engine/Manager",
  +                       mapper.setProperties());
  +	mapper.addRule("Server/Service/Engine/Manager", mapper.addChild
   		       ("setManager", "org.apache.catalina.Manager"));
   
  -	mapper.addRule("Server/Engine/Host/Realm", mapper.objectCreate
  +	mapper.addRule("Server/Service/Engine/Realm", mapper.objectCreate
   		       (null, "className"));
  -	mapper.addRule("Server/Engine/Host/Realm", mapper.setProperties());
  -	mapper.addRule("Server/Engine/Host/Realm", mapper.addChild
  +	mapper.addRule("Server/Service/Engine/Realm", mapper.setProperties());
  +	mapper.addRule("Server/Service/Engine/Realm", mapper.addChild
   		       ("setRealm", "org.apache.catalina.Realm"));
   
  -	mapper.addRule("Server/Engine/Host/Resources", mapper.objectCreate
  +	mapper.addRule("Server/Service/Engine/Resources", mapper.objectCreate
   		       ("org.apache.catalina.core.StandardResources",
   			"className"));
  -	mapper.addRule("Server/Engine/Host/Resources", mapper.setProperties());
  -	mapper.addRule("Server/Engine/Host/Resources", mapper.addChild
  +	mapper.addRule("Server/Service/Engine/Resources",
  +                       mapper.setProperties());
  +	mapper.addRule("Server/Service/Engine/Resources", mapper.addChild
   		       ("setResources", "org.apache.catalina.Resources"));
   
  -	mapper.addRule("Server/Engine/Host/Valve", mapper.objectCreate
  +	mapper.addRule("Server/Service/Engine/Valve", mapper.objectCreate
   		       (null, "className"));
  -	mapper.addRule("Server/Engine/Host/Valve", mapper.setProperties());
  -	mapper.addRule("Server/Engine/Host/Valve", mapper.addChild
  +	mapper.addRule("Server/Service/Engine/Valve", mapper.setProperties());
  +	mapper.addRule("Server/Service/Engine/Valve", mapper.addChild
   		       ("addValve", "org.apache.catalina.Valve"));
  +
  +	return (mapper);
  +
  +    }
  +
   
  -	mapper.addRule("Server/Engine/Listener", mapper.objectCreate
  +    /**
  +     * Create the mapper rules for a Context, based on the specified prefix.
  +     *
  +     * @param prefix Prefix to rule selectors to be created
  +     * @param mapper The mapper we are updating
  +     */
  +    protected void createStartMapperContext(String prefix, XmlMapper mapper) {
  +
  +	mapper.addRule(prefix + "", mapper.objectCreate
  +		       ("org.apache.catalina.core.StandardContext",
  +			"className"));
  +	mapper.addRule(prefix + "", mapper.setProperties());
  +	mapper.addRule(prefix + "",
  +		       new LifecycleListenerAction
  +			   ("org.apache.catalina.startup.ContextConfig",
  +			    "configClass"));
  +	mapper.addRule(prefix + "", mapper.addChild
  +		       ("addChild", "org.apache.catalina.Container"));
  +
  +        mapper.addRule(prefix + "/Ejb", mapper.objectCreate
  +                       ("org.apache.catalina.deploy.ContextEjb"));
  +        mapper.addRule(prefix + "/Ejb",
  +                       mapper.setProperties());
  +        mapper.addRule(prefix + "/Ejb", mapper.addChild
  +                       ("addEjb", "org.apache.catalina.deploy.ContextEjb"));
  +
  +        mapper.addRule(prefix + "/Environment",
  +                       mapper.objectCreate
  +                       ("org.apache.catalina.deploy.ContextEnvironment"));
  +        mapper.addRule(prefix + "/Environment",
  +                       mapper.setProperties());
  +        mapper.addRule(prefix + "/Environment",
  +                       mapper.addChild
  +                       ("addEnvironment",
  +                        "org.apache.catalina.deploy.ContextEnvironment"));
  +
  +	mapper.addRule(prefix + "/InstanceListener",
  +		       mapper.methodSetter("addInstanceListener", 0));
  +
  +	mapper.addRule(prefix + "/Listener",
  +		       mapper.objectCreate
   		       (null, "className"));
  -	mapper.addRule("Server/Engine/Listener", mapper.setProperties());
  -	mapper.addRule("Server/Engine/Listener", mapper.addChild
  +	mapper.addRule(prefix + "/Listener",
  +		       mapper.setProperties());
  +	mapper.addRule(prefix + "/Listener", mapper.addChild
   		       ("addLifecycleListener",
   			"org.apache.catalina.LifecycleListener"));
   
  -	mapper.addRule("Server/Engine/Loader", mapper.objectCreate
  +	mapper.addRule(prefix + "/Loader",
  +		       mapper.objectCreate
   		       ("org.apache.catalina.core.StandardLoader",
   			"className"));
  -	mapper.addRule("Server/Engine/Loader", mapper.setProperties());
  -	mapper.addRule("Server/Engine/Loader", mapper.addChild
  +	mapper.addRule(prefix + "/Loader",
  +		       mapper.setProperties());
  +	mapper.addRule(prefix + "/Loader", mapper.addChild
   		       ("setLoader", "org.apache.catalina.Loader"));
   
  -	mapper.addRule("Server/Engine/Logger", mapper.objectCreate
  +	mapper.addRule(prefix + "/Logger", mapper.objectCreate
   		       (null, "className"));
  -	mapper.addRule("Server/Engine/Logger", mapper.setProperties());
  -	mapper.addRule("Server/Engine/Logger", mapper.addChild
  +	mapper.addRule(prefix + "/Logger",
  +		       mapper.setProperties());
  +	mapper.addRule(prefix + "/Logger", mapper.addChild
   		       ("setLogger", "org.apache.catalina.Logger"));
   
  -	mapper.addRule("Server/Engine/Manager", mapper.objectCreate
  +	mapper.addRule(prefix + "/Manager",
  +		       mapper.objectCreate
   		       ("org.apache.catalina.session.StandardManager",
   			"className"));
  -	mapper.addRule("Server/Engine/Manager", mapper.setProperties());
  -	mapper.addRule("Server/Engine/Manager", mapper.addChild
  +	mapper.addRule(prefix + "/Manager",
  +		       mapper.setProperties());
  +	mapper.addRule(prefix + "/Manager", mapper.addChild
   		       ("setManager", "org.apache.catalina.Manager"));
  +
  +        mapper.addRule(prefix + "/Parameter", mapper.objectCreate
  +                       ("org.apache.catalina.deploy.ApplicationParameter"));
  +        mapper.addRule(prefix + "/Parameter",
  +                       mapper.setProperties());
  +        mapper.addRule(prefix + "/Parameter", mapper.addChild
  +                       ("addApplicationParameter",
  +                        "org.apache.catalina.deploy.ApplicationParameter"));
   
  -	mapper.addRule("Server/Engine/Realm", mapper.objectCreate
  +	mapper.addRule(prefix + "/Realm", mapper.objectCreate
   		       (null, "className"));
  -	mapper.addRule("Server/Engine/Realm", mapper.setProperties());
  -	mapper.addRule("Server/Engine/Realm", mapper.addChild
  +	mapper.addRule(prefix + "/Realm",
  +		       mapper.setProperties());
  +	mapper.addRule(prefix + "/Realm", mapper.addChild
   		       ("setRealm", "org.apache.catalina.Realm"));
  +
  +        mapper.addRule(prefix + "/Resource",
  +                       mapper.objectCreate
  +                       ("org.apache.catalina.deploy.ContextResource"));
  +        mapper.addRule(prefix + "/Resource",
  +                       mapper.setProperties());
  +        mapper.addRule(prefix + "/Resource",
  +                       mapper.addChild
  +                       ("addResource",
  +                        "org.apache.catalina.deploy.ContextResource"));
   
  -	mapper.addRule("Server/Engine/Resources", mapper.objectCreate
  +	mapper.addRule(prefix + "/Resources",
  +		       mapper.objectCreate
   		       ("org.apache.catalina.core.StandardResources",
   			"className"));
  -	mapper.addRule("Server/Engine/Resources", mapper.setProperties());
  -	mapper.addRule("Server/Engine/Resources", mapper.addChild
  +	mapper.addRule(prefix + "/Resources",
  +		       mapper.setProperties());
  +	mapper.addRule(prefix + "/Resources", mapper.addChild
   		       ("setResources", "org.apache.catalina.Resources"));
   
  -	mapper.addRule("Server/Engine/Valve", mapper.objectCreate
  +	mapper.addRule(prefix + "/Valve", mapper.objectCreate
   		       (null, "className"));
  -	mapper.addRule("Server/Engine/Valve", mapper.setProperties());
  -	mapper.addRule("Server/Engine/Valve", mapper.addChild
  +	mapper.addRule(prefix + "/Valve",
  +		       mapper.setProperties());
  +	mapper.addRule(prefix + "/Valve", mapper.addChild
   		       ("addValve", "org.apache.catalina.Valve"));
   
  -	return (mapper);
  +	mapper.addRule(prefix + "/WrapperLifecycle",
  +		       mapper.methodSetter("addWrapperLifecycle", 0));
   
  +	mapper.addRule(prefix + "/WrapperListener",
  +		       mapper.methodSetter("addWrapperListener", 0));
  +
       }
   
   
  @@ -585,8 +625,10 @@
   	    } catch (LifecycleException e) {
   	        System.out.println("Catalina.start: " + e);
   		e.printStackTrace(System.out);
  -                System.out.println("----- Root Cause -----");
  -                e.getThrowable().printStackTrace(System.out);
  +                if (e.getThrowable() != null) {
  +                    System.out.println("----- Root Cause -----");
  +                    e.getThrowable().printStackTrace(System.out);
  +                }
   	    }
   	}
   
  @@ -601,8 +643,10 @@
   	    } catch (LifecycleException e) {
   	        System.out.println("Catalina.stop: " + e);
   	        e.printStackTrace(System.out);
  -                System.out.println("----- Root Cause -----");
  -                e.getThrowable().printStackTrace(System.out);
  +                if (e.getThrowable() != null) {
  +                    System.out.println("----- Root Cause -----");
  +                    e.getThrowable().printStackTrace(System.out);
  +                }
   	    }
   	}
   
  @@ -738,3 +782,49 @@
   
   
   }
  +
  +
  +/**
  + * Class that sets the parent class loader for the top class on the stack.
  + */
  +
  +final class SetParentClassLoaderAction extends XmlAction {
  +
  +
  +    /**
  +     * Construct a new action.
  +     *
  +     * @param parentClassLoader The new parent class loader
  +     */
  +    public SetParentClassLoaderAction(ClassLoader parentClassLoader) {
  +
  +        this.parentClassLoader = parentClassLoader;
  +
  +    }
  +
  +
  +    /**
  +     * The parent class loader to be set.
  +     */
  +    private ClassLoader parentClassLoader = null;
  +
  +
  +    /**
  +     * Add the requested parent class loader
  +     */
  +    public void start(SaxContext context) throws Exception {
  +
  +	if (context.getDebug() >= 1)
  +	    context.log("Setting parent class loader");
  +
  +	// Set the parent class loader for this Container
  +	Stack stack = context.getObjectStack();
  +        Container top = (Container) stack.peek();
  +        top.setParentClassLoader(parentClassLoader);
  +
  +    }
  +
  +
  +}
  +
  +
  
  
  
  1.10      +1 -1      jakarta-tomcat-4.0/jasper/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/jasper/build.xml,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- build.xml	2000/09/22 13:57:41	1.9
  +++ build.xml	2000/09/30 19:15:47	1.10
  @@ -39,7 +39,7 @@
   
       <!-- Shared Extensions -->
       <!--   Jasper needs the servlet API classes -->
  -    <copyfile src="${servlet.jar}" dest="${jasper.build}/lib/servlet.jar"/>
  +    <copyfile src="${servlet.jar}" dest="${jasper.build}/bin/servlet.jar"/>
       <!--   Jasper needs Xerces (JAXP1.0/SAX2.0 compliant parser -->
       <copyfile src="${xerces.jar}"    dest="${jasper.build}/lib/xerces.jar"/>
   
  
  
  

Mime
View raw message