You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rg...@apache.org on 2016/11/02 10:43:14 UTC

svn commit: r1767630 [2/2] - in /qpid/java/trunk: broker-core/src/main/java/org/apache/qpid/server/ broker-core/src/main/java/org/apache/qpid/server/configuration/ broker-core/src/main/java/org/apache/qpid/server/logging/messages/ broker-core/src/main/...

Modified: qpid/java/trunk/broker/src/main/java/org/apache/qpid/server/Main.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker/src/main/java/org/apache/qpid/server/Main.java?rev=1767630&r1=1767629&r2=1767630&view=diff
==============================================================================
--- qpid/java/trunk/broker/src/main/java/org/apache/qpid/server/Main.java (original)
+++ qpid/java/trunk/broker/src/main/java/org/apache/qpid/server/Main.java Wed Nov  2 10:43:13 2016
@@ -42,7 +42,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import org.apache.qpid.configuration.CommonProperties;
-import org.apache.qpid.server.configuration.BrokerProperties;
 import org.apache.qpid.server.configuration.IllegalConfigurationException;
 import org.apache.qpid.server.logging.logback.LogbackLoggingSystemLauncherListener;
 import org.apache.qpid.server.model.AbstractSystemConfig;
@@ -60,6 +59,15 @@ import org.apache.qpid.util.FileUtils;
  */
 public class Main
 {
+    public static final String PROPERTY_QPID_HOME = "QPID_HOME";
+    /**
+     * Configuration property name for the absolute path to use for the broker home directory.
+     *
+     * If not otherwise set, the value for this configuration property defaults to the location
+     * set in the "QPID_HOME" system property if that was set, or remains unset if it was not.
+     */
+    private static final String QPID_HOME_DIR  = "qpid.home_dir";
+
     private static final int MANAGEMENT_MODE_PASSWORD_LENGTH = 10;
 
     private static final Option OPTION_HELP = new Option("h", "help", false, "print this message");
@@ -166,7 +174,7 @@ public class Main
         Map<String,Object> attributes = new HashMap<>();
 
         String initialProperties = _commandLine.getOptionValue(OPTION_INITIAL_SYSTEM_PROPERTIES.getOpt());
-        BrokerProperties.populateSystemPropertiesFromDefaults(initialProperties);
+        SystemLauncher.populateSystemPropertiesFromDefaults(initialProperties);
 
         String initialConfigLocation = _commandLine.getOptionValue(OPTION_INITIAL_CONFIGURATION_PATH.getOpt());
         if(initialConfigLocation != null)
@@ -256,29 +264,29 @@ public class Main
                 context.put(name, value);
             }
         }
-        if(!context.containsKey(BrokerProperties.QPID_HOME_DIR))
+        if(!context.containsKey(QPID_HOME_DIR))
         {
             Properties systemProperties = System.getProperties();
             final Map<String, String> environment = System.getenv();
-            if(systemProperties.contains(BrokerProperties.QPID_HOME_DIR))
+            if(systemProperties.contains(QPID_HOME_DIR))
             {
-                context.put(BrokerProperties.QPID_HOME_DIR, systemProperties.getProperty(BrokerProperties.QPID_HOME_DIR));
+                context.put(QPID_HOME_DIR, systemProperties.getProperty(QPID_HOME_DIR));
             }
-            else if(environment.containsKey(BrokerProperties.QPID_HOME_DIR))
+            else if(environment.containsKey(QPID_HOME_DIR))
             {
-                context.put(BrokerProperties.QPID_HOME_DIR, environment.get(BrokerProperties.QPID_HOME_DIR));
+                context.put(QPID_HOME_DIR, environment.get(QPID_HOME_DIR));
             }
-            else if(context.containsKey(BrokerProperties.PROPERTY_QPID_HOME))
+            else if(context.containsKey(PROPERTY_QPID_HOME))
             {
-                context.put(BrokerProperties.QPID_HOME_DIR, context.get(BrokerProperties.PROPERTY_QPID_HOME));
+                context.put(QPID_HOME_DIR, context.get(PROPERTY_QPID_HOME));
             }
-            else if(systemProperties.contains(BrokerProperties.PROPERTY_QPID_HOME))
+            else if(systemProperties.contains(PROPERTY_QPID_HOME))
             {
-                context.put(BrokerProperties.QPID_HOME_DIR, environment.get(BrokerProperties.PROPERTY_QPID_HOME));
+                context.put(QPID_HOME_DIR, environment.get(PROPERTY_QPID_HOME));
             }
-            else if(environment.containsKey(BrokerProperties.PROPERTY_QPID_HOME))
+            else if(environment.containsKey(PROPERTY_QPID_HOME))
             {
-                context.put(BrokerProperties.QPID_HOME_DIR, environment.get(BrokerProperties.PROPERTY_QPID_HOME));
+                context.put(QPID_HOME_DIR, environment.get(PROPERTY_QPID_HOME));
             }
         }
         return context;

Modified: qpid/java/trunk/broker/src/test/java/org/apache/qpid/server/MainTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker/src/test/java/org/apache/qpid/server/MainTest.java?rev=1767630&r1=1767629&r2=1767630&view=diff
==============================================================================
--- qpid/java/trunk/broker/src/test/java/org/apache/qpid/server/MainTest.java (original)
+++ qpid/java/trunk/broker/src/test/java/org/apache/qpid/server/MainTest.java Wed Nov  2 10:43:13 2016
@@ -26,7 +26,6 @@ import java.util.Map;
 
 import org.apache.commons.cli.CommandLine;
 
-import org.apache.qpid.server.configuration.BrokerProperties;
 import org.apache.qpid.server.model.SystemConfig;
 import org.apache.qpid.test.utils.QpidTestCase;
 
@@ -42,9 +41,9 @@ public class MainTest extends QpidTestCa
     public void testNoOptionsSpecified()
     {
         String qpidWork = "/qpid/work";
-        setTestSystemProperty(BrokerProperties.PROPERTY_QPID_WORK, qpidWork);
+        setTestSystemProperty(SystemConfig.PROPERTY_QPID_WORK, qpidWork);
         String qpidHome = "/qpid/home";
-        setTestSystemProperty(BrokerProperties.PROPERTY_QPID_HOME, qpidHome);
+        setTestSystemProperty(Main.PROPERTY_QPID_HOME, qpidHome);
 
         Map<String,Object> attributes = startDummyMain("");
 

Modified: qpid/java/trunk/systests/src/main/java/org/apache/qpid/test/utils/SpawnedBrokerHolder.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/systests/src/main/java/org/apache/qpid/test/utils/SpawnedBrokerHolder.java?rev=1767630&r1=1767629&r2=1767630&view=diff
==============================================================================
--- qpid/java/trunk/systests/src/main/java/org/apache/qpid/test/utils/SpawnedBrokerHolder.java (original)
+++ qpid/java/trunk/systests/src/main/java/org/apache/qpid/test/utils/SpawnedBrokerHolder.java Wed Nov  2 10:43:13 2016
@@ -35,7 +35,7 @@ import java.util.concurrent.TimeUnit;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import org.apache.qpid.server.configuration.BrokerProperties;
+import org.apache.qpid.server.Main;
 import org.apache.qpid.server.logging.logback.BrokerLogbackSocketLogger;
 import org.apache.qpid.server.logging.logback.BrokerNameAndLevelLogInclusionRule;
 import org.apache.qpid.server.logging.messages.BrokerMessages;
@@ -102,8 +102,8 @@ public class SpawnedBrokerHolder extends
         ProcessBuilder pb = new ProcessBuilder(cmd);
         pb.redirectErrorStream(true);
         Map<String, String> processEnv = pb.environment();
-        String qpidHome = System.getProperty(BrokerProperties.PROPERTY_QPID_HOME);
-        processEnv.put(BrokerProperties.PROPERTY_QPID_HOME, qpidHome);
+        String qpidHome = System.getProperty(Main.PROPERTY_QPID_HOME);
+        processEnv.put(Main.PROPERTY_QPID_HOME, qpidHome);
 
         //Augment Path with bin directory in QPID_HOME.
         boolean foundPath = false;

Modified: qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/SupportedProtocolVersionsTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/SupportedProtocolVersionsTest.java?rev=1767630&r1=1767629&r2=1767630&view=diff
==============================================================================
--- qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/SupportedProtocolVersionsTest.java (original)
+++ qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/SupportedProtocolVersionsTest.java Wed Nov  2 10:43:13 2016
@@ -32,8 +32,8 @@ import com.fasterxml.jackson.databind.Ob
 import org.apache.qpid.client.AMQConnection;
 import org.apache.qpid.configuration.ClientProperties;
 import org.apache.qpid.framing.ProtocolVersion;
-import org.apache.qpid.server.configuration.BrokerProperties;
 import org.apache.qpid.server.model.Protocol;
+import org.apache.qpid.server.model.port.AmqpPort;
 import org.apache.qpid.server.plugin.AMQPProtocolVersionWrapper;
 import org.apache.qpid.test.utils.QpidBrokerTestCase;
 
@@ -144,7 +144,7 @@ public class SupportedProtocolVersionsTe
         //disable 0-10 support, and set the default unsupported protocol initiation reply to 0-9
         setSystemProperty(QpidBrokerTestCase.TEST_AMQP_PORT_PROTOCOLS_PROPERTY, getProtocolsWithExclusions(Protocol.AMQP_1_0, Protocol.AMQP_0_10));
 
-        setSystemProperty(BrokerProperties.PROPERTY_DEFAULT_SUPPORTED_PROTOCOL_REPLY, "v0_9");
+        setSystemProperty(AmqpPort.PROPERTY_DEFAULT_SUPPORTED_PROTOCOL_REPLY, "v0_9");
 
         super.setUp();
 

Modified: qpid/java/trunk/systests/src/test/java/org/apache/qpid/transport/ProtocolNegotiationTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/systests/src/test/java/org/apache/qpid/transport/ProtocolNegotiationTest.java?rev=1767630&r1=1767629&r2=1767630&view=diff
==============================================================================
--- qpid/java/trunk/systests/src/test/java/org/apache/qpid/transport/ProtocolNegotiationTest.java (original)
+++ qpid/java/trunk/systests/src/test/java/org/apache/qpid/transport/ProtocolNegotiationTest.java Wed Nov  2 10:43:13 2016
@@ -43,7 +43,6 @@ import org.apache.qpid.configuration.Cli
 import org.apache.qpid.framing.HeartbeatBody;
 import org.apache.qpid.framing.ProtocolInitiation;
 import org.apache.qpid.framing.ProtocolVersion;
-import org.apache.qpid.server.configuration.BrokerProperties;
 import org.apache.qpid.server.model.Broker;
 import org.apache.qpid.server.model.Port;
 import org.apache.qpid.server.model.Protocol;
@@ -69,14 +68,14 @@ public class ProtocolNegotiationTest ext
                                   Port.PROTOCOLS,
                                   Arrays.asList(getBrokerProtocol()));
         Map<String,String> overriddenPortContext = new HashMap<>();
-        overriddenPortContext.put(BrokerProperties.PROPERTY_DEFAULT_SUPPORTED_PROTOCOL_REPLY, null);
+        overriddenPortContext.put(AmqpPort.PROPERTY_DEFAULT_SUPPORTED_PROTOCOL_REPLY, null);
         overriddenPortContext.put(AmqpPort.PROTOCOL_HANDSHAKE_TIMEOUT, String.valueOf(AmqpPort.DEFAULT_PROTOCOL_HANDSHAKE_TIMEOUT));
         config.setObjectAttribute(Port.class,
                                   TestBrokerConfiguration.ENTRY_NAME_AMQP_PORT,
                                   Port.CONTEXT,
                                   overriddenPortContext);
         config.setBrokerAttribute(Broker.CONTEXT,
-                                  Collections.singletonMap(BrokerProperties.PROPERTY_DEFAULT_SUPPORTED_PROTOCOL_REPLY, null));
+                                  Collections.singletonMap(AmqpPort.PROPERTY_DEFAULT_SUPPORTED_PROTOCOL_REPLY, null));
 
         super.setUp();
         _expectedProtocolInit = convertProtocolToProtocolVersion(getBrokerProtocol());



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org