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

Ron Sigal ron_sigal at yahoo.com
Tue Aug 7 14:03:47 EDT 2007


  User: rsigal  
  Date: 07/08/07 14:03:47

  Modified:    src/main/org/jboss/remoting  Tag: remoting_2_2_0_GA
                        LeasePinger.java
  Log:
  JBREM-783: (1) Added flag to addClient() to determine if network i/o should be done, and (2) synchronized access to closingClients.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.8.2.12.2.5 +14 -4     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.4
  retrieving revision 1.8.2.12.2.5
  diff -u -b -r1.8.2.12.2.4 -r1.8.2.12.2.5
  --- LeasePinger.java	7 Aug 2007 01:43:40 -0000	1.8.2.12.2.4
  +++ LeasePinger.java	7 Aug 2007 18:03:47 -0000	1.8.2.12.2.5
  @@ -121,7 +121,7 @@
         }
      }
   
  -   public void addClient(String sessionID, Map configuration, long leasePeriod)
  +   public void addClient(String sessionID, Map configuration, long leasePeriod, boolean pingServer)
      {
         if (leasePeriod <= 0)
         {
  @@ -133,6 +133,7 @@
         ClientHolder newClient = new ClientHolder(sessionID, configuration, leasePeriod);
         clients.put(sessionID, newClient);
   
  +      if (pingServer)
         sendClientPing();
   
         // if new client lease period is less than the current ping period, need to refresh to new one
  @@ -207,7 +208,12 @@
            }
   
         }
  +      
  +      synchronized (disconnectLock)
  +      {
         closingClients.put(sessionID, holder);
  +      }
  +      
         return isLastClientLease;
      }
      
  @@ -247,8 +253,11 @@
               
               // closingClients will be empty only after an attempt has been made to
               // disconnect all clients.
  +            synchronized (disconnectLock)
  +            {
               closingClients.remove(sessionID);
            }
  +         }
            else
            {
               log.warn(this + " tried to disconnect client with session ID "
  @@ -398,6 +407,7 @@
               InvocationRequest ir =
                  new InvocationRequest(invokerSessionID, null, "$DISCONNECT$", metadata, null, null);
               invoker.invoke(ir);
  +            if (trace) log.trace(this + " destroyed lease");
            }
         }
         catch (Throwable throwable)
  
  
  



More information about the jboss-cvs-commits mailing list