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

Manik Surtani manik at jboss.org
Thu Jul 19 08:54:05 EDT 2007


  User: msurtani
  Date: 07/07/19 08:54:05

  Modified:    src/org/jboss/cache/util  CachePrinter.java
  Log:
  pretty-print interceptor chains
  
  Revision  Changes    Path
  1.2       +19 -0     JBossCache/src/org/jboss/cache/util/CachePrinter.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CachePrinter.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/util/CachePrinter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- CachePrinter.java	24 May 2007 18:13:59 -0000	1.1
  +++ CachePrinter.java	19 Jul 2007 12:54:05 -0000	1.2
  @@ -2,6 +2,8 @@
   
   import org.jboss.cache.Cache;
   import org.jboss.cache.CacheImpl;
  +import org.jboss.cache.CacheSPI;
  +import org.jboss.cache.interceptors.Interceptor;
   
   /**
    * Helper that prints the contents of a {@link org.jboss.cache.Cache} to a string.
  @@ -36,4 +38,21 @@
         CacheImpl ci = (CacheImpl) c;
         return ci.printLockInfo();
      }
  +
  +   public static String printCacheInterceptors(CacheSPI<?, ?> cache)
  +   {
  +      StringBuilder b = new StringBuilder();
  +      int index = 0;
  +      b.append("\n");
  +      for (Interceptor i : cache.getInterceptorChain())
  +      {
  +         b.append("# ");
  +         b.append(index);
  +         b.append(" : ");
  +         b.append(i);
  +         b.append("\n");
  +         index++;
  +      }
  +      return b.toString();
  +   }
   }
  
  
  



More information about the jboss-cvs-commits mailing list