tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject svn commit: r439322 - in /tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina: core/StandardContext.java startup/ContextRuleSet.java
Date Fri, 01 Sep 2006 13:54:51 GMT
Author: remm
Date: Fri Sep  1 06:54:50 2006
New Revision: 439322

URL: http://svn.apache.org/viewvc?rev=439322&view=rev
Log:
- Revert the fix, since the situation described in the bug is not valid (and I'm afraid my
boss would murder me 
  if there's a regression).
- Cleanup getParentCL so that it returns consistent results when using privileged="true".
This might have been
  causing problems in some cases.
- After looking a bit everywhere, the CreateLoaderRule will use the same parent CL as the
one which would be set
  by the CopyParentCL rule, so I don't see how a problem could occur.

Modified:
    tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/StandardContext.java
    tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/startup/ContextRuleSet.java

Modified: tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/StandardContext.java
URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/StandardContext.java?rev=439322&r1=439321&r2=439322&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/StandardContext.java
(original)
+++ tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/StandardContext.java
Fri Sep  1 06:54:50 2006
@@ -1423,6 +1423,23 @@
 
 
     /**
+     * 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 (getPrivileged()) {
+            return this.getClass().getClassLoader();
+        } else if (parent != null) {
+            return (parent.getParentClassLoader());
+        }
+        return (ClassLoader.getSystemClassLoader());
+    }
+
+
+    /**
      * Return the context path for this Context.
      */
     public String getPath() {
@@ -4035,17 +4052,7 @@
         }
         
         if (getLoader() == null) {
-            ClassLoader parent = null;
-            if (getPrivileged()) {
-                if (log.isDebugEnabled())
-                    log.debug("Configuring privileged default Loader");
-                parent = this.getClass().getClassLoader();
-            } else {
-                if (log.isDebugEnabled())
-                    log.debug("Configuring non-privileged default Loader");
-                parent = getParentClassLoader();
-            }
-            WebappLoader webappLoader = new WebappLoader(parent);
+            WebappLoader webappLoader = new WebappLoader(getParentClassLoader());
             webappLoader.setDelegate(getDelegate());
             setLoader(webappLoader);
         }

Modified: tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/startup/ContextRuleSet.java
URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/startup/ContextRuleSet.java?rev=439322&r1=439321&r2=439322&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/startup/ContextRuleSet.java
(original)
+++ tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/startup/ContextRuleSet.java
Fri Sep  1 06:54:50 2006
@@ -126,8 +126,6 @@
 
         if (create) {
             digester.addRule(prefix + "Context",
-                    new CopyParentClassLoaderRule());
-            digester.addRule(prefix + "Context",
                              new LifecycleListenerRule
                                  ("org.apache.catalina.startup.ContextConfig",
                                   "configClass"));



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message