Allow setting of system properties from context.xml in addition to setting from command-line.

Accomplished by centralizing calls to System.getProperty(String) and related into new file SystemProperties.java.
There, we first check for existence of system property; if not, we look for property in context.xml
This is done for "application" properties (like hudson.DNSMultiCast.disabled) but not for java properties (like user.name)
This commit is contained in:
Johannes Ernst committed 2015-11-17 01:38:51 +00:00
1 parent b23b3cfae4
commit 709fe5b9aa
61 files changed
+358 -90

No files matched your search

+4 -2
View File
@@ -117,6 +117,8 @@ public class WebAppMain implements ServletContextListener {
installLogger();
SystemProperties.initialize( event.getServletContext() );
markCookieAsHttpOnly(context);
final FileAndDescription describedHomeDir = getHomeDir(event);
@@ -357,9 +359,9 @@ public class WebAppMain implements ServletContextListener {
// next the system property
for (String name : HOME_NAMES) {
String sysProp = System.getProperty(name);
String sysProp = SystemProperties.getProperty(name);
if(sysProp!=null)
return new FileAndDescription(new File(sysProp.trim()),"System.getProperty(\""+name+"\")");
return new FileAndDescription(new File(sysProp.trim()),"SystemProperties.getProperty(\""+name+"\")");
}
// look at the env var next