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

Manik Surtani msurtani at jboss.com
Sat Dec 30 12:49:59 EST 2006


  User: msurtani
  Date: 06/12/30 12:49:59

  Modified:    src/org/jboss/cache/jmx    CacheJmxWrapper.java
                        CacheLegacyJmxWrapperMBean.java Cache.java
  Log:
  Major changes to restructure cache and node object model
  
  Revision  Changes    Path
  1.9       +45 -54    JBossCache/src/org/jboss/cache/jmx/CacheJmxWrapper.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CacheJmxWrapper.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/jmx/CacheJmxWrapper.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -b -r1.8 -r1.9
  --- CacheJmxWrapper.java	16 Nov 2006 21:14:42 -0000	1.8
  +++ CacheJmxWrapper.java	30 Dec 2006 17:49:58 -0000	1.9
  @@ -24,21 +24,14 @@
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   import org.jboss.cache.Cache;
  -import org.jboss.cache.TreeCacheProxyImpl;
  +import org.jboss.cache.CacheImpl;
   import org.jboss.cache.config.Configuration;
   import org.jboss.cache.config.ConfigurationException;
   import org.jboss.cache.factories.DefaultCacheFactory;
  -import org.jboss.cache.interceptors.CacheMgmtInterceptor;
  -import org.jboss.cache.interceptors.Interceptor;
   
  -import javax.management.ListenerNotFoundException;
  -import javax.management.MBeanNotificationInfo;
   import javax.management.MBeanRegistration;
   import javax.management.MBeanServer;
   import javax.management.MalformedObjectNameException;
  -import javax.management.NotificationBroadcaster;
  -import javax.management.NotificationFilter;
  -import javax.management.NotificationListener;
   import javax.management.ObjectName;
   
   public class CacheJmxWrapper 
  @@ -47,7 +40,7 @@
      private Log log = LogFactory.getLog(getClass().getName());
      
      private boolean registerInterceptors = true;
  -   private TreeCacheProxyImpl tcpi;
  +   private CacheImpl tcpi;
      private Configuration config;
      private MBeanServer server;
      private String cacheObjectName;
  @@ -75,7 +68,7 @@
   
      public String printCacheDetails()
      {
  -      return tcpi == null ? null : tcpi.treeCache.printDetails();
  +      return tcpi == null ? null : tcpi.printDetails();
      }
   
      public void create() throws Exception
  @@ -129,7 +122,6 @@
   
      /**
       * Caches the provided <code>server</code> and <code>objName</code>.
  -    *  
       */
      public ObjectName preRegister(MBeanServer server, ObjectName objName) 
            throws Exception
  @@ -205,7 +197,6 @@
       * Sets the configuration that the underlying cache should use.
       * 
       * @param config the configuration
  -    * 
       * @throws IllegalArgumentException if <code>config</code> is <code>null</code>.
       */
      public void setConfiguration(Configuration config)
  @@ -224,7 +215,7 @@
            throw new IllegalStateException("Cannot set underlying cache after call to create()");
         
         // FIXME -- the only reason we need to cast here is to support printCacheDetails 
  -      this.tcpi = (TreeCacheProxyImpl) cache;
  +      this.tcpi = (CacheImpl) cache;
         this.config = (tcpi == null ? null : tcpi.getConfiguration());
      }
      
  @@ -232,7 +223,7 @@
      {
         if (cacheObjectName == null)
         {
  -         cacheObjectName = JmxUtil.getCacheObjectName(config, TreeCacheProxyImpl.class.getName());
  +         cacheObjectName = JmxUtil.getCacheObjectName(config, CacheImpl.class.getName());
         }
         return cacheObjectName;
      }
  @@ -310,7 +301,7 @@
   //
   //   private CacheMgmtInterceptor getCacheMgmtInterceptor()
   //   {
  -//      for (Interceptor i : tcpi.treeCache.getInterceptors())
  +//      for (Interceptor i : tcpi.cache.getInterceptors())
   //      {
   //         if (i instanceof CacheMgmtInterceptor) return (CacheMgmtInterceptor) i;
   //      }
  
  
  
  1.3       +22 -22    JBossCache/src/org/jboss/cache/jmx/CacheLegacyJmxWrapperMBean.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CacheLegacyJmxWrapperMBean.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/jmx/CacheLegacyJmxWrapperMBean.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- CacheLegacyJmxWrapperMBean.java	16 Nov 2006 05:19:29 -0000	1.2
  +++ CacheLegacyJmxWrapperMBean.java	30 Dec 2006 17:49:58 -0000	1.3
  @@ -21,21 +21,18 @@
    */
   package org.jboss.cache.jmx;
   
  -import javax.transaction.TransactionManager;
  -
  +import org.jboss.cache.CacheImpl;
   import org.jboss.cache.Region;
  -import org.jboss.cache.TreeCache;
  -import org.jboss.cache.config.BuddyReplicationConfig;
  -import org.jboss.cache.config.CacheLoaderConfig;
  -import org.jboss.cache.config.EvictionConfig;
   import org.jgroups.jmx.JChannelFactoryMBean;
   import org.w3c.dom.Element;
   
  +import javax.transaction.TransactionManager;
  +
   /**
    * StandardMBean interface for {@link CacheLegacyJmxWrapper}.
    * 
    * @author <a href="brian.stansberry at jboss.com">Brian Stansberry</a>
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
   public interface CacheLegacyJmxWrapperMBean extends CacheJmxWrapperMBean
   {
  @@ -51,7 +48,7 @@
   
      /**
       * Sets whether marshalling uses scoped class loaders on a per region basis.
  -    * <p />
  +    * <p/>
       * This property must be set to <code>true</code> before any call to
       * {@link Region#registerContextClassLoader(ClassLoader)}.
       *
  @@ -190,9 +187,9 @@
       * transfer or a call to {@link Region#activate()}.  Different
       * releases of JBossCache may format this data differently; this property
       * identifies the format version being used by this cache instance.
  -    * <p>
  +    * <p/>
       * The default value for this property is
  -    * {@link TreeCache#DEFAULT_REPLICATION_VERSION}.
  +    * {@link CacheImpl#DEFAULT_REPLICATION_VERSION}.
       * </p>
       *
       * @return    a short identifying JBossCache release; e.g. <code>124</code>
  @@ -260,27 +257,29 @@
       * Sets whether the entire tree is inactive upon startup, only responding
       * to replication messages after {@link Region#activate()} is
       * called to activate one or more parts of the tree.
  -    * <p>
  +    * <p/>
       * This property is only relevant if {@link #getUseMarshalling()} is
       * <code>true</code>.
  -    *
       */
      void setInactiveOnStartup(boolean inactiveOnStartup);
   
      /**
       * Sets the buddy replication configuration element
  +    *
       * @param config
       */
      void setBuddyReplicationConfig(Element config);
   
      /**
       * Retrieves the buddy replication cofiguration element
  +    *
       * @return config
       */
      Element getBuddyReplicationConfig();
   
      /**
       * Retrieves the JGroups multiplexer service name if defined.
  +    *
       * @return the multiplexer service name
       */
      String getMultiplexerService();
  @@ -295,6 +294,7 @@
   
      /**
       * Retrieves the JGroups multiplexer stack name if defined.
  +    *
       * @return the multiplexer stack name
       */
      String getMultiplexerStack();
  
  
  
  1.6       +9 -9      JBossCache/src/org/jboss/cache/jmx/Cache.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Cache.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/jmx/Cache.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- Cache.java	16 Nov 2006 21:14:42 -0000	1.5
  +++ Cache.java	30 Dec 2006 17:49:58 -0000	1.6
  @@ -1,16 +1,16 @@
   package org.jboss.cache.jmx;
   
  +import org.jboss.cache.CacheImpl;
   import org.jboss.cache.CacheSPI;
  -import org.jboss.cache.TreeCacheProxyImpl;
  +import org.jboss.cache.config.Configuration;
   import org.jboss.cache.interceptors.CacheMgmtInterceptor;
   import org.jboss.cache.interceptors.Interceptor;
  -import org.jboss.cache.config.Configuration;
   
  -import javax.management.NotificationBroadcaster;
  -import javax.management.NotificationListener;
  -import javax.management.NotificationFilter;
   import javax.management.ListenerNotFoundException;
   import javax.management.MBeanNotificationInfo;
  +import javax.management.NotificationBroadcaster;
  +import javax.management.NotificationFilter;
  +import javax.management.NotificationListener;
   
   /**
    * JMX object that operates on the cache
  @@ -19,11 +19,11 @@
    */
   public class Cache implements CacheMBean, NotificationBroadcaster
   {
  -   TreeCacheProxyImpl tcpi;
  +   private CacheImpl tcpi;
   
      public Cache(CacheSPI cacheSPI)
      {
  -      tcpi = (TreeCacheProxyImpl) cacheSPI;
  +      tcpi = (CacheImpl) cacheSPI;
      }
   
      public org.jboss.cache.Cache getCache()
  @@ -58,7 +58,7 @@
   
      public String printCacheDetails()
      {
  -      return tcpi.treeCache.printDetails();
  +      return tcpi.printDetails();
      }
   
      public void addNotificationListener(NotificationListener notificationListener, NotificationFilter notificationFilter, Object object) throws IllegalArgumentException
  @@ -78,7 +78,7 @@
   
      private CacheMgmtInterceptor getCacheMgmtInterceptor()
      {
  -      for (Interceptor i : tcpi.treeCache.getInterceptors())
  +      for (Interceptor i : tcpi.getInterceptors())
         {
            if (i instanceof CacheMgmtInterceptor) return (CacheMgmtInterceptor) i;
         }
  
  
  



More information about the jboss-cvs-commits mailing list