Author: manik.surtani(a)jboss.com
Date: 2008-10-03 08:59:43 -0400 (Fri, 03 Oct 2008)
New Revision: 6832
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/LegacyDataGravitatorInterceptor.java
Log:
Fixed broken interceptors.
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java 2008-10-03
10:13:44 UTC (rev 6831)
+++
core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java 2008-10-03
12:59:43 UTC (rev 6832)
@@ -43,6 +43,13 @@
}
@Override
+ protected boolean nodeDoesNotExist(InvocationContext ctx, Fqn fqn)
+ {
+ return ctx.lookUpNode(fqn) == null;
+ }
+
+
+ @Override
protected void wrapIfNeeded(InvocationContext ctx, Fqn fqnToWrap) throws
InterruptedException
{
helper.wrapNodeForReading(ctx, fqnToWrap, true);
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/LegacyDataGravitatorInterceptor.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/interceptors/LegacyDataGravitatorInterceptor.java 2008-10-03
10:13:44 UTC (rev 6831)
+++
core/trunk/src/main/java/org/jboss/cache/interceptors/LegacyDataGravitatorInterceptor.java 2008-10-03
12:59:43 UTC (rev 6832)
@@ -158,6 +158,16 @@
}
}
+ /**
+ * @param ctx invocation context
+ * @param fqn fqn to test
+ * @return true if the node does not exist; false otherwise.
+ */
+ protected boolean nodeDoesNotExist(InvocationContext ctx, Fqn fqn)
+ {
+ return !dataContainer.exists(fqn);
+ }
+
private Object handleGetMethod(InvocationContext ctx, DataCommand command) throws
Throwable
{
if (isGravitationEnabled(ctx))
@@ -170,7 +180,7 @@
}
else
{
- if (!dataContainer.exists(command.getFqn()))
+ if (nodeDoesNotExist(ctx, command.getFqn()))
{
// gravitation is necessary.
Show replies by date