Author: jason.greene(a)jboss.com
Date: 2009-02-13 14:06:47 -0500 (Fri, 13 Feb 2009)
New Revision: 7693
Modified:
core/trunk/src/main/java/org/jboss/cache/statetransfer/DefaultStateTransferManager.java
Log:
Ensure that a state receiver can not also be a sender
Modified:
core/trunk/src/main/java/org/jboss/cache/statetransfer/DefaultStateTransferManager.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/statetransfer/DefaultStateTransferManager.java 2009-02-13
19:06:16 UTC (rev 7692)
+++
core/trunk/src/main/java/org/jboss/cache/statetransfer/DefaultStateTransferManager.java 2009-02-13
19:06:47 UTC (rev 7693)
@@ -88,7 +88,8 @@
public void getState(ObjectOutputStream out, Fqn fqn, long timeout, boolean force,
boolean suppressErrors) throws Exception
{
// can't give state for regions currently being activated/inactivated
- boolean canProvideState = (!regionManager.isInactive(fqn) &&
cache.peek(fqn, false) != null);
+ boolean canProvideState = cache.getCacheStatus().allowInvocations()
+ && !regionManager.isInactive(fqn) &&
cache.peek(fqn, false) != null;
if (trace) log.trace("Can provide state? " + canProvideState);
if (canProvideState && (fetchPersistentState || fetchTransientState))
{
@@ -113,6 +114,9 @@
{
String exceptionMessage = "Cache instance at " +
cache.getLocalAddress() + " cannot provide state for fqn " + fqn +
".";
+ if (!cache.getCacheStatus().allowInvocations())
+ exceptionMessage = " [Cache is not in the correct status]";
+
if (regionManager.isInactive(fqn))
{
exceptionMessage += " Region for fqn " + fqn + " is
inactive.";
Show replies by date