diff options
| author | Alex Rudyy <orudyy@apache.org> | 2015-02-13 17:13:35 +0000 |
|---|---|---|
| committer | Alex Rudyy <orudyy@apache.org> | 2015-02-13 17:13:35 +0000 |
| commit | 928fed665a842440179db42ef090be91217284ce (patch) | |
| tree | 98377c6c7cc688f3493442753cacbaa8471b12ef /qpid/java/broker/src | |
| parent | fbb2c460dfa60e63712f616a3e45c75c9735d5c7 (diff) | |
| download | qpid-python-928fed665a842440179db42ef090be91217284ce.tar.gz | |
QPID-6390: [Java Broker] Move setting of initial properties from Main into Broker
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1659613 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/broker/src')
| -rw-r--r-- | qpid/java/broker/src/main/java/org/apache/qpid/server/Main.java | 39 |
1 files changed, 6 insertions, 33 deletions
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/Main.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/Main.java index 85fe7af0fb..be2252abbd 100644 --- a/qpid/java/broker/src/main/java/org/apache/qpid/server/Main.java +++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/Main.java @@ -25,9 +25,6 @@ import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; -import java.util.HashSet; -import java.util.Properties; -import java.util.Set; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.HelpFormatter; @@ -179,11 +176,14 @@ public class Main protected void execute() throws Exception { - String initialProperties = _commandLine.getOptionValue(OPTION_INITIAL_SYSTEM_PROPERTIES.getOpt()); - populateSystemPropertiesFromDefaults(initialProperties); - BrokerOptions options = new BrokerOptions(); + String initialProperties = _commandLine.getOptionValue(OPTION_INITIAL_SYSTEM_PROPERTIES.getOpt()); + if (initialProperties != null) + { + options.setInitialSystemProperties(initialProperties); + } + String initialConfigLocation = _commandLine.getOptionValue(OPTION_INITIAL_CONFIGURATION_PATH.getOpt()); if (initialConfigLocation != null) { @@ -320,33 +320,6 @@ public class Main } } - private void populateSystemPropertiesFromDefaults(final String initialProperties) throws IOException - { - URL initialPropertiesLocation; - if(initialProperties == null) - { - initialPropertiesLocation = getClass().getClassLoader().getResource("system.properties"); - } - else - { - initialPropertiesLocation = (new File(initialProperties)).toURI().toURL(); - } - - Properties props = new Properties(QpidProperties.asProperties()); - if(initialPropertiesLocation != null) - { - props.load(initialPropertiesLocation.openStream()); - } - - Set<String> propertyNames = new HashSet<>(props.stringPropertyNames()); - propertyNames.removeAll(System.getProperties().stringPropertyNames()); - for (String propName : propertyNames) - { - System.setProperty(propName, props.getProperty(propName)); - } - - } - private void copyInitialConfigFile(final BrokerOptions options, final File destinationFile) { String initialConfigLocation = options.getInitialConfigurationLocation(); |
