tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject svn commit: r439324 - /tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardContext.java
Date Fri, 01 Sep 2006 13:59:55 GMT
Author: remm
Date: Fri Sep  1 06:59:55 2006
New Revision: 439324

URL: http://svn.apache.org/viewvc?rev=439324&view=rev
Log:
- Port patch so that getParentCL returns something consistent with the privileged flag.

Modified:
    tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardContext.java

Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardContext.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardContext.java?rev=439324&r1=439323&r2=439324&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardContext.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardContext.java Fri Sep  1 06:59:55
2006
@@ -1538,6 +1538,24 @@
         this.originalDocBase = docBase;
     }
     
+
+    /**
+     * 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 privileged flag for this web application.
      */
@@ -4117,17 +4135,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);
         }



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


Mime
View raw message