allow configuring the wireformat maxInactivityDurationInitalDelay

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@776743 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Tully 2009-05-20 15:49:47 +00:00
parent 120d1d457a
commit f7cba2a28e
2 changed files with 26 additions and 0 deletions

View File

@ -67,6 +67,7 @@ public class TcpTransportServer extends TransportServerThreadSupport implements
protected WireFormatFactory wireFormatFactory = new OpenWireFormatFactory();
protected final TcpTransportFactory transportFactory;
protected long maxInactivityDuration = 30000;
protected long maxInactivityDurationInitalDelay = 10000;
protected int minmumWireFormatVersion;
protected boolean useQueueForAccept=true;
@ -191,6 +192,14 @@ public class TcpTransportServer extends TransportServerThreadSupport implements
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 @@ public class TcpTransportServer extends TransportServerThreadSupport implements
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));

View File

@ -203,4 +203,19 @@ public class WireformatNegociationTest extends CombinationTestSupport {
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());
}
}