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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]