Author: robbie
Date: Sun Aug 12 16:45:13 2012
New Revision: 1372148

URL: http://svn.apache.org/viewvc?rev=1372148&view=rev
Log:
NO-JIRA: add a system property for configuring the historically hard coded 
timeout value in IoNetworkTransport, remove dead code in ConnectionSettings

Added:
    
qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/configuration/CommonProperties.java
Modified:
    
qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/configuration/ClientProperties.java
    
qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionSettings.java
    
qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoNetworkTransport.java

Modified: 
qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/configuration/ClientProperties.java
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/configuration/ClientProperties.java?rev=1372148&r1=1372147&r2=1372148&view=diff
==============================================================================
--- 
qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/configuration/ClientProperties.java
 (original)
+++ 
qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/configuration/ClientProperties.java
 Sun Aug 12 16:45:13 2012
@@ -20,10 +20,11 @@ package org.apache.qpid.configuration;
 
 /**
  * This class centralized the Qpid client properties.
+ *
+ * @see CommonProperties
  */
 public class ClientProperties
 {
-
     /**
      * Currently with Qpid it is not possible to change the client ID.
      * If one is not specified upon connection construction, an id is 
generated automatically.
@@ -118,10 +119,6 @@ public class ClientProperties
      */
     public static final String REJECT_BEHAVIOUR_PROP_NAME = 
"qpid.reject.behaviour";
 
-    private ClientProperties()
-    {
-    }
-
     /**
      * System property used to set the key manager factory algorithm.
      *
@@ -192,4 +189,10 @@ public class ClientProperties
      * waiting because the client was flow controlled by the broker.
      */
     public static final long DEFAULT_FLOW_CONTROL_WAIT_NOTIFY_PERIOD = 5000L;
+
+
+    private ClientProperties()
+    {
+        //No instances
+    }
 }

Added: 
qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/configuration/CommonProperties.java
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/configuration/CommonProperties.java?rev=1372148&view=auto
==============================================================================
--- 
qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/configuration/CommonProperties.java
 (added)
+++ 
qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/configuration/CommonProperties.java
 Sun Aug 12 16:45:13 2012
@@ -0,0 +1,41 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.configuration;
+
+/**
+ * Centralised record of Qpid common properties.
+ *
+ * @see ClientProperties
+ */
+public class CommonProperties
+{
+    /**
+     * The timeout used by the IO layer for timeouts such as send timeout in 
IoSender, and the close timeout for IoSender and IoReceiver
+     */
+    public static final String IO_NETWORK_TRANSPORT_TIMEOUT_PROP_NAME = 
"qpid.io_network_transport_timeout";
+    public static final int IO_NETWORK_TRANSPORT_TIMEOUT_DEFAULT = 60000;
+
+
+    private CommonProperties()
+    {
+        //no instances
+    }
+}

Modified: 
qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionSettings.java
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionSettings.java?rev=1372148&r1=1372147&r2=1372148&view=diff
==============================================================================
--- 
qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionSettings.java
 (original)
+++ 
qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionSettings.java
 Sun Aug 12 16:45:13 2012
@@ -63,7 +63,6 @@ public class ConnectionSettings
     private int connectTimeout = 30000;
     private int readBufferSize = QpidProperty.intProperty(65535, 
RECEIVE_BUFFER_SIZE_PROP_NAME, LEGACY_RECEIVE_BUFFER_SIZE_PROP_NAME).get();
     private int writeBufferSize = QpidProperty.intProperty(65535, 
SEND_BUFFER_SIZE_PROP_NAME, LEGACY_SEND_BUFFER_SIZE_PROP_NAME).get();;
-    private long transportTimeout = 60000;
 
     // SSL props
     private boolean useSSL;
@@ -375,14 +374,4 @@ public class ConnectionSettings
     {
         this.writeBufferSize = writeBufferSize;
     }
-    
-    public long getTransportTimeout()
-    {
-        return transportTimeout;
-    }
-
-    public void setTransportTimeout(long transportTimeout)
-    {
-        this.transportTimeout = transportTimeout;
-    }
 }

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=1372148&r1=1372147&r2=1372148&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
 Sun Aug 12 16:45:13 2012
@@ -33,6 +33,8 @@ import javax.net.ssl.SSLPeerUnverifiedEx
 import javax.net.ssl.SSLServerSocket;
 import javax.net.ssl.SSLServerSocketFactory;
 import javax.net.ssl.SSLSocket;
+
+import org.apache.qpid.configuration.CommonProperties;
 import org.apache.qpid.protocol.ProtocolEngine;
 import org.apache.qpid.protocol.ProtocolEngineFactory;
 import org.apache.qpid.transport.ConnectionSettings;
@@ -47,7 +49,8 @@ import org.slf4j.LoggerFactory;
 public class IoNetworkTransport implements OutgoingNetworkTransport, 
IncomingNetworkTransport
 {
     private static final org.slf4j.Logger LOGGER = 
LoggerFactory.getLogger(IoNetworkTransport.class);
-    private static final int TIMEOUT = 60000;
+    private static final int TIMEOUT = 
Integer.getInteger(CommonProperties.IO_NETWORK_TRANSPORT_TIMEOUT_PROP_NAME,
+                                                              
CommonProperties.IO_NETWORK_TRANSPORT_TIMEOUT_DEFAULT);
 
     private Socket _socket;
     private IoNetworkConnection _connection;



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

Reply via email to