[jboss-remoting-commits] JBoss Remoting SVN: r6404 - remoting2/branches/2.2/src/main/org/jboss/remoting.

jboss-remoting-commits at lists.jboss.org jboss-remoting-commits at lists.jboss.org
Fri Aug 26 23:28:58 EDT 2011


Author: ron.sigal at jboss.com
Date: 2011-08-26 23:28:58 -0400 (Fri, 26 Aug 2011)
New Revision: 6404

Modified:
   remoting2/branches/2.2/src/main/org/jboss/remoting/Client.java
Log:
JBREM-1297: Added getter for connectionValidatorLock and updated comments in setupClientLease().

Modified: remoting2/branches/2.2/src/main/org/jboss/remoting/Client.java
===================================================================
--- remoting2/branches/2.2/src/main/org/jboss/remoting/Client.java	2011-08-27 03:28:38 UTC (rev 6403)
+++ remoting2/branches/2.2/src/main/org/jboss/remoting/Client.java	2011-08-27 03:28:58 UTC (rev 6404)
@@ -1819,6 +1819,11 @@
       }
    }
    
+   static Object getConnectionValidatorLock()
+   {
+      return connectionValidatorLock;
+   }
+   
    // Protected ------------------------------------------------------------------------------------
 
    // Private --------------------------------------------------------------------------------------
@@ -1955,17 +1960,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);



More information about the jboss-remoting-commits mailing list