Author: remm Date: Thu Sep 21 12:57:11 2017 New Revision: 1809158 URL: http://svn.apache.org/viewvc?rev=1809158&view=rev Log: Add a simple way to set the property source in embedded mode.
Modified: tomcat/trunk/java/org/apache/tomcat/util/digester/Digester.java tomcat/trunk/webapps/docs/changelog.xml Modified: tomcat/trunk/java/org/apache/tomcat/util/digester/Digester.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/digester/Digester.java?rev=1809158&r1=1809157&r2=1809158&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/digester/Digester.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/digester/Digester.java Thu Sep 21 12:57:11 2017 @@ -82,7 +82,8 @@ public class Digester extends DefaultHan // ---------------------------------------------------------- Static Fields - protected static final IntrospectionUtils.PropertySource propertySource; + protected static IntrospectionUtils.PropertySource propertySource; + private static boolean propertySourceSet = false; static { String className = System.getProperty("org.apache.tomcat.util.digester.PROPERTY_SOURCE"); @@ -102,9 +103,18 @@ public class Digester extends DefaultHan } } } - propertySource = source; + if (source != null) { + propertySource = source; + propertySourceSet = true; + } } + public static void setPropertySource(IntrospectionUtils.PropertySource propertySource) { + if (!propertySourceSet) { + Digester.propertySource = propertySource; + propertySourceSet = true; + } + } // --------------------------------------------------- Instance Variables @@ -304,6 +314,7 @@ public class Digester extends DefaultHan public Digester() { + propertySourceSet = true; if (propertySource != null) { source = new IntrospectionUtils.PropertySource[] { propertySource, source[0] }; } Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1809158&r1=1809157&r2=1809158&view=diff ============================================================================== --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Thu Sep 21 12:57:11 2017 @@ -81,6 +81,9 @@ contains multiple <code>Host</code> headers is rejected with a 400 response. (markt) </fix> + <update> + Add a way to set the property source in embedded mode. (remm) + </update> </changelog> </subsection> <subsection name="Other"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org