Author: manik.surtani(a)jboss.com
Date: 2008-07-31 05:15:52 -0400 (Thu, 31 Jul 2008)
New Revision: 6457
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/InvocationContextInterceptor.java
core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java
Log:
Exists command should go up interceptor chain!
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/InvocationContextInterceptor.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/interceptors/InvocationContextInterceptor.java 2008-07-31
08:29:26 UTC (rev 6456)
+++
core/trunk/src/main/java/org/jboss/cache/interceptors/InvocationContextInterceptor.java 2008-07-31
09:15:52 UTC (rev 6457)
@@ -8,6 +8,7 @@
import org.jboss.cache.RPCManager;
import org.jboss.cache.commands.VisitableCommand;
+import org.jboss.cache.commands.read.ExistsCommand;
import org.jboss.cache.commands.tx.CommitCommand;
import org.jboss.cache.commands.tx.OptimisticPrepareCommand;
import org.jboss.cache.commands.tx.PrepareCommand;
@@ -49,6 +50,12 @@
}
@Override
+ public Object visitExistsNodeCommand(InvocationContext ctx, ExistsCommand command)
throws Throwable
+ {
+ return handleAll(ctx, command, null, false);
+ }
+
+ @Override
public Object visitPutForExternalReadCommand(InvocationContext ctx,
PutForExternalReadCommand command) throws Throwable
{
return handleAll(ctx, command, command.getGlobalTransaction(), false);
Modified:
core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java 2008-07-31
08:29:26 UTC (rev 6456)
+++
core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java 2008-07-31
09:15:52 UTC (rev 6457)
@@ -16,6 +16,7 @@
import org.jboss.cache.buddyreplication.BuddyManager;
import org.jboss.cache.buddyreplication.GravitateResult;
import org.jboss.cache.commands.CommandsFactory;
+import org.jboss.cache.commands.read.ExistsCommand;
import org.jboss.cache.commands.read.GetChildrenNamesCommand;
import org.jboss.cache.commands.read.GetDataMapCommand;
import org.jboss.cache.commands.read.GetKeyValueCommand;
@@ -229,7 +230,10 @@
public boolean exists(Fqn fqn)
{
- return peek(fqn, false, false) != null;
+ InvocationContext ctx = invocationContextContainer.get();
+ cacheStatusCheck(ctx);
+ ExistsCommand command = commandsFactory.buildExistsNodeCommand(fqn);
+ return (Boolean) invoker.invoke(ctx, command);
}
public Notifier getNotifier()
Show replies by date