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

Manik Surtani manik at jboss.org
Wed Jun 6 08:43:49 EDT 2007


  User: msurtani
  Date: 07/06/06 08:43:49

  Modified:    src/org/jboss/cache    CacheImpl.java RPCManagerImpl.java
                        ReplicationQueue.java
  Log:
  Removed a lot of deprecation
  
  Revision  Changes    Path
  1.82      +58 -74    JBossCache/src/org/jboss/cache/CacheImpl.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CacheImpl.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/CacheImpl.java,v
  retrieving revision 1.81
  retrieving revision 1.82
  diff -u -b -r1.81 -r1.82
  --- CacheImpl.java	29 May 2007 16:25:20 -0000	1.81
  +++ CacheImpl.java	6 Jun 2007 12:43:48 -0000	1.82
  @@ -229,8 +229,6 @@
   
      private Configuration configuration = new Configuration(this);
   
  -   private RPCManager rpcManager;
  -
      /**
       * Constructs an uninitialized CacheImpl.
       */
  @@ -260,16 +258,6 @@
         return configuration;
      }
   
  -   public RPCManager getRpcManager()
  -   {
  -      return rpcManager;
  -   }
  -
  -   public void setRpcManager(RPCManager rpcManager)
  -   {
  -      this.rpcManager = rpcManager;
  -   }
  -
      /**
       * Returns the CacheImpl implementation version.
       */
  @@ -616,9 +604,10 @@
         {
            initialiseCacheLoaderManager();
         }
  -      // first set up the Buddy Manager
  +      // first set up the Buddy Manager and an RPCManager
         if (configuration.getCacheMode() != Configuration.CacheMode.LOCAL)
         {
  +         getConfiguration().getRuntimeConfig().setRPCManager(new RPCManagerImpl(this));
            setBuddyReplicationConfig(configuration.getBuddyReplicationConfig());
         }
         // build interceptor chain
  @@ -2010,6 +1999,7 @@
       * @throws Exception
       * @deprecated Note this is due to be moved to an interceptor.
       */
  +   @Deprecated
      public List callRemoteMethods(List<Address> mbrs, MethodCall method_call,
                                    boolean synchronous, boolean exclude_self, long timeout)
              throws Exception
  @@ -2030,6 +2020,7 @@
       * @throws Exception
       * @deprecated Note this is due to be moved to an interceptor.
       */
  +   @Deprecated
      public List callRemoteMethods(List<Address> mbrs, MethodCall method_call, int mode, boolean exclude_self, long timeout)
              throws Exception
      {
  @@ -2131,6 +2122,7 @@
       * @throws Exception
       * @deprecated Note this is due to be moved to an interceptor.
       */
  +   @Deprecated
      public List callRemoteMethods(List<Address> members, Method method, Object[] args,
                                    boolean synchronous, boolean exclude_self, long timeout)
              throws Exception
  @@ -2150,6 +2142,7 @@
       * @throws Exception
       * @deprecated Note this is due to be moved to an interceptor.
       */
  +   @Deprecated
      public List callRemoteMethods(Vector<Address> members, String method_name,
                                    Class[] types, Object[] args,
                                    boolean synchronous, boolean exclude_self, long timeout)
  @@ -4065,8 +4058,9 @@
       * Provided for backwards compatibility.
       *
       * @param loader
  -    * @deprecated
  +    * @deprecated only provided for backward compat
       */
  +   @Deprecated
      public void setCacheLoader(CacheLoader loader)
      {
         log.warn("Using deprecated config method setCacheLoader.  This element will be removed in future, please use CacheLoaderConfiguration instead.");
  @@ -4236,17 +4230,7 @@
   
      public RPCManager getRPCManager()
      {
  -      if (rpcManager == null)
  -      {
  -         synchronized (this)
  -         {
  -            if (rpcManager == null)
  -            {
  -               rpcManager = RPCManagerImpl.getInstance(this);
  -            }
  -         }
  -      }
  -      return rpcManager;
  +      return configuration.getRuntimeConfig().getRPCManager();
      }
   
      public String getClusterName()
  
  
  
  1.3       +1 -13     JBossCache/src/org/jboss/cache/RPCManagerImpl.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: RPCManagerImpl.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/RPCManagerImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- RPCManagerImpl.java	19 Mar 2007 19:03:34 -0000	1.2
  +++ RPCManagerImpl.java	6 Jun 2007 12:43:48 -0000	1.3
  @@ -28,23 +28,11 @@
      {
      }
   
  -   private RPCManagerImpl(CacheSPI c)
  +   public RPCManagerImpl(CacheSPI c)
      {
         this.c = (CacheImpl) c;
      }
   
  -   public static RPCManager getInstance(CacheImpl c)
  -   {
  -      RPCManager rpcManager = c.getRpcManager();
  -      if (rpcManager == null)
  -      {
  -         rpcManager = new RPCManagerImpl(c);
  -         c.setRpcManager(rpcManager);
  -      }
  -
  -      return rpcManager;
  -   }
  -
      // for now, we delegate RPC calls to deprecated methods in CacheImpl.
   
      public List callRemoteMethods(List<Address> recipients, MethodCall methodCall, int mode, boolean excludeSelf, long timeout) throws Exception
  
  
  
  1.15      +4 -4      JBossCache/src/org/jboss/cache/ReplicationQueue.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ReplicationQueue.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/ReplicationQueue.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -b -r1.14 -r1.15
  --- ReplicationQueue.java	22 Mar 2007 20:08:54 -0000	1.14
  +++ ReplicationQueue.java	6 Jun 2007 12:43:48 -0000	1.15
  @@ -23,7 +23,7 @@
    * Periodically (or when certain size is exceeded) takes elements and replicates them.
    *
    * @author <a href="mailto:bela at jboss.org">Bela Ban</a> May 24, 2003
  - * @version $Revision: 1.14 $
  + * @version $Revision: 1.15 $
    */
   public class ReplicationQueue
   {
  @@ -177,7 +177,7 @@
            try
            {
               // send to all live nodes in the cluster
  -            cache.callRemoteMethods(null, MethodDeclarations.replicateAllMethod, new Object[]{l}, false, true, 5000);
  +            cache.getRPCManager().callRemoteMethods(null, MethodDeclarations.replicateAllMethod, new Object[]{l}, false, true, 5000);
            }
            catch (Throwable t)
            {
  
  
  



More information about the jboss-cvs-commits mailing list