remm 2003/09/13 10:12:45 Modified: catalina/src/share/org/apache/catalina/core mbeans-descriptors.xml StandardContext.java Log: - Add a way to configure the CL delegation policy without headaches (at least when JMX is used). Revision Changes Path 1.22 +4 -0 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/mbeans-descriptors.xml Index: mbeans-descriptors.xml =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/mbeans-descriptors.xml,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- mbeans-descriptors.xml 19 Aug 2003 16:13:37 -0000 1.21 +++ mbeans-descriptors.xml 13 Sep 2003 17:12:45 -0000 1.22 @@ -119,6 +119,10 @@ description="Location of the default web.xml resource or file" type="java.lang.String"/> + <attribute name="delegate" + description="" + type="boolean"/> + <attribute name="deploymentDescriptor" description="String deployment descriptor " type="java.lang.String"/> 1.92 +41 -3 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardContext.java Index: StandardContext.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardContext.java,v retrieving revision 1.91 retrieving revision 1.92 diff -u -r1.91 -r1.92 --- StandardContext.java 12 Sep 2003 14:07:30 -0000 1.91 +++ StandardContext.java 13 Sep 2003 17:12:45 -0000 1.92 @@ -288,6 +288,13 @@ private boolean crossContext = false; + /** + * The "follow standard delegation model" flag that will be used to + * configure our ClassLoader. + */ + private boolean delegate = false; + + /** * The display name of this web application. */ @@ -615,6 +622,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)); + + } + + + /** * Returns true if the internal naming support is used. */ public boolean isUseNaming() { @@ -3921,15 +3955,19 @@ } if (getLoader() == null) { + ClassLoader parent = null; if (getPrivileged()) { if (log.isDebugEnabled()) log.debug("Configuring privileged default Loader"); - setLoader(new WebappLoader(this.getClass().getClassLoader())); + parent = this.getClass().getClassLoader(); } else { if (log.isDebugEnabled()) log.debug("Configuring non-privileged default Loader"); - setLoader(new WebappLoader(getParentClassLoader())); + parent = getParentClassLoader(); } + WebappLoader webappLoader = new WebappLoader(parent); + webappLoader.setDelegate(getDelegate()); + setLoader(webappLoader); } // Initialize character set mapper
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]