Author: manik.surtani(a)jboss.com
Date: 2009-02-24 08:45:44 -0500 (Tue, 24 Feb 2009)
New Revision: 7770
Modified:
core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java
core/trunk/src/main/java/org/jboss/cache/config/Configuration.java
Log:
Configuration sanity check for NBST configs
Modified: core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java 2009-02-24 13:34:08 UTC
(rev 7769)
+++ core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java 2009-02-24 13:45:44 UTC
(rev 7770)
@@ -26,6 +26,7 @@
import org.jboss.cache.commands.ReplicableCommand;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.config.Configuration.NodeLockingScheme;
+import org.jboss.cache.config.ConfigurationException;
import org.jboss.cache.config.RuntimeConfig;
import org.jboss.cache.factories.ComponentRegistry;
import org.jboss.cache.factories.annotations.Inject;
@@ -316,6 +317,9 @@
boolean fetchState = shouldFetchStateOnStartup();
boolean nonBlocking = configuration.isNonBlockingStateTransfer();
+
+ sanityCheckConfiguration(nonBlocking, fetchState);
+
this.flushTracker = nonBlocking ? new NonBlockingFlushTracker() : new
StandardFlushTracker();
initialiseChannelAndRpcDispatcher(fetchState && !nonBlocking);
@@ -374,6 +378,17 @@
}
}
+ private void sanityCheckConfiguration(boolean nonBlockingStateTransfer, boolean
fetchStateOnStart)
+ {
+ if (isInLocalMode || !nonBlockingStateTransfer || !fetchStateOnStart) return; //
don't care about these cases!
+
+ if (configuration.getNodeLockingScheme() != NodeLockingScheme.MVCC)
+ throw new ConfigurationException("Non-blocking state transfer is only
supported with the MVCC node locking scheme. Please change your node locking scheme to
MVCC or disable non-blocking state transfer.");
+
+ if (isUsingBuddyReplication)
+ throw new ConfigurationException("Non-blocking state transfer cannot be
used with buddy replication at this time. Please disable either buddy replication or
non-blocking state transfer.");
+ }
+
private void startNonBlockStateTransfer(List<Address> members)
{
Modified: core/trunk/src/main/java/org/jboss/cache/config/Configuration.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/Configuration.java 2009-02-24 13:34:08
UTC (rev 7769)
+++ core/trunk/src/main/java/org/jboss/cache/config/Configuration.java 2009-02-24 13:45:44
UTC (rev 7770)
@@ -548,6 +548,7 @@
}
}
+ @Deprecated
public String getNodeLockingSchemeString()
{
return nodeLockingScheme == null ? null : nodeLockingScheme.toString();
Show replies by date