[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting ...
Ron Sigal
ron_sigal at yahoo.com
Sun Feb 25 16:18:47 EST 2007
User: rsigal
Date: 07/02/25 16:18:47
Modified: src/main/org/jboss/remoting Tag: remoting_2_x
LeasePinger.java
Log:
JBREM-657: Avoid network i/o if disconnectTimeout == 0.
Revision Changes Path
No revision
No revision
1.8.2.11 +23 -14 JBossRemoting/src/main/org/jboss/remoting/LeasePinger.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: LeasePinger.java
===================================================================
RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/LeasePinger.java,v
retrieving revision 1.8.2.10
retrieving revision 1.8.2.11
diff -u -b -r1.8.2.10 -r1.8.2.11
--- LeasePinger.java 21 Feb 2007 10:56:52 -0000 1.8.2.10
+++ LeasePinger.java 25 Feb 2007 21:18:47 -0000 1.8.2.11
@@ -79,7 +79,11 @@
// sending request map with no ClientHolders will indicate to server
// that is full disconnect (for client invoker)
HashMap metadata = null;
- if (disconnectTimeout >= 0)
+
+ // If disconnectTimeout == 0, skip network i/o.
+ if (disconnectTimeout != 0)
+ {
+ if (disconnectTimeout > 0)
{
metadata = new HashMap(1);
metadata.put(ServerInvoker.TIMEOUT, Integer.toString(disconnectTimeout));
@@ -88,6 +92,7 @@
new InvocationRequest(invokerSessionID, null, "$DISCONNECT$", metadata, null, null);
invoker.invoke(ir);
}
+ }
catch (Throwable throwable)
{
RuntimeException e = new RuntimeException("Error tearing down lease with server.");
@@ -142,7 +147,10 @@
Map clientMap = new HashMap();
clientMap.put(ClientHolder.CLIENT_HOLDER_KEY, holder);
- if (disconnectTimeout >= 0)
+ // If disconnectTimeout == 0, skip network i/o.
+ if (disconnectTimeout != 0)
+ {
+ if (disconnectTimeout > 0)
clientMap.put(ServerInvoker.TIMEOUT, Integer.toString(disconnectTimeout));
InvocationRequest ir = new InvocationRequest(invokerSessionID, null, "$DISCONNECT$",
@@ -151,6 +159,7 @@
if(trace) { log.trace(this + " sent out disconnect message to server for lease tied to client with session ID " + sessionID); }
}
+ }
catch (Throwable throwable)
{
log.warn(this + " failed sending disconnect for client lease for " +
More information about the jboss-cvs-commits
mailing list