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/catalina/src/share/org/apache/catalina/startup Embedded.java
Date Thu, 14 Dec 2000 22:32:22 GMT
craigmcc    00/12/14 14:32:21

  Modified:    catalina/src/share/org/apache/catalina Loader.java
               catalina/src/share/org/apache/catalina/loader
                        StandardLoader.java
               catalina/src/share/org/apache/catalina/startup Embedded.java
  Log:
  Allow a server that is embedding Catalina to initialize the "follow
  standard delegation model" property of the web app class loader that will
  be configured.  The default for this property remains "false", consistent
  with prior behavior.
  
  Submitted by:	Vivek Nagar <vivek.nagar@eng.sun.com>
  
  Revision  Changes    Path
  1.3       +20 -4     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Loader.java
  
  Index: Loader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Loader.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Loader.java	2000/09/21 20:05:58	1.2
  +++ Loader.java	2000/12/14 22:32:15	1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Loader.java,v
1.2 2000/09/21 20:05:58 craigmcc Exp $
  - * $Revision: 1.2 $
  - * $Date: 2000/09/21 20:05:58 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Loader.java,v
1.3 2000/12/14 22:32:15 craigmcc Exp $
  + * $Revision: 1.3 $
  + * $Date: 2000/12/14 22:32:15 $
    *
    * ====================================================================
    *
  @@ -96,7 +96,7 @@
    * </ul>
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.2 $ $Date: 2000/09/21 20:05:58 $
  + * @version $Revision: 1.3 $ $Date: 2000/12/14 22:32:15 $
    */
   
   public interface Loader {
  @@ -123,6 +123,22 @@
        * @param container The associated Container
        */
       public void setContainer(Container container);
  +
  +
  +    /**
  +     * Return the "follow standard delegation model" flag used to configure
  +     * our ClassLoader.
  +     */
  +    public boolean getDelegate();
  +
  +
  +    /**
  +     * Set the "follow standard delegation model" flag used to configure
  +     * our ClassLoader.
  +     *
  +     * @param delegate The new flag
  +     */
  +    public void setDelegate(boolean delegate);
   
   
       /**
  
  
  
  1.12      +39 -4     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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- StandardLoader.java	2000/11/13 04:53:51	1.11
  +++ StandardLoader.java	2000/12/14 22:32:16	1.12
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/StandardLoader.java,v
1.11 2000/11/13 04:53:51 remm Exp $
  - * $Revision: 1.11 $
  - * $Date: 2000/11/13 04:53:51 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/StandardLoader.java,v
1.12 2000/12/14 22:32:16 craigmcc Exp $
  + * $Revision: 1.12 $
  + * $Date: 2000/12/14 22:32:16 $
    *
    * ====================================================================
    *
  @@ -101,7 +101,7 @@
    * is not present, the system class loader will be used instead.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.11 $ $Date: 2000/11/13 04:53:51 $
  + * @version $Revision: 1.12 $ $Date: 2000/12/14 22:32:16 $
    */
   
   public final class StandardLoader
  @@ -166,6 +166,13 @@
   
   
       /**
  +     * The "follow standard delegation model" flag that will be used to
  +     * configure our ClassLoader.
  +     */
  +    private boolean delegate = false;
  +
  +
  +    /**
        * The descriptive information about this Loader implementation.
        */
       private static final String info =
  @@ -343,6 +350,33 @@
   
   
       /**
  +     * Return the "follow standard delegation model" flag used to configure
  +     * our ClassLoader.
  +     */
  +    public boolean getDelegate() {
  +
  +        return (this.delegate);
  +
  +    }
  +
  +
  +    /**
  +     * Set the "follow standard delegation model" flag used to configure
  +     * our ClassLoader.
  +     *
  +     * @param delegate The new flag
  +     */
  +    public void setDelegate(boolean delegate) {
  +
  +        boolean oldDelegate = this.delegate;
  +        this.delegate = delegate;
  +        support.firePropertyChange("delegate", new Boolean(oldDelegate),
  +                                   new Boolean(this.delegate));
  +
  +    }
  +
  +
  +    /**
        * Return descriptive information about this Loader implementation and
        * the corresponding version number, in the format
        * <code>&lt;description&gt;/&lt;version&gt;</code>.
  @@ -556,6 +590,7 @@
   		classLoader.addRepository(repositories[i]);
   	    classLoader.addRestricted("org.apache.catalina.");
   	    classLoader.addSystem("javax.servlet.");
  +            ((StandardClassLoader) classLoader).setDelegate(this.delegate);
   	    if (classLoader instanceof Lifecycle)
   		((Lifecycle) classLoader).start();
   	} catch (Throwable t) {
  
  
  
  1.6       +25 -4     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Embedded.java
  
  Index: Embedded.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Embedded.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Embedded.java	2000/12/13 17:10:39	1.5
  +++ Embedded.java	2000/12/14 22:32:19	1.6
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Embedded.java,v
1.5 2000/12/13 17:10:39 craigmcc Exp $
  - * $Revision: 1.5 $
  - * $Date: 2000/12/13 17:10:39 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Embedded.java,v
1.6 2000/12/14 22:32:19 craigmcc Exp $
  + * $Revision: 1.6 $
  + * $Date: 2000/12/14 22:32:19 $
    *
    * ====================================================================
    *
  @@ -79,12 +79,14 @@
   import org.apache.catalina.LifecycleEvent;
   import org.apache.catalina.LifecycleException;
   import org.apache.catalina.LifecycleListener;
  +import org.apache.catalina.Loader;
   import org.apache.catalina.Logger;
   import org.apache.catalina.Realm;
   import org.apache.catalina.connector.http.HttpConnector;
   import org.apache.catalina.core.StandardContext;
   import org.apache.catalina.core.StandardEngine;
   import org.apache.catalina.core.StandardHost;
  +import org.apache.catalina.loader.StandardLoader;
   import org.apache.catalina.logger.FileLogger;
   import org.apache.catalina.logger.SystemOutLogger;
   import org.apache.catalina.net.SSLServerSocketFactory;
  @@ -145,7 +147,7 @@
    * </pre>
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.5 $ $Date: 2000/12/13 17:10:39 $
  + * @version $Revision: 1.6 $ $Date: 2000/12/14 22:32:19 $
    */
   
   public class Embedded implements Lifecycle {
  @@ -619,6 +621,25 @@
   	host.setName(name);
   
   	return (host);
  +
  +    }
  +
  +
  +    /**
  +     * Create and return a class loader manager that can be customized, and
  +     * then attached to a Context, before it is started.
  +     *
  +     * @param parent ClassLoader that will be the parent of the one
  +     *  created by this Loader
  +     */
  +    public Loader createLoader(ClassLoader parent) {
  +
  +        if (debug >= 1)
  +            logger.log("Creating Loader with parent class loader '" +
  +                       parent + "'");
  +
  +        StandardLoader loader = new StandardLoader(parent);
  +        return (loader);
   
       }
   
  
  
  

Mime
View raw message