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

Ron Sigal ron_sigal at yahoo.com
Thu Feb 15 23:13:09 EST 2007


  User: rsigal  
  Date: 07/02/15 23:13:09

  Modified:    src/main/org/jboss/remoting  Tag: remoting_2_x
                        LeasePinger.java
  Log:
  JBREM-657: (1) Removed local parameter to stopPing() and removeClient().
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.8.2.9   +43 -46    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.8
  retrieving revision 1.8.2.9
  diff -u -b -r1.8.2.8 -r1.8.2.9
  --- LeasePinger.java	24 Jan 2007 18:53:41 -0000	1.8.2.8
  +++ LeasePinger.java	16 Feb 2007 04:13:09 -0000	1.8.2.9
  @@ -55,7 +55,7 @@
   
      // Public ---------------------------------------------------------------------------------------
   
  -   public synchronized void startPing()
  +   public void startPing()
      {
         if(trace) { log.trace(this + " starting lease timer with ping period of " + pingPeriod); }
   
  @@ -63,7 +63,7 @@
         timer.schedule(timerTask, pingPeriod, pingPeriod);
      }
   
  -   public synchronized void stopPing(boolean local)
  +   public void stopPing()
      {
         if(trace) { log.trace(this + " stopping lease timer"); }
   
  @@ -72,14 +72,14 @@
            timerTask.cancel();
            timerTask = null;
   
  -         if (!local)
  -         {
               try
               {
  -               // sending null for the request map, will indicate to server that is full disconnect
  -               // (for client invoker)
  +            // sending request map with no ClientHolders will indicate to server
  +            // that is full disconnect (for client invoker)
  +            HashMap metadata = new HashMap(1);
  +            metadata.put(ServerInvoker.TIMEOUT, "1000");
                  InvocationRequest ir =
  -                  new InvocationRequest(invokerSessionID, null, "$DISCONNECT$", null, null, null);
  +               new InvocationRequest(invokerSessionID, null, "$DISCONNECT$", metadata, null, null);
                  invoker.invoke(ir);
               }
               catch (Throwable throwable)
  @@ -90,9 +90,8 @@
               }
            }
         }
  -   }
   
  -   public synchronized void addClient(String sessionID, Map configuration, long leasePeriod)
  +   public void addClient(String sessionID, Map configuration, long leasePeriod)
      {
         if (leasePeriod <= 0)
         {
  @@ -121,7 +120,7 @@
         }
      }
   
  -   public synchronized boolean removeClient(String sessionID, boolean local)
  +   public boolean removeClient(String sessionID)
      {
         boolean isLastClientLease = false;
   
  @@ -129,8 +128,6 @@
   
         ClientHolder holder = (ClientHolder)clients.remove(sessionID);
   
  -      if (!local)
  -      {
            if (holder != null)
            {
               // send disconnect for this client
  @@ -138,6 +135,7 @@
               {
                  Map clientMap = new HashMap();
                  clientMap.put(ClientHolder.CLIENT_HOLDER_KEY, holder);
  +            clientMap.put(ServerInvoker.TIMEOUT, "1000");
   
                  InvocationRequest ir = new InvocationRequest(invokerSessionID, null, "$DISCONNECT$",
                                                               clientMap, null, null);
  @@ -156,7 +154,6 @@
               log.warn(this + " tried to remove lease for client with session ID " + sessionID +
                  ", but no such lease was found");
            }
  -      }
   
         if (clients.isEmpty())
         {
  @@ -198,7 +195,7 @@
         return isLastClientLease;
      }
   
  -   public synchronized long getLeasePeriod(String sessionID)
  +   public long getLeasePeriod(String sessionID)
      {
         if (timerTask == null)
         {
  @@ -227,7 +224,7 @@
   
      // Private --------------------------------------------------------------------------------------
   
  -   private synchronized void sendClientPing()
  +   private void sendClientPing()
      {
         try
         {
  
  
  



More information about the jboss-cvs-commits mailing list