qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raj...@apache.org
Subject svn commit: r1211611 - in /qpid/trunk/qpid/java: client/src/main/java/org/apache/qpid/client/AMQBrokerDetails.java common/src/main/java/org/apache/qpid/transport/network/io/IoNetworkTransport.java
Date Wed, 07 Dec 2011 19:33:05 GMT
Author: rajith
Date: Wed Dec  7 19:33:05 2011
New Revision: 1211611

URL: http://svn.apache.org/viewvc?rev=1211611&view=rev
Log:
QPID-3659 Added a method in AMQBrokerDetails to handle boolean
properties which defaults to "True". I also added a log message to
printout the TCP_NODELAY value returned by the sockets getTcpNoDelay()
method as a way of figuring out the exact settings.
(cherry picked from commit d2377ceb08af030e95ccc3d578df2d59ca3933c1)

Modified:
    qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQBrokerDetails.java
    qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoNetworkTransport.java

Modified: qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQBrokerDetails.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQBrokerDetails.java?rev=1211611&r1=1211610&r2=1211611&view=diff
==============================================================================
--- qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQBrokerDetails.java
(original)
+++ qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQBrokerDetails.java
Wed Dec  7 19:33:05 2011
@@ -264,12 +264,26 @@ public class AMQBrokerDetails implements
     
     public boolean getBooleanProperty(String propName)
     {
-        if (_options.containsKey(propName))
-        {
-            return Boolean.parseBoolean(_options.get(propName));
-        }
-
-        return false;
+        return getBooleanProperty(propName, false);
+    }
+    
+    public boolean getBooleanProperty(String propName, boolean defaultValue)
+    {
+    	if (_options.containsKey(propName))
+    	{
+    		if (defaultValue)
+    		{
+    			return !_options.get(propName).equalsIgnoreCase("false");
+    		}
+    		else
+    		{
+    			return Boolean.parseBoolean(_options.get(propName));
+    		}
+    	}
+    	else
+    	{
+    		return defaultValue;
+    	}
     }    
 
     public void setTimeout(long timeout)
@@ -439,7 +453,7 @@ public class AMQBrokerDetails implements
         if (getProperty(BrokerDetails.OPTIONS_TCP_NO_DELAY) != null)
         {
             conSettings.setTcpNodelay(
-                    getBooleanProperty(BrokerDetails.OPTIONS_TCP_NO_DELAY));
+                    getBooleanProperty(BrokerDetails.OPTIONS_TCP_NO_DELAY,true));
         }
 
         return conSettings;

Modified: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoNetworkTransport.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoNetworkTransport.java?rev=1211611&r1=1211610&r2=1211611&view=diff
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoNetworkTransport.java
(original)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoNetworkTransport.java
Wed Dec  7 19:33:05 2011
@@ -60,7 +60,8 @@ public class IoNetworkTransport implemen
 
             LOGGER.debug("SO_RCVBUF : %s", _socket.getReceiveBufferSize());
             LOGGER.debug("SO_SNDBUF : %s", _socket.getSendBufferSize());
-
+            LOGGER.debug("TCP_NODELAY : %s", _socket.getTcpNoDelay());
+            
             InetAddress address = InetAddress.getByName(settings.getHost());
 
             _socket.connect(new InetSocketAddress(address, settings.getPort()));



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


Mime
View raw message