Author: ron.sigal(a)jboss.com
Date: 2011-08-26 23:18:00 -0400 (Fri, 26 Aug 2011)
New Revision: 6401
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/Client.java
Log:
JBREM-1297: Added getter for connectionValidatorLock and updated comments in
setupClientLease().
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/Client.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/Client.java 2011-08-15 04:12:10 UTC
(rev 6400)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/Client.java 2011-08-27 03:18:00 UTC
(rev 6401)
@@ -1904,6 +1904,12 @@
}
}
+
+ static Object getConnectionValidatorLock()
+ {
+ return connectionValidatorLock;
+ }
+
// Protected
------------------------------------------------------------------------------------
// Private
--------------------------------------------------------------------------------------
@@ -2040,17 +2046,25 @@
//
// 1. a. This method calls MicroRemoteClientInvoker.establishLease()
// b. MicroRemoteClientInvoker.establishLease() synchronizes on
MicroRemoteClientInvoker.clientLeaseLock
- // and calls Client.addConnectionListener()
- // c. Client.addConnectionListener() synchronizes on
Client.connectionValidatorLock
+ // c. MicroRemoteClientInvoker.establishLease() calls
Client.addConnectionListener()
+ // d. Client.addConnectionListener() synchronizes on
Client.connectionValidatorLock
//
- // 2. a. Client.addConnectionListener() synchronizes on
Client.connectionValidatorLock and calls
- // new ConnectionValidator()
- // b. new ConnectionValidator() calls
MicroRemoteClientInvoker.getLeasePinger(), which
- // synchronizes on MicroRemoteClientInvoker.clientLeaseLock
+ // 2. a. Client.addConnectionListener() synchronizes on
Client.connectionValidatorLock
+ // b. Client.addConnectionListener() calls new ConnectionValidator()
+ // c. new ConnectionValidator() calls
MicroRemoteClientInvoker.getLeasePinger()
+ // d. MicroRemoteClientInvoker.getLeasePinger() synchronizes on
MicroRemoteClientInvoker.clientLeaseLock
//
- // By synchronizing on connectionValidatorLock here, we assure that both
sequences acquire
+ // 3. a. ConnectionValidator$WaitOnConnectionCheckTimerTask.run() synchronizes
on Client.connectionValidatorLock
+ // b. ConnectionValidator$WaitOnConnectionCheckTimerTask.run() calls
MicroRemoteClientInvoker.terminateLease()
+ // c. MicroRemoteClientInvoker.terminateLease() synchronizes on
MicroRemoteClientInvoker.clientLeaseLock
+ // d. MicroRemoteClientInvoker.terminateLease() calls LeasePinger.stopPing()
+ // e. LeasePinger.stopPing() calls Client.notifyListeners()
+ // f. Client.notifyListeners() synchronizes on
Client.connectionValidatorLock
+ //
+ // By synchronizing on connectionValidatorLock here, we assure that all
sequences acquire
// Client.connectionValidatorLock first and then acquire
MicroRemoteClientInvoker.clientLeaseLock.
//
+ // See JBREM-1242 and JBREM-1297.
synchronized(connectionValidatorLock)
{
invoker.establishLease(sessionId, temp, leasePeriod);
Show replies by date