[jboss-cvs] JBossCache/src/org/jboss/cache ...

Manik Surtani msurtani at jboss.com
Thu Dec 14 07:21:39 EST 2006


  User: msurtani
  Date: 06/12/14 07:21:39

  Modified:    src/org/jboss/cache  Tag: Branch_JBossCache_1_4_0
                        TreeCache.java
  Log:
  Fixed numLocksHeld
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.195.2.35 +98 -94    JBossCache/src/org/jboss/cache/TreeCache.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: TreeCache.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/TreeCache.java,v
  retrieving revision 1.195.2.34
  retrieving revision 1.195.2.35
  diff -u -b -r1.195.2.34 -r1.195.2.35
  --- TreeCache.java	13 Dec 2006 16:01:47 -0000	1.195.2.34
  +++ TreeCache.java	14 Dec 2006 12:21:39 -0000	1.195.2.35
  @@ -99,7 +99,7 @@
    * @author <a href="mailto:manik at jboss.org">Manik Surtani (manik at jboss.org)</a>
    * @author Brian Stansberry
    * @author Daniel Huang (dhuang at jboss.org)
  - * @version $Id: TreeCache.java,v 1.195.2.34 2006/12/13 16:01:47 msurtani Exp $
  + * @version $Id: TreeCache.java,v 1.195.2.35 2006/12/14 12:21:39 msurtani Exp $
    *          <p/>
    * @see <a href="http://labs.jboss.com/portal/jbosscache/docs">JBossCache doc</a>
    */
  @@ -1501,7 +1501,6 @@
            cacheLoaderManager.preloadCache();
         }
   
  -
         // Find out if we are coordinator (blocks until view is received)
         // TODO should this be moved above the buddy manager code??
         determineCoordinator();
  @@ -1959,11 +1958,11 @@
   
            // Throw the exception on, wrapping if necessary
            if (t instanceof RegionNameConflictException)
  -            throw(RegionNameConflictException) t;
  +            throw (RegionNameConflictException) t;
            else if (t instanceof RegionNotEmptyException)
  -            throw(RegionNotEmptyException) t;
  +            throw (RegionNotEmptyException) t;
            else if (t instanceof CacheException)
  -            throw(CacheException) t;
  +            throw (CacheException) t;
            else
               throw new CacheException(t.getClass().getName() + " " +
                       t.getLocalizedMessage(), t);
  @@ -2109,12 +2108,14 @@
               targets.add(target);
   
               List responses = null;
  -            try {
  +            try
  +            {
                  responses = callRemoteMethods(targets, replPsmc, true,
                       true, sync_repl_timeout);
  -            } catch (Exception t)
  +            }
  +            catch (Exception t)
               {
  -               if(!(t.getCause() instanceof TimeoutException)) throw t;
  +               if (!(t.getCause() instanceof TimeoutException)) throw t;
                                timeoutException = (TimeoutException) t.getCause();
                  timeoutTarget = target;
                  if (trace)
  @@ -4074,7 +4075,8 @@
         Map children;
   
         sb.append("Root lock: ");
  -      if(root.isLocked()) {
  +      if (root.isLocked())
  +      {
            sb.append("\t(");
            root.getLock().toString(sb);
            sb.append(")");
  @@ -4101,20 +4103,20 @@
       */
      public int getNumberOfLocksHeld()
      {
  -      return numLocks(root);
  +      return numLocks((Node) root);
      }
   
  -   private int numLocks(DataNode n)
  +   private int numLocks(Node n)
      {
         int num = 0;
         Map children;
         if (n.isLocked())
            num++;
  -      if ((children = n.getChildren()) != null)
  +      if ((children = n.getChildren(true)) != null)
         {
            for (Iterator it = children.values().iterator(); it.hasNext();)
            {
  -            num += numLocks((DataNode) it.next());
  +            num += numLocks((Node) it.next());
            }
         }
         return num;
  @@ -4195,6 +4197,7 @@
   
       /**
        * Internal method; not to be used externally.
  +    *
        * @param f
        */
       public void realRemove(Fqn f, boolean skipMarkerCheck)
  @@ -4432,7 +4435,6 @@
   
      /* --------------------- Callbacks -------------------------- */
   
  -
      /* ----- These are VERSIONED callbacks to facilitate JBCACHE-843.  Also see docs/design/DataVersion.txt --- */
   
      public void _put(GlobalTransaction tx, Fqn fqn, Map data, boolean create_undo_ops, DataVersion dv) throws CacheException
  @@ -4720,7 +4722,8 @@
         TreeNode parent_node;
         MethodCall undo_op = null;
   
  -      if (log.isTraceEnabled()) log.trace(new StringBuffer("_remove(").append(tx).append(", \"").append(fqn).append("\")"));
  +      if (log.isTraceEnabled())
  +         log.trace(new StringBuffer("_remove(").append(tx).append(", \"").append(fqn).append("\")"));
   
         // check if this is triggered by a rollback operation ...
         if (tx != null)
  @@ -4730,7 +4733,8 @@
               int status = getTransactionManager().getTransaction().getStatus();
               if (status == Status.STATUS_MARKED_ROLLBACK || status == Status.STATUS_ROLLEDBACK || status == Status.STATUS_ROLLING_BACK)
               {
  -               if (log.isDebugEnabled()) log.debug("This remove call is triggered by a transaction rollback, as a compensation operation.  Do a realRemove() instead.");
  +               if (log.isDebugEnabled())
  +                  log.debug("This remove call is triggered by a transaction rollback, as a compensation operation.  Do a realRemove() instead.");
                  realRemove(fqn, true);
                  return;
               }
  @@ -5739,7 +5743,7 @@
         catch (Throwable t)
         {
            if (t instanceof CacheException)
  -            throw(CacheException) t;
  +            throw (CacheException) t;
            throw new RuntimeException(t);
         }
      }
  
  
  



More information about the jboss-cvs-commits mailing list