[jbosscache-commits] JBoss Cache SVN: r5694 - core/trunk/src/main/java/org/jboss/cache.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Fri Apr 25 09:54:37 EDT 2008


Author: manik.surtani at jboss.com
Date: 2008-04-25 09:54:37 -0400 (Fri, 25 Apr 2008)
New Revision: 5694

Modified:
   core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java
Log:
JBCACHE-805 - Only set AUTO_GETSTATE if configured to fetch state

Modified: core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java	2008-04-25 13:34:09 UTC (rev 5693)
+++ core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java	2008-04-25 13:54:37 UTC (rev 5694)
@@ -133,9 +133,10 @@
             isUsingBuddyReplication = configuration.getBuddyReplicationConfig() != null && configuration.getBuddyReplicationConfig().isEnabled();
             if (log.isDebugEnabled()) log.debug("Cache mode is " + configuration.getCacheMode());
 
-            initialiseChannelAndRpcDispatcher();
+            boolean fetchState = shouldFetchStateOnStartup();
+            initialiseChannelAndRpcDispatcher(fetchState);
 
-            if (shouldFetchStateOnStartup())
+            if (fetchState)
             {
                try
                {
@@ -231,7 +232,7 @@
       return !configuration.isInactiveOnStartup() && !isUsingBuddyReplication && (configuration.isFetchInMemoryState() || loaderFetch);
    }
 
-   private void initialiseChannelAndRpcDispatcher() throws CacheException
+   private void initialiseChannelAndRpcDispatcher(boolean fetchState) throws CacheException
    {
       channel = configuration.getRuntimeConfig().getChannel();
       if (channel == null)
@@ -274,7 +275,7 @@
       }
 
       channel.setOpt(Channel.AUTO_RECONNECT, true);
-      channel.setOpt(Channel.AUTO_GETSTATE, true);
+      channel.setOpt(Channel.AUTO_GETSTATE, fetchState);
       channel.setOpt(Channel.BLOCK, true);
 
       // always use the InactiveRegionAwareRpcDispatcher - exceptions due to regions not being active should not propagate to remote




More information about the jbosscache-commits mailing list