activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r776743 - in /activemq/trunk/activemq-core/src: main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java test/java/org/apache/activemq/transport/tcp/WireformatNegociationTest.java
Date Wed, 20 May 2009 15:49:47 GMT
Author: gtully
Date: Wed May 20 15:49:47 2009
New Revision: 776743

URL: http://svn.apache.org/viewvc?rev=776743&view=rev
Log:
allow configuring the wireformat maxInactivityDurationInitalDelay

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/WireformatNegociationTest.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java?rev=776743&r1=776742&r2=776743&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java
Wed May 20 15:49:47 2009
@@ -67,6 +67,7 @@
     protected WireFormatFactory wireFormatFactory = new OpenWireFormatFactory();
     protected final TcpTransportFactory transportFactory;
     protected long maxInactivityDuration = 30000;
+    protected long maxInactivityDurationInitalDelay = 10000;
     protected int minmumWireFormatVersion;
     protected boolean useQueueForAccept=true;
        
@@ -190,6 +191,14 @@
     public void setMaxInactivityDuration(long maxInactivityDuration) {
         this.maxInactivityDuration = maxInactivityDuration;
     }
+    
+    public long getMaxInactivityDurationInitalDelay() {
+        return this.maxInactivityDurationInitalDelay;
+    }
+
+    public void setMaxInactivityDurationInitalDelay(long maxInactivityDurationInitalDelay)
{
+        this.maxInactivityDurationInitalDelay = maxInactivityDurationInitalDelay;
+    }
 
     public int getMinmumWireFormatVersion() {
         return minmumWireFormatVersion;
@@ -390,6 +399,8 @@
             HashMap<String, Object> options = new HashMap<String, Object>();
             options.put("maxInactivityDuration", Long
                     .valueOf(maxInactivityDuration));
+            options.put("maxInactivityDurationInitalDelay", Long
+                    .valueOf(maxInactivityDurationInitalDelay));            
             options.put("minmumWireFormatVersion", Integer
                     .valueOf(minmumWireFormatVersion));
             options.put("trace", Boolean.valueOf(trace));

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/WireformatNegociationTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/WireformatNegociationTest.java?rev=776743&r1=776742&r2=776743&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/WireformatNegociationTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/WireformatNegociationTest.java
Wed May 20 15:49:47 2009
@@ -202,5 +202,20 @@
         assertNotNull(serverWF.get());
         assertEquals(CommandTypes.PROTOCOL_VERSION, serverWF.get().getVersion());
     }
+    
+    public void testWireFomatInactivityDurationInitalDelay() throws Exception {
+
+        startServer("tcp://localhost:61616");
+        startClient("tcp://localhost:61616?wireFormat.maxInactivityDurationInitalDelay=60000");
+
+        assertTrue("Connect timeout", negociationCounter.await(10, TimeUnit.SECONDS));
+        assertNull("Async error: " + asyncError, asyncError.get());
+
+        assertNotNull(clientWF.get());
+        assertEquals(5, clientWF.get().getVersion());
+
+        assertNotNull(serverWF.get());
+        assertEquals(5, serverWF.get().getVersion());
+    }
 
 }



Mime
View raw message