The useInactivityMonitor option can now be used to disable configuring a inactivity montior on the transport.

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@754963 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2009-03-16 17:22:40 +00:00
parent b41e1a7579
commit 6e989edaa1
1 changed files with 10 additions and 1 deletions

View File

@ -96,7 +96,8 @@ public class TcpTransportFactory extends TransportFactory {
} }
} }
if (isUseInactivityMonitor(transport)) { boolean useInactivityMonitor = "true".equals(getOption(options, "useInactivityMonitor", "true"));
if (useInactivityMonitor && isUseInactivityMonitor(transport)) {
transport = new InactivityMonitor(transport, format); transport = new InactivityMonitor(transport, format);
} }
@ -108,6 +109,14 @@ public class TcpTransportFactory extends TransportFactory {
return transport; return transport;
} }
private String getOption(Map options, String key, String def) {
String rc = (String) options.remove(key);
if( rc == null ) {
rc = def;
}
return rc;
}
/** /**
* Returns true if the inactivity monitor should be used on the transport * Returns true if the inactivity monitor should be used on the transport
*/ */