[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting ...
Ron Sigal
ron_sigal at yahoo.com
Tue Aug 7 20:10:24 EDT 2007
User: rsigal
Date: 07/08/07 20:10:24
Modified: src/main/org/jboss/remoting Tag: remoting_2_2_0_GA
LeasePinger.java
Log:
JBREM-783: Moved network i/o from addClient() to new method connectClient().
Revision Changes Path
No revision
No revision
1.8.2.12.2.6 +29 -25 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.12.2.5
retrieving revision 1.8.2.12.2.6
diff -u -b -r1.8.2.12.2.5 -r1.8.2.12.2.6
--- LeasePinger.java 7 Aug 2007 18:03:47 -0000 1.8.2.12.2.5
+++ LeasePinger.java 8 Aug 2007 00:10:23 -0000 1.8.2.12.2.6
@@ -113,15 +113,9 @@
// that two or more threads try to contact the server.)
stopping = true;
-
- if (timerTask != null)
- {
- timerTask.cancel();
- timerTask = null;
- }
}
- public void addClient(String sessionID, Map configuration, long leasePeriod, boolean pingServer)
+ public void addClient(String sessionID, Map configuration, long leasePeriod)
{
if (leasePeriod <= 0)
{
@@ -132,10 +126,10 @@
ClientHolder newClient = new ClientHolder(sessionID, configuration, leasePeriod);
clients.put(sessionID, newClient);
+ }
- if (pingServer)
- sendClientPing();
-
+ public void connectClient(long leasePeriod)
+ {
// if new client lease period is less than the current ping period, need to refresh to new one
if (leasePeriod < pingPeriod)
{
@@ -149,6 +143,8 @@
startPing();
}
}
+
+ sendClientPing();
}
public boolean removeClient(String sessionID)
@@ -237,6 +233,7 @@
if (disconnectTimeout > 0)
clientMap.put(ServerInvoker.TIMEOUT, Integer.toString(disconnectTimeout));
+ if (trace) log.trace(this + " requesting client lease disconnect: " + invokerSessionID);
InvocationRequest ir = new InvocationRequest(invokerSessionID, null, "$DISCONNECT$",
clientMap, null, null);
try
@@ -389,6 +386,12 @@
{
if(trace) { log.trace(this + " destroying lease"); }
+ if (timerTask != null)
+ {
+ timerTask.cancel();
+ timerTask = null;
+ }
+
try
{
// sending request map with no ClientHolders will indicate to server
@@ -404,6 +407,7 @@
metadata.put(ServerInvoker.TIMEOUT, Integer.toString(disconnectTimeout));
}
+ if (trace) log.trace("requesting invoker lease disconnect: " + invokerSessionID);
InvocationRequest ir =
new InvocationRequest(invokerSessionID, null, "$DISCONNECT$", metadata, null, null);
invoker.invoke(ir);
More information about the jboss-cvs-commits
mailing list