[jboss-cvs] JBossCache/src/org/jboss/cache/jmx  ...
    Ben Wang 
    bwang at jboss.com
       
    Mon Sep 25 01:50:04 EDT 2006
    
    
  
  User: bwang   
  Date: 06/09/25 01:50:04
  Modified:    src/org/jboss/cache/jmx  JmxUtil.java
  Log:
  1. Modify useInterceptorMbeans to useMbean
  2. Added PojoCache jmx framework 
  3. added test
  
  Revision  Changes    Path
  1.2       +18 -17    JBossCache/src/org/jboss/cache/jmx/JmxUtil.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: JmxUtil.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/jmx/JmxUtil.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- JmxUtil.java	7 Sep 2006 13:52:28 -0000	1.1
  +++ JmxUtil.java	25 Sep 2006 05:50:04 -0000	1.2
  @@ -35,7 +35,7 @@
    *
    * @author Jerry Gauthier
    * @author Manik Surtani
  - * @version $Id: JmxUtil.java,v 1.1 2006/09/07 13:52:28 msurtani Exp $
  + * @version $Id: JmxUtil.java,v 1.2 2006/09/25 05:50:04 bwang Exp $
    */
   public class JmxUtil
   {
  @@ -60,14 +60,8 @@
         List interceptors = cache.getInterceptors();
         Interceptor interceptor = null;
   
  -      // get the cache's registration name
  -      String tmpName = cache.getConfiguration().getServiceName();
  -      if (tmpName == null)
  -      {
  -         tmpName = PREFIX + cache.getConfiguration().getClusterName();
  -         if (cache.getConfiguration().getClusterName() == null)
  -            tmpName = PREFIX + cache.getClass().getName() + System.currentTimeMillis();
  -      }
  +      String tmpName = getCacheObjectName(cache.getCacheSPI());
  +
         // register the cache
         if (registerCache)
         {
  @@ -109,6 +103,20 @@
         }
      }
   
  +   public static String getCacheObjectName(org.jboss.cache.CacheSPI cache)
  +   {
  +      // get the cache's registration name
  +      String tmpName = cache.getConfiguration().getServiceName();
  +      if (tmpName == null)
  +      {
  +         tmpName = PREFIX + cache.getConfiguration().getClusterName();
  +         if (cache.getConfiguration().getClusterName() == null)
  +            tmpName = PREFIX + cache.getClass().getName() + System.currentTimeMillis();
  +      }
  +
  +      return tmpName;
  +   }
  +
      /*
      * Unregister the associated mbeans for cache interceptors
      *
  @@ -125,14 +133,7 @@
         List interceptors = cache.getInterceptors();
         Interceptor interceptor = null;
   
  -      // get the cache's registration name
  -      String tmpName = cache.getConfiguration().getServiceName();
  -      if (tmpName == null)
  -      {
  -         tmpName = PREFIX + cache.getConfiguration().getClusterName();
  -         if (cache.getConfiguration().getClusterName() == null)
  -            tmpName = PREFIX + cache.getClass().getName() + System.currentTimeMillis();
  -      }
  +      String tmpName = getCacheObjectName(cache.getCacheSPI());
   
         for (int i = 0; i < interceptors.size(); i++)
         {
  
  
  
    
    
More information about the jboss-cvs-commits
mailing list