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

Manik Surtani msurtani at belmont.prod.atl2.jboss.com
Tue Aug 29 13:50:14 EDT 2006


  User: msurtani
  Date: 06/08/29 13:50:14

  Modified:    src/org/jboss/cache    InvocationContext.java
                        RPCManager.java TreeCache.java
  Log:
  Fixed RPCManager scoping issues
  
  Revision  Changes    Path
  1.10      +35 -0     JBossCache/src/org/jboss/cache/InvocationContext.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: InvocationContext.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/InvocationContext.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -b -r1.9 -r1.10
  --- InvocationContext.java	29 Aug 2006 16:35:52 -0000	1.9
  +++ InvocationContext.java	29 Aug 2006 17:50:14 -0000	1.10
  @@ -185,4 +185,39 @@
         this.setTransaction(template.getTransaction());
         this.setTxHasMods(template.isTxHasMods());
      }
  +
  +   public boolean equals(Object o)
  +   {
  +      if (this == o) return true;
  +      if (o == null || getClass() != o.getClass()) return false;
  +
  +      final InvocationContext that = (InvocationContext) o;
  +
  +      if (localRollbackOnly != that.localRollbackOnly) return false;
  +      if (originLocal != that.originLocal) return false;
  +      if (txHasMods != that.txHasMods) return false;
  +      if (globalTransaction != null ? !globalTransaction.equals(that.globalTransaction) : that.globalTransaction != null)
  +      {
  +         return false;
  +      }
  +      if (optionOverrides != null ? !optionOverrides.equals(that.optionOverrides) : that.optionOverrides != null)
  +      {
  +         return false;
  +      }
  +      if (transaction != null ? !transaction.equals(that.transaction) : that.transaction != null) return false;
  +
  +      return true;
  +   }
  +
  +   public int hashCode()
  +   {
  +      int result;
  +      result = (transaction != null ? transaction.hashCode() : 0);
  +      result = 29 * result + (globalTransaction != null ? globalTransaction.hashCode() : 0);
  +      result = 29 * result + (optionOverrides != null ? optionOverrides.hashCode() : 0);
  +      result = 29 * result + (originLocal ? 1 : 0);
  +      result = 29 * result + (txHasMods ? 1 : 0);
  +      result = 29 * result + (localRollbackOnly ? 1 : 0);
  +      return result;
  +   }
   }
  
  
  
  1.4       +45 -40    JBossCache/src/org/jboss/cache/RPCManager.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: RPCManager.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/RPCManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- RPCManager.java	25 Aug 2006 14:10:09 -0000	1.3
  +++ RPCManager.java	29 Aug 2006 17:50:14 -0000	1.4
  @@ -6,8 +6,8 @@
    */
   package org.jboss.cache;
   
  -import org.jgroups.Address;
   import org.jboss.cache.marshall.MethodCall;
  +import org.jgroups.Address;
   
   import java.lang.reflect.Method;
   import java.util.List;
  @@ -19,7 +19,6 @@
    */
   public class RPCManager
   {
  -    static RPCManager rpcManager;
       TreeCache c;
   
       private RPCManager(TreeCache c)
  @@ -29,7 +28,13 @@
   
       public static RPCManager getInstance(TreeCache c)
       {
  -        if (rpcManager == null) rpcManager = new RPCManager(c);
  +      RPCManager rpcManager = c.getRpcManager();
  +      if (rpcManager == null)
  +      {
  +         rpcManager = new RPCManager(c);
  +         c.setRpcManager(rpcManager);
  +      }
  +
           return rpcManager;
       }
   
  
  
  
  1.233     +13 -1     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.232
  retrieving revision 1.233
  diff -u -b -r1.232 -r1.233
  --- TreeCache.java	29 Aug 2006 16:36:57 -0000	1.232
  +++ TreeCache.java	29 Aug 2006 17:50:14 -0000	1.233
  @@ -94,7 +94,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.232 2006/08/29 16:36:57 msurtani Exp $
  + * @version $Id: TreeCache.java,v 1.233 2006/08/29 17:50:14 msurtani Exp $
    *          <p/>
    * @see <a href="http://labs.jboss.com/portal/jbosscache/docs">JBossCache doc</a>
    */
  @@ -288,6 +288,18 @@
   
      private Configuration configuration = new Configuration();
   
  +   private RPCManager rpcManager;
  +
  +   public RPCManager getRpcManager()
  +   {
  +      return rpcManager;
  +   }
  +
  +   public void setRpcManager(RPCManager rpcManager)
  +   {
  +      this.rpcManager = rpcManager;
  +   }
  +
      /**
       * Creates a TreeCache with a given configuration
       */
  
  
  



More information about the jboss-cvs-commits mailing list