qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rob...@apache.org
Subject svn commit: r1457612 - in /qpid/trunk/qpid/java/broker/src: main/java/org/apache/qpid/server/Broker.java main/java/org/apache/qpid/server/BrokerOptions.java test/java/org/apache/qpid/server/BrokerOptionsTest.java
Date Mon, 18 Mar 2013 00:37:18 GMT
Author: robbie
Date: Mon Mar 18 00:37:17 2013
New Revision: 1457612

URL: http://svn.apache.org/r1457612
Log:
QPID-4655: add BrokerOptions support for skipping the logging configuration (and LoggingManagementMbean
registration as a result) when embedding the broker

Modified:
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/Broker.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/BrokerOptions.java
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/BrokerOptionsTest.java

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/Broker.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/Broker.java?rev=1457612&r1=1457611&r2=1457612&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/Broker.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/Broker.java Mon Mar 18
00:37:17 2013
@@ -115,8 +115,13 @@ public class Broker
 
         CurrentActor.get().message(BrokerMessages.CONFIG(storeLocation));
 
-        File logConfigFile = getConfigFile(options.getLogConfigFile(), BrokerOptions.DEFAULT_LOG_CONFIG_FILE,
qpidHome, false);
-        configureLogging(logConfigFile, options.getLogWatchFrequency());
+        //Allow skipping the logging configuration for people who are
+        //embedding the broker and want to configure it themselves.
+        if(!options.isSkipLoggingConfiguration())
+        {
+            File logConfigFile = getConfigFile(options.getLogConfigFile(), BrokerOptions.DEFAULT_LOG_CONFIG_FILE,
qpidHome, false);
+            configureLogging(logConfigFile, options.getLogWatchFrequency());
+        }
 
         BrokerConfigurationStoreCreator storeCreator = new BrokerConfigurationStoreCreator();
         ConfigurationEntryStore store = storeCreator.createStore(storeLocation, storeType,
options.getInitialConfigurationLocation());

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/BrokerOptions.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/BrokerOptions.java?rev=1457612&r1=1457611&r2=1457612&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/BrokerOptions.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/BrokerOptions.java Mon
Mar 18 00:37:17 2013
@@ -47,6 +47,7 @@ public class BrokerOptions
     private int _managementModeConnectorPort;
     private int _managementModeHttpPort;
     private String _workingDir;
+    private boolean _skipLoggingConfiguration;
 
     public String getLogConfigFile()
     {
@@ -228,4 +229,14 @@ public class BrokerOptions
     {
         _initialConfigurationLocation = initialConfigurationLocation;
     }
+
+    public boolean isSkipLoggingConfiguration()
+    {
+        return _skipLoggingConfiguration;
+    }
+
+    public void setSkipLoggingConfiguration(boolean skipLoggingConfiguration)
+    {
+        _skipLoggingConfiguration = skipLoggingConfiguration;
+    }
 }

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/BrokerOptionsTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/BrokerOptionsTest.java?rev=1457612&r1=1457611&r2=1457612&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/BrokerOptionsTest.java
(original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/BrokerOptionsTest.java
Mon Mar 18 00:37:17 2013
@@ -186,4 +186,15 @@ public class BrokerOptionsTest extends Q
         _options.setWorkDir(testWorkDir);
         assertEquals(testWorkDir, _options.getWorkDir());
     }
+
+    public void testDefaultSkipLoggingConfiguration()
+    {
+        assertFalse(_options.isSkipLoggingConfiguration());
+    }
+
+    public void testOverriddenSkipLoggingConfiguration()
+    {
+        _options.setSkipLoggingConfiguration(true);
+        assertTrue(_options.isSkipLoggingConfiguration());
+    }
 }



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


Mime
View raw message