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

Manik Surtani msurtani at jboss.com
Wed Jul 19 04:29:18 EDT 2006


  User: msurtani
  Date: 06/07/19 04:29:18

  Modified:    src/org/jboss/cache       CacheSPI.java TreeCache.java
                        TreeCacheMBean.java TreeCacheProxyImpl.java
  Added:       src/org/jboss/cache       RPCManager.java
  Removed:     src/org/jboss/cache       CacheLoader.java
  Log:
  Migration to new CacheLoader interface
  
  Revision  Changes    Path
  1.3       +7 -6      JBossCache/src/org/jboss/cache/CacheSPI.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CacheSPI.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/CacheSPI.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- CacheSPI.java	18 Jul 2006 10:50:46 -0000	1.2
  +++ CacheSPI.java	19 Jul 2006 08:29:18 -0000	1.3
  @@ -57,6 +57,11 @@
       TransactionTable getTransactionTable();
   
       /**
  +     * Gets a handle of the RPC manager
  +     */
  +    RPCManager getRPCManager();
  +
  +    /**
        *
        * @return the local address of this cache in a cluster.  Null if running in local mode.
        */
  @@ -70,12 +75,6 @@
   
       /**
        *
  -     * @return true if the current cache is the coordinator of the cluster.
  -     */
  -    boolean isCoordinator();
  -
  -    /**
  -     *
        * @return the name of the cluster.  Null if running in local mode.
        */
       String getClusterName();
  @@ -100,4 +99,6 @@
        * Gets the service name if this is registered in the MBean server.
        */
       ObjectName getServiceName();
  +
  +    Object getTransactionManager();
   }
  
  
  
  1.202     +27 -30    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.201
  retrieving revision 1.202
  diff -u -b -r1.201 -r1.202
  --- TreeCache.java	18 Jul 2006 20:34:43 -0000	1.201
  +++ TreeCache.java	19 Jul 2006 08:29:18 -0000	1.202
  @@ -18,10 +18,9 @@
   import org.jboss.cache.factories.InterceptorChainFactory;
   import org.jboss.cache.factories.NodeFactory;
   import org.jboss.cache.interceptors.Interceptor;
  -import org.jboss.cache.loader.CacheLoader;
   import org.jboss.cache.loader.CacheLoaderManager;
  -import org.jboss.cache.loader.ExtendedCacheLoader;
   import org.jboss.cache.loader.NodeData;
  +import org.jboss.cache.loader.CacheLoader;
   import org.jboss.cache.lock.IdentityLock;
   import org.jboss.cache.lock.IsolationLevel;
   import org.jboss.cache.lock.LockStrategyFactory;
  @@ -80,7 +79,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.201 2006/07/18 20:34:43 bstansberry Exp $
  + * @version $Id: TreeCache.java,v 1.202 2006/07/19 08:29:18 msurtani Exp $
    *          <p/>
    * @see <a href="http://labs.jboss.com/portal/jbosscache/docs">JBossCache doc</a>
    */
  @@ -100,7 +99,7 @@
      /**
       * Root DataNode.
       */
  -   public DataNode root = NodeFactory.getInstance().createRootDataNode(NodeFactory.NODE_TYPE_TREENODE, this);
  +   protected DataNode root = NodeFactory.getInstance().createRootDataNode(NodeFactory.NODE_TYPE_TREENODE, this);
   
      /**
       * Set of TreeCacheListener.
  @@ -2435,13 +2434,6 @@
         boolean fetchTransientState  = getFetchInMemoryState();
         boolean fetchPersistentState = getFetchPersistentState();
         
  -      if (getFetchPersistentState() && (!getRoot) &&
  -         !((cacheLoaderManager.isExtendedCacheLoader())))
  -      {
  -         throw new UnsupportedOperationException("Cache loader does not support " +
  -               "ExtendedCacheLoader; partial state transfer not supported");
  -      }
  -
         Object owner = getOwnerForLock();
   
         try
  @@ -5149,6 +5141,11 @@
           this.configuration = configuration;
       }
   
  +    public CacheSPI getSPI()
  +    {
  +        return new TreeCacheProxyImpl(this, (NodeImpl) root);
  +    }
  +
       /*-------------------- MessageListener ----------------------*/
   
      class MessageListenerAdaptor implements MessageListener
  
  
  
  1.38      +2 -2      JBossCache/src/org/jboss/cache/TreeCacheMBean.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: TreeCacheMBean.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/TreeCacheMBean.java,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -b -r1.37 -r1.38
  --- TreeCacheMBean.java	18 Jul 2006 10:50:46 -0000	1.37
  +++ TreeCacheMBean.java	19 Jul 2006 08:29:18 -0000	1.38
  @@ -7,10 +7,10 @@
   package org.jboss.cache;
   
   import org.jboss.cache.config.Option;
  -import org.jboss.cache.loader.CacheLoader;
   import org.jboss.cache.marshall.RegionNameConflictException;
   import org.jboss.cache.marshall.RegionNotFoundException;
   import org.jboss.cache.marshall.TreeCacheMarshaller;
  +import org.jboss.cache.loader.CacheLoader;
   import org.jboss.system.ServiceMBean;
   import org.w3c.dom.Element;
   
  @@ -26,7 +26,7 @@
    *
    * @author Bela Ban
    * @author Ben Wang
  - * @version $Id: TreeCacheMBean.java,v 1.37 2006/07/18 10:50:46 msurtani Exp $
  + * @version $Id: TreeCacheMBean.java,v 1.38 2006/07/19 08:29:18 msurtani Exp $
    */
   public interface TreeCacheMBean extends ServiceMBean
   {
  
  
  
  1.3       +10 -0     JBossCache/src/org/jboss/cache/TreeCacheProxyImpl.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: TreeCacheProxyImpl.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/TreeCacheProxyImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- TreeCacheProxyImpl.java	18 Jul 2006 18:28:39 -0000	1.2
  +++ TreeCacheProxyImpl.java	19 Jul 2006 08:29:18 -0000	1.3
  @@ -63,6 +63,11 @@
           return treeCache.getTransactionTable();
       }
   
  +    public RPCManager getRPCManager()
  +    {
  +        return RPCManager.getInstance(treeCache);
  +    }
  +
       public Object getLocalAddress()
       {
           return treeCache.getLocalAddress();
  @@ -93,6 +98,11 @@
           return treeCache.getServiceName();
       }
   
  +    public Object getTransactionManager()
  +    {
  +        return treeCache.getTransactionManager();
  +    }
  +
       public Node getRoot()
       {
           NodeImpl root = treeCache.get(Fqn.ROOT);
  
  
  
  1.1      date: 2006/07/19 08:29:18;  author: msurtani;  state: Exp;JBossCache/src/org/jboss/cache/RPCManager.java
  
  Index: RPCManager.java
  ===================================================================
  /*
   * JBoss, Home of Professional Open Source
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   */
  package org.jboss.cache;
  
  import org.jgroups.Address;
  import org.jgroups.blocks.MethodCall;
  
  import java.util.List;
  
  /**
   * Manager that handles all RPC calls between JBoss Cache instances
   *
   * @author <a href="mailto:manik at jboss.org">Manik Surtani (manik at jboss.org)</a>
   */
  public class RPCManager
  {
      static RPCManager rpcManager;
      TreeCache c;
  
      private RPCManager(TreeCache c)
      {
          this.c = c;
      }
  
      public static RPCManager getInstance(TreeCache c)
      {
          if (rpcManager == null) rpcManager = new RPCManager(c);
          return rpcManager;
      }
  
      // for now, we delegate RPC calls to deprecated methods in TreeCache.
  
      public List callRemoteMethods(List<Address> mbrs, MethodCall methodCall, int mode, boolean excludeSelf, long timeout) throws Exception
      {
          return c.callRemoteMethods(mbrs, methodCall, mode, excludeSelf, timeout);
      }
  
      public boolean isCoordinator()
      {
          return c.isCoordinator();
      }
  
      public Address getCoordinator()
      {
          return c.getCoordinator();
      }
  
      public List callRemoteMethods(List<Address> members, MethodCall methodCall, boolean synchronous, boolean excludeSelf, int timeout) throws Exception
      {
          return c.callRemoteMethods(members, methodCall, synchronous, excludeSelf, timeout);
      }
  }
  
  
  



More information about the jboss-cvs-commits mailing list