qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rob...@apache.org
Subject svn commit: r1061865 - in /qpid/trunk/qpid/java: broker/etc/ broker/src/main/java/org/apache/qpid/server/configuration/ broker/src/test/java/org/apache/qpid/server/configuration/ common/src/main/java/org/apache/qpid/transport/network/mina/
Date Fri, 21 Jan 2011 15:55:44 GMT
Author: robbie
Date: Fri Jan 21 15:55:44 2011
New Revision: 1061865

URL: http://svn.apache.org/viewvc?rev=1061865&view=rev
Log:
QPID-3010: ensure the SimpleByteBufferAllocator is always used and non-direct ByteBuffers
are the default, remove the old and now unused configuration methods from ServerConfiguration
and update the example config.xml accordingly

Modified:
    qpid/trunk/qpid/java/broker/etc/config.xml
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ServerConfiguration.java
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/ServerConfigurationTest.java
    qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/network/mina/MINANetworkDriver.java

Modified: qpid/trunk/qpid/java/broker/etc/config.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/etc/config.xml?rev=1061865&r1=1061864&r2=1061865&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/etc/config.xml (original)
+++ qpid/trunk/qpid/java/broker/etc/config.xml Fri Jan 21 15:55:44 2011
@@ -62,8 +62,6 @@
     </management>
     <advanced>
         <filterchain enableExecutorPool="true"/>
-        <enablePooledAllocator>false</enablePooledAllocator>
-        <enableDirectBuffers>false</enableDirectBuffers>
         <framesize>65535</framesize>
         <compressBufferOnQueue>false</compressBufferOnQueue>
         <enableJMSXUserID>false</enableJMSXUserID>

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ServerConfiguration.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ServerConfiguration.java?rev=1061865&r1=1061864&r2=1061865&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ServerConfiguration.java
(original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ServerConfiguration.java
Fri Jan 21 15:55:44 2011
@@ -704,16 +704,6 @@ public class ServerConfiguration extends
         return getBooleanValue("advanced.filterchain[@enableExecutorPool]");
     }
 
-    public boolean getEnablePooledAllocator()
-    {
-        return getBooleanValue("advanced.enablePooledAllocator");
-    }
-
-    public boolean getEnableDirectBuffers()
-    {
-        return getBooleanValue("advanced.enableDirectBuffers");
-    }
-
     public boolean getEnableSSL()
     {
         return getBooleanValue("connector.ssl.enabled");

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/ServerConfigurationTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/ServerConfigurationTest.java?rev=1061865&r1=1061864&r2=1061865&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/ServerConfigurationTest.java
(original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/ServerConfigurationTest.java
Fri Jan 21 15:55:44 2011
@@ -630,34 +630,6 @@ public class ServerConfigurationTest ext
         assertEquals(true, serverConfig.getEnableExecutorPool());
     }
 
-    public void testGetEnablePooledAllocator() throws ConfigurationException
-    {
-        // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(false, serverConfig.getEnablePooledAllocator());
-
-        // Check value we set
-        _config.setProperty("advanced.enablePooledAllocator", true);
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(true, serverConfig.getEnablePooledAllocator());
-    }
-
-    public void testGetEnableDirectBuffers() throws ConfigurationException
-    {
-        // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(false, serverConfig.getEnableDirectBuffers());
-
-        // Check value we set
-        _config.setProperty("advanced.enableDirectBuffers", true);
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(true, serverConfig.getEnableDirectBuffers());
-    }
-
     public void testGetEnableSSL() throws ConfigurationException
     {
         // Check default

Modified: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/network/mina/MINANetworkDriver.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/network/mina/MINANetworkDriver.java?rev=1061865&r1=1061864&r2=1061865&view=diff
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/network/mina/MINANetworkDriver.java
(original)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/network/mina/MINANetworkDriver.java
Fri Jan 21 15:55:44 2011
@@ -83,6 +83,14 @@ public class MINANetworkDriver extends I
 
     private static final Logger _logger = LoggerFactory.getLogger(MINANetworkDriver.class);
 
+    static
+    {
+        org.apache.mina.common.ByteBuffer.setUseDirectBuffers(Boolean.getBoolean("amqj.enableDirectBuffers"));
+
+        //override the MINA defaults to prevent use of the PooledByteBufferAllocator 
+        org.apache.mina.common.ByteBuffer.setAllocator(new SimpleByteBufferAllocator());
+    }
+
     public MINANetworkDriver(boolean useNIO, int processors, boolean executorPool, boolean
protectIO)
     {
         _useNIO = useNIO;
@@ -209,14 +217,6 @@ public class MINANetworkDriver extends I
                                                                                  // connector
         }
 
-        org.apache.mina.common.ByteBuffer.setUseDirectBuffers(Boolean.getBoolean("amqj.enableDirectBuffers"));
-        // the MINA default is currently to use the pooled allocator although this may change
in future
-        // once more testing of the performance of the simple allocator has been done
-        if (!Boolean.getBoolean("amqj.enablePooledAllocator"))
-        {
-            org.apache.mina.common.ByteBuffer.setAllocator(new SimpleByteBufferAllocator());
-        }
-
         SocketConnectorConfig cfg = (SocketConnectorConfig) _socketConnector.getDefaultConfig();
         String s = "";
                     StackTraceElement[] trace = Thread.currentThread().getStackTrace();



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message