[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting ...

Ron Sigal ron_sigal at yahoo.com
Tue Aug 7 20:13:52 EDT 2007


  User: rsigal  
  Date: 07/08/07 20:13:52

  Modified:    src/main/org/jboss/remoting  Tag: remoting_2_2_0_GA
                        MicroRemoteClientInvoker.java
  Log:
  JBREM-783:  (1) Uses new LeasePinger.connectClient() method; (2) gives each LeasePinger a unique invoker sessionID.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.7.2.14.4.3 +13 -9     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.2
  retrieving revision 1.7.2.14.4.3
  diff -u -b -r1.7.2.14.4.2 -r1.7.2.14.4.3
  --- MicroRemoteClientInvoker.java	7 Aug 2007 18:00:12 -0000	1.7.2.14.4.2
  +++ MicroRemoteClientInvoker.java	8 Aug 2007 00:13:52 -0000	1.7.2.14.4.3
  @@ -27,7 +27,7 @@
    *
    * @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.2 $
  + * @version $Revision: 1.7.2.14.4.3 $
    */
   public abstract class MicroRemoteClientInvoker extends AbstractInvoker implements ClientInvoker
   {
  @@ -392,6 +392,7 @@
         // can call terminateLease() without being blocked.
         
         boolean pingerIsStarted = false;
  +      String currentSessionID = invokerSessionID;
         
         synchronized (clientLeaseLock)
         {
  @@ -404,11 +405,12 @@
               
               if (leasePinger.isStarted())
               {
  +            	leasePinger.addClient(clientSessionID, configuration, leasePeriod);
                  pingerIsStarted = true;
               }
               else
               {
  -               leasePinger.addClient(clientSessionID, configuration, leasePeriod, false);
  +               leasePinger.addClient(clientSessionID, configuration, leasePeriod);
                  log.debug(this + " added client with session ID " + clientSessionID + " to the lease pinger");
    
                  while (true)
  @@ -430,19 +432,19 @@
            else
            {
               leasePingerException = null;
  -            leasePinger = new LeasePinger(this, invokerSessionID);
  +            currentSessionID += "+" + System.currentTimeMillis();
  +            leasePinger = new LeasePinger(this, currentSessionID);
            }
         }
         
         if (pingerIsStarted)
         {
  -         leasePinger.addClient(clientSessionID, configuration, leasePeriod, true);
  -         log.debug(this + " added client with session ID " + clientSessionID + " to the lease pinger");
  +         leasePinger.connectClient(leasePeriod);
            return;
         }
         
         InvocationRequest ir =
  -         new InvocationRequest(invokerSessionID, null, "$PING$", null, new HashMap(), null);
  +         new InvocationRequest(currentSessionID, null, "$PING$", null, new HashMap(), null);
         
         int clientCount;
         int attemptCount = 0;
  @@ -506,11 +508,13 @@
                     if(trace) { log.trace("server does have leasing enabled (with default lease period of " +
                           defaultLeasePeriod + ") and will start a new lease pinger."); }
   
  -                  leasePinger.addClient(clientSessionID, configuration, leasePeriod, true);
  +                  leasePinger.addClient(clientSessionID, configuration, leasePeriod);
  +                  leasePinger.connectClient(leasePeriod);
  +                  leasePinger.startPing();
  +                  log.debug(this + " added client with session ID " + clientSessionID + " to the lease pinger");
                     
                     synchronized (clientLeaseLock)
                     {
  -                     leasePinger.startPing();
                        clientLeaseLock.notifyAll();
                        return;
                     }
  
  
  



More information about the jboss-cvs-commits mailing list