[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting ...
Ron Sigal
ron_sigal at yahoo.com
Fri Aug 17 21:05:19 EDT 2007
User: rsigal
Date: 07/08/17 21:05:19
Modified: src/main/org/jboss/remoting Tag:
remoting_2_2_2_experimental
MicroRemoteClientInvoker.java
Log:
JBREM-783: (1) Use static leaseCounter to distinguish LeasePingers; (2) Clients waiting for creation of LeasePinger call LeasePinger.connectClient().
Revision Changes Path
No revision
No revision
1.7.2.14.4.5.2.1 +12 -6 JBossRemoting/src/main/org/jboss/remoting/MicroRemoteClientInvoker.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: MicroRemoteClientInvoker.java
===================================================================
RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/MicroRemoteClientInvoker.java,v
retrieving revision 1.7.2.14.4.5
retrieving revision 1.7.2.14.4.5.2.1
diff -u -b -r1.7.2.14.4.5 -r1.7.2.14.4.5.2.1
--- MicroRemoteClientInvoker.java 14 Aug 2007 06:23:07 -0000 1.7.2.14.4.5
+++ MicroRemoteClientInvoker.java 18 Aug 2007 01:05:19 -0000 1.7.2.14.4.5.2.1
@@ -27,11 +27,12 @@
*
* @author <a href="mailto:jhaynie at vocalocity.net">Jeff Haynie</a>
* @author <a href="mailto:telrod at e2technologies.net">Tom Elrod</a>
- * @version $Revision: 1.7.2.14.4.5 $
+ * @version $Revision: 1.7.2.14.4.5.2.1 $
*/
public abstract class MicroRemoteClientInvoker extends AbstractInvoker implements ClientInvoker
{
private static final Logger log = Logger.getLogger(MicroRemoteClientInvoker.class);
+ private static int leaseCounter;
private boolean trace = log.isTraceEnabled();
protected boolean connected = false;
@@ -423,25 +424,30 @@
}
catch (InterruptedException ignored) {}
- if (leasePinger == null || leasePinger.isStarted())
+ if (leasePinger == null)
return;
if (leasePingerException != null)
throw leasePingerException;
+
+ break;
}
}
}
else
{
leasePingerException = null;
- currentSessionID += "+" + System.currentTimeMillis();
+ synchronized (this)
+ {
+ currentSessionID += "+" + leaseCounter++;
+ }
leasePinger = new LeasePinger(this, currentSessionID);
}
}
- if (pingerIsStarted)
+ if (leasePinger.isStarted())
{
- leasePinger.connectClient(leasePeriod);
+ leasePinger.connectClient(leasePeriod, clientSessionID);
return;
}
@@ -510,7 +516,7 @@
defaultLeasePeriod + ") and will start a new lease pinger."); }
leasePinger.addClient(clientSessionID, configuration, leasePeriod);
- leasePinger.connectClient(leasePeriod);
+ leasePinger.connectClient(leasePeriod, clientSessionID);
leasePinger.startPing();
log.debug(this + " added client with session ID " + clientSessionID + " to the lease pinger");
More information about the jboss-cvs-commits
mailing list