Author: manik.surtani(a)jboss.com
Date: 2008-04-28 10:00:06 -0400 (Mon, 28 Apr 2008)
New Revision: 5719
Added:
core/trunk/src/main/java/org/jboss/cache/interceptors/base/CommandInterceptor.java
Removed:
core/trunk/src/main/java/org/jboss/cache/interceptors/base/VisitorInterceptor.java
Modified:
core/trunk/src/main/java/org/jboss/cache/CacheSPI.java
core/trunk/src/main/java/org/jboss/cache/factories/InterceptorChainFactory.java
core/trunk/src/main/java/org/jboss/cache/interceptors/BaseRpcInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/BaseTransactionalContextInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/CacheLoaderInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/CacheMgmtInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/CallInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/EvictionInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/Interceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/InterceptorChain.java
core/trunk/src/main/java/org/jboss/cache/interceptors/MarshalledValueInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/PassivationInterceptor.java
core/trunk/src/main/java/org/jboss/cache/invocation/AbstractInvocationDelegate.java
core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java
core/trunk/src/main/java/org/jboss/cache/util/CachePrinter.java
core/trunk/src/test/java/org/jboss/cache/api/NodeAPITest.java
core/trunk/src/test/java/org/jboss/cache/loader/SharedCacheLoaderTest.java
core/trunk/src/test/java/org/jboss/cache/optimistic/AbstractOptimisticTestCase.java
core/trunk/src/test/java/org/jboss/cache/optimistic/ConcurrentTransactionTest.java
core/trunk/src/test/java/org/jboss/cache/optimistic/MockFailureInterceptor.java
core/trunk/src/test/java/org/jboss/cache/optimistic/MockInterceptor.java
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorGetChildrenNamesTest.java
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorGetKeyValTest.java
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorGetKeysTest.java
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorKeyValTest.java
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorPutEraseTest.java
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorPutMapTest.java
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorRemoveDataTest.java
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorRemoveKeyValTest.java
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorTransactionTest.java
core/trunk/src/test/java/org/jboss/cache/optimistic/OptimisticCreateIfNotExistsInterceptorTest.java
core/trunk/src/test/java/org/jboss/cache/optimistic/ThreadedOptimisticCreateIfNotExistsInterceptorTest.java
core/trunk/src/test/java/org/jboss/cache/optimistic/ValidatorInterceptorTest.java
Log:
More refactoring
Modified: core/trunk/src/main/java/org/jboss/cache/CacheSPI.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/CacheSPI.java 2008-04-28 12:18:52 UTC (rev
5718)
+++ core/trunk/src/main/java/org/jboss/cache/CacheSPI.java 2008-04-28 14:00:06 UTC (rev
5719)
@@ -9,7 +9,7 @@
import net.jcip.annotations.ThreadSafe;
import org.jboss.cache.buddyreplication.BuddyManager;
import org.jboss.cache.buddyreplication.GravitateResult;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
import org.jboss.cache.loader.CacheLoader;
import org.jboss.cache.loader.CacheLoaderManager;
import org.jboss.cache.marshall.Marshaller;
@@ -26,7 +26,7 @@
/**
* A more detailed interface to {@link Cache}, which is used when writing plugins for or
extending JBoss Cache. A reference
* to this interface should only be obtained when it is passed in to your code, for
example when you write an
- * {@link org.jboss.cache.interceptors.base.VisitorInterceptor} or {@link CacheLoader}.
+ * {@link org.jboss.cache.interceptors.base.CommandInterceptor} or {@link CacheLoader}.
* <p/>
* <B><I>You should NEVER attempt to directly cast a {@link Cache} instance
to this interface. In future, the implementation may not allow it.</I></B>
* <p/>
@@ -82,11 +82,11 @@
* From 2.1.0, Interceptor authors should obtain this by injection rather than this
method. See the
* {@link org.jboss.cache.factories.annotations.Inject} annotation.
*
- * @return an immutable {@link List} of {@link
org.jboss.cache.interceptors.base.VisitorInterceptor}s configured for this cache, or
+ * @return an immutable {@link List} of {@link
org.jboss.cache.interceptors.base.CommandInterceptor}s configured for this cache, or
* <code>null</code> if {@link Cache#create() create()} has not
been invoked
* and the interceptors thus do not exist.
*/
- List<VisitorInterceptor> getInterceptorChain();
+ List<CommandInterceptor> getInterceptorChain();
/**
* Retrieves an instance of a {@link Marshaller}, which is capable of
@@ -111,7 +111,7 @@
* @param i the interceptor to add
* @param position the position to add the interceptor
*/
- void addInterceptor(VisitorInterceptor i, int position);
+ void addInterceptor(CommandInterceptor i, int position);
/**
* Adds a custom interceptor to the interceptor chain, after an instance of the
specified interceptor type. Throws a
@@ -120,7 +120,7 @@
* @param i interceptor to add
* @param afterInterceptor interceptor type after which to place custom interceptor
*/
- void addInterceptor(VisitorInterceptor i, Class<? extends VisitorInterceptor>
afterInterceptor);
+ void addInterceptor(CommandInterceptor i, Class<? extends CommandInterceptor>
afterInterceptor);
/**
* Removes the interceptor at a specified position, where the first interceptor in the
chain
@@ -135,7 +135,7 @@
*
* @param interceptorType type of interceptor to remove
*/
- void removeInterceptor(Class<? extends VisitorInterceptor> interceptorType);
+ void removeInterceptor(Class<? extends CommandInterceptor> interceptorType);
/**
* Retrieves the current CacheCacheLoaderManager instance associated with the current
Cache instance.
Modified: core/trunk/src/main/java/org/jboss/cache/factories/InterceptorChainFactory.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/factories/InterceptorChainFactory.java 2008-04-28
12:18:52 UTC (rev 5718)
+++
core/trunk/src/main/java/org/jboss/cache/factories/InterceptorChainFactory.java 2008-04-28
14:00:06 UTC (rev 5719)
@@ -10,7 +10,7 @@
import org.jboss.cache.config.ConfigurationException;
import org.jboss.cache.factories.annotations.DefaultFactoryFor;
import org.jboss.cache.interceptors.*;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
/**
* Factory class that builds an interceptor chain based on cache configuration.
@@ -32,10 +32,10 @@
return new InterceptorChainFactory();
}
- private VisitorInterceptor createInterceptor(Class<? extends VisitorInterceptor>
clazz) throws IllegalAccessException, InstantiationException
+ private CommandInterceptor createInterceptor(Class<? extends CommandInterceptor>
clazz) throws IllegalAccessException, InstantiationException
{
//todo - no reason for the individual interceptors to be registered as components,
all manipulation should be done through InterceptorChain
- VisitorInterceptor chainedInterceptor =
componentRegistry.getComponent(clazz.getName(), clazz);
+ CommandInterceptor chainedInterceptor =
componentRegistry.getComponent(clazz.getName(), clazz);
if (chainedInterceptor == null)
{
chainedInterceptor = clazz.newInstance();
@@ -54,7 +54,7 @@
{
boolean optimistic = configuration.isNodeLockingOptimistic();
// load the icInterceptor first
- VisitorInterceptor first = createInterceptor(InvocationContextInterceptor.class);
+ CommandInterceptor first = createInterceptor(InvocationContextInterceptor.class);
InterceptorChain interceptorChain = new InterceptorChain(first);
// load the cache management interceptor next
@@ -114,7 +114,7 @@
interceptorChain.appendIntereceptor(createInterceptor(configuration.isUsingBuddyReplication()
? BuddyRegionAwareEvictionInterceptor.class : EvictionInterceptor.class));
if (optimistic)
interceptorChain.appendIntereceptor(createInterceptor(OptimisticNodeInterceptor.class));
- VisitorInterceptor callInterceptor = createInterceptor(CallInterceptor.class);
+ CommandInterceptor callInterceptor = createInterceptor(CallInterceptor.class);
interceptorChain.appendIntereceptor(callInterceptor);
if (log.isTraceEnabled()) log.trace("Finished building interceptor
chain.");
return interceptorChain;
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/BaseRpcInterceptor.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/interceptors/BaseRpcInterceptor.java 2008-04-28
12:18:52 UTC (rev 5718)
+++
core/trunk/src/main/java/org/jboss/cache/interceptors/BaseRpcInterceptor.java 2008-04-28
14:00:06 UTC (rev 5719)
@@ -14,7 +14,7 @@
import org.jboss.cache.config.Option;
import org.jboss.cache.factories.CommandsFactory;
import org.jboss.cache.factories.annotations.Inject;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
import org.jboss.cache.transaction.GlobalTransaction;
import org.jboss.cache.transaction.TransactionEntry;
import org.jboss.cache.transaction.TransactionTable;
@@ -29,7 +29,7 @@
*
* @author <a href="mailto:manik@jboss.org">Manik Surtani
(manik(a)jboss.org)</a>
*/
-public abstract class BaseRpcInterceptor extends VisitorInterceptor
+public abstract class BaseRpcInterceptor extends CommandInterceptor
{
private BuddyManager buddyManager;
private boolean usingBuddyReplication;
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/BaseTransactionalContextInterceptor.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/interceptors/BaseTransactionalContextInterceptor.java 2008-04-28
12:18:52 UTC (rev 5718)
+++
core/trunk/src/main/java/org/jboss/cache/interceptors/BaseTransactionalContextInterceptor.java 2008-04-28
14:00:06 UTC (rev 5719)
@@ -3,7 +3,7 @@
import org.jboss.cache.InvocationContext;
import org.jboss.cache.config.Option;
import org.jboss.cache.factories.annotations.Inject;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
import org.jboss.cache.transaction.GlobalTransaction;
import org.jboss.cache.transaction.TransactionEntry;
import org.jboss.cache.transaction.TransactionTable;
@@ -18,7 +18,7 @@
*
* @author <a href="mailto:manik@jboss.org">Manik Surtani</a>
*/
-public abstract class BaseTransactionalContextInterceptor extends VisitorInterceptor
+public abstract class BaseTransactionalContextInterceptor extends CommandInterceptor
{
protected TransactionTable txTable;
protected TransactionManager txManager;
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/CacheLoaderInterceptor.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/interceptors/CacheLoaderInterceptor.java 2008-04-28
12:18:52 UTC (rev 5718)
+++
core/trunk/src/main/java/org/jboss/cache/interceptors/CacheLoaderInterceptor.java 2008-04-28
14:00:06 UTC (rev 5719)
@@ -21,7 +21,7 @@
import static org.jboss.cache.config.Configuration.CacheMode;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.factories.annotations.Start;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
import org.jboss.cache.loader.CacheLoader;
import org.jboss.cache.loader.CacheLoaderManager;
import org.jboss.cache.lock.LockManager;
@@ -44,7 +44,7 @@
* @author Bela Ban
* @version $Id$
*/
-public class CacheLoaderInterceptor extends VisitorInterceptor implements
CacheLoaderInterceptorMBean
+public class CacheLoaderInterceptor extends CommandInterceptor implements
CacheLoaderInterceptorMBean
{
private long cacheLoads = 0;
private long cacheMisses = 0;
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/CacheMgmtInterceptor.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/interceptors/CacheMgmtInterceptor.java 2008-04-28
12:18:52 UTC (rev 5718)
+++
core/trunk/src/main/java/org/jboss/cache/interceptors/CacheMgmtInterceptor.java 2008-04-28
14:00:06 UTC (rev 5719)
@@ -28,7 +28,7 @@
import org.jboss.cache.commands.write.PutDataMapCommand;
import org.jboss.cache.commands.write.PutKeyValueCommand;
import org.jboss.cache.factories.annotations.Inject;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
import java.util.HashMap;
import java.util.Map;
@@ -39,7 +39,7 @@
* @author Jerry Gauthier
* @version $Id$
*/
-public class CacheMgmtInterceptor extends VisitorInterceptor implements
CacheMgmtInterceptorMBean
+public class CacheMgmtInterceptor extends CommandInterceptor implements
CacheMgmtInterceptorMBean
{
private long m_hit_times = 0;
private long m_miss_times = 0;
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/CallInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/CallInterceptor.java 2008-04-28
12:18:52 UTC (rev 5718)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/CallInterceptor.java 2008-04-28
14:00:06 UTC (rev 5719)
@@ -18,7 +18,7 @@
import org.jboss.cache.config.Option;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.factories.annotations.Start;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
import org.jboss.cache.transaction.GlobalTransaction;
import org.jboss.cache.transaction.TransactionTable;
@@ -35,7 +35,7 @@
* @author Bela Ban
* @version $Id$
*/
-public class CallInterceptor extends VisitorInterceptor
+public class CallInterceptor extends CommandInterceptor
{
// private CacheLoaderManager cacheLoaderManager;
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/EvictionInterceptor.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/interceptors/EvictionInterceptor.java 2008-04-28
12:18:52 UTC (rev 5718)
+++
core/trunk/src/main/java/org/jboss/cache/interceptors/EvictionInterceptor.java 2008-04-28
14:00:06 UTC (rev 5719)
@@ -25,7 +25,7 @@
import org.jboss.cache.eviction.EvictedEventNode;
import org.jboss.cache.eviction.NodeEventType;
import org.jboss.cache.factories.annotations.Inject;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
/**
* Eviction Interceptor.
@@ -36,7 +36,7 @@
* @author Mircea.Markus(a)jboss.com
* @version $Revision$
*/
-public class EvictionInterceptor extends VisitorInterceptor
+public class EvictionInterceptor extends CommandInterceptor
{
protected RegionManager regionManager;
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/Interceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/Interceptor.java 2008-04-28
12:18:52 UTC (rev 5718)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/Interceptor.java 2008-04-28
14:00:06 UTC (rev 5719)
@@ -30,7 +30,7 @@
import org.jboss.cache.config.Configuration;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.factories.annotations.Start;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
import java.util.Collections;
import java.util.Map;
@@ -40,10 +40,10 @@
*
* @author Bela Ban
* @version $Id$
- * @deprecated this will be removed in a 3.x release. Please use {@link
org.jboss.cache.interceptors.base.VisitorInterceptor} instead, since it provides strongly
typed callbacks which are more efficient.
+ * @deprecated this will be removed in a 3.x release. Please use {@link
org.jboss.cache.interceptors.base.CommandInterceptor} instead, since it provides strongly
typed callbacks which are more efficient.
*/
@Deprecated
-public abstract class Interceptor extends VisitorInterceptor implements InterceptorMBean
+public abstract class Interceptor extends CommandInterceptor implements InterceptorMBean
{
protected CacheSPI<?, ?> cache;
protected Log log = null;
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/InterceptorChain.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/InterceptorChain.java 2008-04-28
12:18:52 UTC (rev 5718)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/InterceptorChain.java 2008-04-28
14:00:06 UTC (rev 5719)
@@ -6,7 +6,7 @@
import org.jboss.cache.InvocationContext;
import org.jboss.cache.commands.VisitableCommand;
import org.jboss.cache.factories.annotations.Inject;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
import org.jboss.cache.invocation.InvocationContextContainer;
import org.jboss.cache.util.CachePrinter;
@@ -27,7 +27,7 @@
/**
* reference to the first interceptor in the chain
*/
- private VisitorInterceptor firstInChain;
+ private CommandInterceptor firstInChain;
/**
* used for invoking commands on the chain
@@ -39,7 +39,7 @@
/**
* Constructs an interceptor chain having the supplied interceptor as first.
*/
- public InterceptorChain(VisitorInterceptor first)
+ public InterceptorChain(CommandInterceptor first)
{
this.firstInChain = first;
}
@@ -55,7 +55,7 @@
*
* @throws IllegalArgumentException if the position is invalid (e.g. 5 and there are
only 2 interceptors in the chain)
*/
- public synchronized void addInterceptor(VisitorInterceptor interceptor, int position)
+ public synchronized void addInterceptor(CommandInterceptor interceptor, int position)
{
if (position == 0)
{
@@ -64,7 +64,7 @@
return;
}
if (firstInChain == null) return;
- VisitorInterceptor it = firstInChain;
+ CommandInterceptor it = firstInChain;
int index = 0;
while (it != null)
{
@@ -92,7 +92,7 @@
firstInChain = firstInChain.getNext();
return;
}
- VisitorInterceptor it = firstInChain;
+ CommandInterceptor it = firstInChain;
int index = 0;
while (it != null)
{
@@ -113,7 +113,7 @@
public int size()
{
int size = 0;
- VisitorInterceptor it = firstInChain;
+ CommandInterceptor it = firstInChain;
while (it != null)
{
size++;
@@ -127,15 +127,15 @@
* Returns an unmofiable list with all the interceptors in sequence.
* If first in chain is null an empty list is returned.
*/
- public List<VisitorInterceptor> getInterceptorsAsList()
+ public List<CommandInterceptor> getInterceptorsAsList()
{
- List<VisitorInterceptor> result;
+ List<CommandInterceptor> result;
if (firstInChain == null)
{
result = Collections.EMPTY_LIST;
}
- List<VisitorInterceptor> retval = new
LinkedList<VisitorInterceptor>();
- VisitorInterceptor tmp = firstInChain;
+ List<CommandInterceptor> retval = new
LinkedList<CommandInterceptor>();
+ CommandInterceptor tmp = firstInChain;
do
{
retval.add(tmp);
@@ -150,14 +150,14 @@
/**
* Removes all the occurences of supplied interceptor type from the chain.
*/
- public synchronized void removeInterceptor(Class<? extends VisitorInterceptor>
clazz)
+ public synchronized void removeInterceptor(Class<? extends CommandInterceptor>
clazz)
{
if (firstInChain.getClass() == clazz)
{
firstInChain = firstInChain.getNext();
}
- VisitorInterceptor it = firstInChain.getNext();
- VisitorInterceptor prevIt = firstInChain;
+ CommandInterceptor it = firstInChain.getNext();
+ CommandInterceptor prevIt = firstInChain;
while (it != null)
{
if (it.getClass() == clazz)
@@ -174,9 +174,9 @@
*
* @return true if the interceptor was added; i.e. the afterInterceptor exists
*/
- public synchronized boolean addInterceptor(VisitorInterceptor toAdd, Class<?
extends VisitorInterceptor> afterInterceptor)
+ public synchronized boolean addInterceptor(CommandInterceptor toAdd, Class<?
extends CommandInterceptor> afterInterceptor)
{
- VisitorInterceptor it = firstInChain;
+ CommandInterceptor it = firstInChain;
while (it != null)
{
if (it.getClass().equals(afterInterceptor))
@@ -193,20 +193,20 @@
/**
* Returns the chain as a list.
*/
- public List<VisitorInterceptor> asList()
+ public List<CommandInterceptor> asList()
{
- List<VisitorInterceptor> result;
+ List<CommandInterceptor> result;
if (this.firstInChain == null)
{
result = null;
}
int num = 1;
- VisitorInterceptor tmp = this.firstInChain;
+ CommandInterceptor tmp = this.firstInChain;
while ((tmp = tmp.getNext()) != null)
{
num++;
}
- List<VisitorInterceptor> retval = new
ArrayList<VisitorInterceptor>(num);
+ List<CommandInterceptor> retval = new
ArrayList<CommandInterceptor>(num);
tmp = this.firstInChain;
num = 0;
do
@@ -222,9 +222,9 @@
/**
* Appends at the end.
*/
- public void appendIntereceptor(VisitorInterceptor ci)
+ public void appendIntereceptor(CommandInterceptor ci)
{
- VisitorInterceptor it = firstInChain;
+ CommandInterceptor it = firstInChain;
while (it.hasNext()) it = it.getNext();
it.setNext(ci);
// make sure we nullify the "next" pointer in the last interceptor.
@@ -280,7 +280,7 @@
/**
* @return the first interceptor in the chain.
*/
- public VisitorInterceptor getFirstInChain()
+ public CommandInterceptor getFirstInChain()
{
return firstInChain;
}
@@ -290,7 +290,7 @@
*
* @param interceptor interceptor to be used as the first interceptor in the chain.
*/
- public void setFirstInChain(VisitorInterceptor interceptor)
+ public void setFirstInChain(CommandInterceptor interceptor)
{
this.firstInChain = interceptor;
}
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/MarshalledValueInterceptor.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/interceptors/MarshalledValueInterceptor.java 2008-04-28
12:18:52 UTC (rev 5718)
+++
core/trunk/src/main/java/org/jboss/cache/interceptors/MarshalledValueInterceptor.java 2008-04-28
14:00:06 UTC (rev 5719)
@@ -11,7 +11,7 @@
import org.jboss.cache.commands.write.PutKeyValueCommand;
import org.jboss.cache.commands.write.RemoveDataCommand;
import org.jboss.cache.commands.write.RemoveKeyCommand;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
import org.jboss.cache.marshall.MarshalledValue;
import org.jboss.cache.marshall.MarshalledValueHelper;
import org.jboss.cache.marshall.MarshalledValueMap;
@@ -34,7 +34,7 @@
* @see org.jboss.cache.marshall.MarshalledValue
* @since 2.1.0
*/
-public class MarshalledValueInterceptor extends VisitorInterceptor
+public class MarshalledValueInterceptor extends CommandInterceptor
{
@Override
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticInterceptor.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticInterceptor.java 2008-04-28
12:18:52 UTC (rev 5718)
+++
core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticInterceptor.java 2008-04-28
14:00:06 UTC (rev 5719)
@@ -12,7 +12,7 @@
import org.jboss.cache.NodeFactory;
import org.jboss.cache.NodeSPI;
import org.jboss.cache.factories.annotations.Inject;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
import org.jboss.cache.lock.TimeoutException;
import org.jboss.cache.optimistic.TransactionWorkspace;
import org.jboss.cache.optimistic.WorkspaceNode;
@@ -29,7 +29,7 @@
*
* @author <a href="mailto:manik@jboss.org">Manik Surtani
(manik(a)jboss.org)</a>
*/
-public abstract class OptimisticInterceptor extends VisitorInterceptor
+public abstract class OptimisticInterceptor extends CommandInterceptor
{
protected TransactionManager txManager;
protected TransactionTable txTable;
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/PassivationInterceptor.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/interceptors/PassivationInterceptor.java 2008-04-28
12:18:52 UTC (rev 5718)
+++
core/trunk/src/main/java/org/jboss/cache/interceptors/PassivationInterceptor.java 2008-04-28
14:00:06 UTC (rev 5719)
@@ -7,7 +7,7 @@
import org.jboss.cache.commands.write.EvictCommand;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.factories.annotations.Inject;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
import org.jboss.cache.loader.CacheLoader;
import org.jboss.cache.loader.CacheLoaderManager;
import org.jboss.cache.notifications.Notifier;
@@ -24,7 +24,7 @@
* @author <a href="mailto:{hmesha@novell.com}">{Hany Mesha}</a>
* @version $Id$
*/
-public class PassivationInterceptor extends VisitorInterceptor implements
PassivationInterceptorMBean
+public class PassivationInterceptor extends CommandInterceptor implements
PassivationInterceptorMBean
{
private final AtomicLong passivations = new AtomicLong(0);
Copied: core/trunk/src/main/java/org/jboss/cache/interceptors/base/CommandInterceptor.java
(from rev 5714,
core/trunk/src/main/java/org/jboss/cache/interceptors/base/VisitorInterceptor.java)
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/base/CommandInterceptor.java
(rev 0)
+++
core/trunk/src/main/java/org/jboss/cache/interceptors/base/CommandInterceptor.java 2008-04-28
14:00:06 UTC (rev 5719)
@@ -0,0 +1,76 @@
+package org.jboss.cache.interceptors.base;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.cache.InvocationContext;
+import org.jboss.cache.commands.AbstractVisitor;
+import org.jboss.cache.commands.VisitableCommand;
+import org.jboss.cache.interceptors.InterceptorMBean;
+
+import java.util.Collections;
+import java.util.Map;
+
+/**
+ * @author Mircea.Markus(a)jboss.com
+ * @since 2.2
+ */
+public class CommandInterceptor extends AbstractVisitor implements InterceptorMBean
+{
+ private boolean statsEnabled = false;
+
+ private CommandInterceptor next;
+
+ protected Log log;
+ protected boolean trace;
+
+ public CommandInterceptor()
+ {
+ log = LogFactory.getLog(getClass());
+ trace = log.isTraceEnabled();
+ }
+
+ public boolean getStatisticsEnabled()
+ {
+ return statsEnabled;
+ }
+
+ public void setStatisticsEnabled(boolean enabled)
+ {
+ statsEnabled = enabled;
+ }
+
+ public Map<String, Object> dumpStatistics()
+ {
+ return Collections.emptyMap();
+ }
+
+ public void resetStatistics()
+ {
+ }
+
+ public CommandInterceptor getNext()
+ {
+ return next;
+ }
+
+ public boolean hasNext()
+ {
+ return getNext() != null;
+ }
+
+ public void setNext(CommandInterceptor next)
+ {
+ this.next = next;
+ }
+
+ public Object invokeNextInterceptor(InvocationContext ctx, VisitableCommand command)
throws Throwable
+ {
+ return command.acceptVisitor(ctx, getNext());
+ }
+
+ @Override
+ public Object handleDefault(InvocationContext ctx, VisitableCommand command) throws
Throwable
+ {
+ return invokeNextInterceptor(ctx, command);
+ }
+}
Deleted:
core/trunk/src/main/java/org/jboss/cache/interceptors/base/VisitorInterceptor.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/interceptors/base/VisitorInterceptor.java 2008-04-28
12:18:52 UTC (rev 5718)
+++
core/trunk/src/main/java/org/jboss/cache/interceptors/base/VisitorInterceptor.java 2008-04-28
14:00:06 UTC (rev 5719)
@@ -1,76 +0,0 @@
-package org.jboss.cache.interceptors.base;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.InvocationContext;
-import org.jboss.cache.commands.AbstractVisitor;
-import org.jboss.cache.commands.VisitableCommand;
-import org.jboss.cache.interceptors.InterceptorMBean;
-
-import java.util.Collections;
-import java.util.Map;
-
-/**
- * @author Mircea.Markus(a)jboss.com
- * @since 2.2
- */
-public class VisitorInterceptor extends AbstractVisitor implements InterceptorMBean
-{
- private boolean statsEnabled = false;
-
- private VisitorInterceptor next;
-
- protected Log log;
- protected boolean trace;
-
- public VisitorInterceptor()
- {
- log = LogFactory.getLog(getClass());
- trace = log.isTraceEnabled();
- }
-
- public boolean getStatisticsEnabled()
- {
- return statsEnabled;
- }
-
- public void setStatisticsEnabled(boolean enabled)
- {
- statsEnabled = enabled;
- }
-
- public Map<String, Object> dumpStatistics()
- {
- return Collections.emptyMap();
- }
-
- public void resetStatistics()
- {
- }
-
- public VisitorInterceptor getNext()
- {
- return next;
- }
-
- public boolean hasNext()
- {
- return getNext() != null;
- }
-
- public void setNext(VisitorInterceptor next)
- {
- this.next = next;
- }
-
- public Object invokeNextInterceptor(InvocationContext ctx, VisitableCommand command)
throws Throwable
- {
- return command.acceptVisitor(ctx, getNext());
- }
-
- @Override
- public Object handleDefault(InvocationContext ctx, VisitableCommand command) throws
Throwable
- {
- return invokeNextInterceptor(ctx, command);
- }
-}
Modified:
core/trunk/src/main/java/org/jboss/cache/invocation/AbstractInvocationDelegate.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/invocation/AbstractInvocationDelegate.java 2008-04-28
12:18:52 UTC (rev 5718)
+++
core/trunk/src/main/java/org/jboss/cache/invocation/AbstractInvocationDelegate.java 2008-04-28
14:00:06 UTC (rev 5719)
@@ -16,7 +16,7 @@
* <p/>
*
* @author Manik Surtani (<a
href="mailto:manik@jboss.org">manik@jboss.org</a>)
- * @see org.jboss.cache.interceptors.base.VisitorInterceptor
+ * @see org.jboss.cache.interceptors.base.CommandInterceptor
* @see org.jboss.cache.InvocationContext
* @since 2.1.0
*/
Modified:
core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java 2008-04-28
12:18:52 UTC (rev 5718)
+++
core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java 2008-04-28
14:00:06 UTC (rev 5719)
@@ -19,7 +19,7 @@
import org.jboss.cache.config.Option;
import org.jboss.cache.factories.CommandsFactory;
import org.jboss.cache.factories.annotations.Inject;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
import org.jboss.cache.loader.CacheLoaderManager;
import org.jboss.cache.marshall.Marshaller;
import org.jboss.cache.notifications.Notifier;
@@ -116,17 +116,17 @@
return transactionManager;
}
- public void addInterceptor(VisitorInterceptor i, int position)
+ public void addInterceptor(CommandInterceptor i, int position)
{
invoker.addInterceptor(i, position);
}
- public void addInterceptor(VisitorInterceptor i, Class<? extends
VisitorInterceptor> afterInterceptor)
+ public void addInterceptor(CommandInterceptor i, Class<? extends
CommandInterceptor> afterInterceptor)
{
invoker.addInterceptor(i, afterInterceptor);
}
- public List<VisitorInterceptor> getInterceptorChain()
+ public List<CommandInterceptor> getInterceptorChain()
{
return invoker.getInterceptorsAsList();
}
@@ -136,7 +136,7 @@
invoker.removeInterceptor(position);
}
- public void removeInterceptor(Class<? extends VisitorInterceptor>
interceptorType)
+ public void removeInterceptor(Class<? extends CommandInterceptor>
interceptorType)
{
invoker.removeInterceptor(interceptorType);
}
Modified: core/trunk/src/main/java/org/jboss/cache/util/CachePrinter.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/util/CachePrinter.java 2008-04-28 12:18:52
UTC (rev 5718)
+++ core/trunk/src/main/java/org/jboss/cache/util/CachePrinter.java 2008-04-28 14:00:06
UTC (rev 5719)
@@ -3,7 +3,7 @@
import org.jboss.cache.Cache;
import org.jboss.cache.CacheSPI;
import org.jboss.cache.DataContainer;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
import org.jboss.cache.invocation.CacheInvocationDelegate;
/**
@@ -45,7 +45,7 @@
StringBuilder b = new StringBuilder();
int index = 0;
b.append("\n");
- for (VisitorInterceptor i : cache.getInterceptorChain())
+ for (CommandInterceptor i : cache.getInterceptorChain())
{
b.append("# ");
b.append(index);
@@ -57,7 +57,7 @@
return b.toString();
}
- public static String printInterceptorChain(VisitorInterceptor i)
+ public static String printInterceptorChain(CommandInterceptor i)
{
StringBuffer sb = new StringBuffer();
if (i != null)
Modified: core/trunk/src/test/java/org/jboss/cache/api/NodeAPITest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/NodeAPITest.java 2008-04-28 12:18:52 UTC
(rev 5718)
+++ core/trunk/src/test/java/org/jboss/cache/api/NodeAPITest.java 2008-04-28 14:00:06 UTC
(rev 5719)
@@ -7,7 +7,7 @@
import org.jboss.cache.config.Configuration;
import org.jboss.cache.interceptors.OptimisticNodeInterceptor;
import org.jboss.cache.interceptors.PessimisticLockInterceptor;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
import org.jboss.cache.optimistic.TransactionWorkspace;
import org.jboss.cache.transaction.OptimisticTransactionEntry;
import static org.testng.AssertJUnit.*;
@@ -82,7 +82,7 @@
assert cache.getConfiguration().isNodeLockingOptimistic();
boolean interceptorChainOK = false;
- for (VisitorInterceptor i : cache.getInterceptorChain())
+ for (CommandInterceptor i : cache.getInterceptorChain())
{
if (i instanceof PessimisticLockInterceptor) assert false : "Not an
optimistic locking chain!!";
if (i instanceof OptimisticNodeInterceptor) interceptorChainOK = true;
Modified: core/trunk/src/test/java/org/jboss/cache/loader/SharedCacheLoaderTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/loader/SharedCacheLoaderTest.java 2008-04-28
12:18:52 UTC (rev 5718)
+++ core/trunk/src/test/java/org/jboss/cache/loader/SharedCacheLoaderTest.java 2008-04-28
14:00:06 UTC (rev 5719)
@@ -9,7 +9,7 @@
import org.jboss.cache.CacheSPI;
import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.interceptors.CacheStoreInterceptor;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
import static org.testng.AssertJUnit.assertEquals;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
@@ -56,7 +56,7 @@
CacheStoreInterceptor csi = null;
while (ints.hasNext())
{
- VisitorInterceptor i = (VisitorInterceptor) ints.next();
+ CommandInterceptor i = (CommandInterceptor) ints.next();
if (i instanceof CacheStoreInterceptor)
{
csi = (CacheStoreInterceptor) i;
Modified:
core/trunk/src/test/java/org/jboss/cache/optimistic/AbstractOptimisticTestCase.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/optimistic/AbstractOptimisticTestCase.java 2008-04-28
12:18:52 UTC (rev 5718)
+++
core/trunk/src/test/java/org/jboss/cache/optimistic/AbstractOptimisticTestCase.java 2008-04-28
14:00:06 UTC (rev 5719)
@@ -19,7 +19,7 @@
import org.jboss.cache.interceptors.OptimisticLockingInterceptor;
import org.jboss.cache.interceptors.OptimisticNodeInterceptor;
import org.jboss.cache.interceptors.OptimisticValidatorInterceptor;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
import org.jboss.cache.loader.DummyInMemoryCacheLoader;
import org.jboss.cache.loader.DummySharedInMemoryCacheLoader;
import org.jboss.cache.lock.IsolationLevel;
@@ -262,7 +262,7 @@
}
}
- protected void setAlteredInterceptorChain(VisitorInterceptor newLast,
CacheSPI<Object, Object> spi)
+ protected void setAlteredInterceptorChain(CommandInterceptor newLast,
CacheSPI<Object, Object> spi)
{
spi.removeInterceptor(CacheMgmtInterceptor.class);
spi.removeInterceptor(NotificationInterceptor.class);
Modified:
core/trunk/src/test/java/org/jboss/cache/optimistic/ConcurrentTransactionTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/optimistic/ConcurrentTransactionTest.java 2008-04-28
12:18:52 UTC (rev 5718)
+++
core/trunk/src/test/java/org/jboss/cache/optimistic/ConcurrentTransactionTest.java 2008-04-28
14:00:06 UTC (rev 5719)
@@ -14,7 +14,7 @@
import org.jboss.cache.commands.tx.OptimisticPrepareCommand;
import org.jboss.cache.interceptors.OptimisticCreateIfNotExistsInterceptor;
import org.jboss.cache.interceptors.TxInterceptor;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
import org.jboss.cache.misc.TestingUtil;
import static org.testng.AssertJUnit.*;
import org.testng.annotations.AfterMethod;
@@ -256,7 +256,7 @@
{
final String slowThreadName = "SLOW";
final String fastThreadName = "FAST";
- VisitorInterceptor slowdownInterceptor = new VisitorInterceptor()
+ CommandInterceptor slowdownInterceptor = new CommandInterceptor()
{
public Object handleDefault(InvocationContext ctx, VisitableCommand command)
throws Throwable
{
@@ -292,7 +292,7 @@
{
final String slowThreadName = "SLOW";
final String fastThreadName = "FAST";
- VisitorInterceptor slowdownInterceptor = new VisitorInterceptor()
+ CommandInterceptor slowdownInterceptor = new CommandInterceptor()
{
public Object hanldeDefault(InvocationContext ctx, VisitableCommand command)
throws Throwable
{
Modified: core/trunk/src/test/java/org/jboss/cache/optimistic/MockFailureInterceptor.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/optimistic/MockFailureInterceptor.java 2008-04-28
12:18:52 UTC (rev 5718)
+++
core/trunk/src/test/java/org/jboss/cache/optimistic/MockFailureInterceptor.java 2008-04-28
14:00:06 UTC (rev 5719)
@@ -3,7 +3,7 @@
import org.jboss.cache.InvocationContext;
import org.jboss.cache.commands.ReplicableCommand;
import org.jboss.cache.commands.VisitableCommand;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
import java.util.ArrayList;
import java.util.List;
@@ -16,7 +16,7 @@
* @version $Id: CreateIfNotExistsInterceptor.java,v 1.7 2005/01/26 11:45:14
* belaban Exp $
*/
-public class MockFailureInterceptor extends VisitorInterceptor
+public class MockFailureInterceptor extends CommandInterceptor
{
private List<Class<? extends ReplicableCommand>> allCalled = new
ArrayList<Class<? extends ReplicableCommand>>();
private List<Class<? extends ReplicableCommand>> failurelist = new
ArrayList<Class<? extends ReplicableCommand>>();
Modified: core/trunk/src/test/java/org/jboss/cache/optimistic/MockInterceptor.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/optimistic/MockInterceptor.java 2008-04-28
12:18:52 UTC (rev 5718)
+++ core/trunk/src/test/java/org/jboss/cache/optimistic/MockInterceptor.java 2008-04-28
14:00:06 UTC (rev 5719)
@@ -3,7 +3,7 @@
import org.jboss.cache.InvocationContext;
import org.jboss.cache.commands.ReplicableCommand;
import org.jboss.cache.commands.VisitableCommand;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
import java.util.ArrayList;
import java.util.List;
@@ -16,7 +16,7 @@
* @version $Id: CreateIfNotExistsInterceptor.java,v 1.7 2005/01/26 11:45:14
* belaban Exp $
*/
-public class MockInterceptor extends VisitorInterceptor
+public class MockInterceptor extends CommandInterceptor
{
ReplicableCommand calledCommand;
private List<Class<? extends ReplicableCommand>> calledlist = new
ArrayList<Class<? extends ReplicableCommand>>();
Modified:
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorGetChildrenNamesTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorGetChildrenNamesTest.java 2008-04-28
12:18:52 UTC (rev 5718)
+++
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorGetChildrenNamesTest.java 2008-04-28
14:00:06 UTC (rev 5719)
@@ -5,7 +5,7 @@
import org.jboss.cache.factories.ComponentRegistry;
import org.jboss.cache.interceptors.OptimisticCreateIfNotExistsInterceptor;
import org.jboss.cache.interceptors.OptimisticNodeInterceptor;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
import org.jboss.cache.loader.SamplePojo;
import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.transaction.GlobalTransaction;
@@ -39,9 +39,9 @@
ComponentRegistry cr = TestingUtil.extractComponentRegistry(cache);
- VisitorInterceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
+ CommandInterceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
cr.registerComponent(interceptor, OptimisticCreateIfNotExistsInterceptor.class);
- VisitorInterceptor nodeInterceptor = new OptimisticNodeInterceptor();
+ CommandInterceptor nodeInterceptor = new OptimisticNodeInterceptor();
cr.registerComponent(nodeInterceptor, OptimisticNodeInterceptor.class);
dummy = new MockInterceptor();
cr.registerComponent(dummy, MockInterceptor.class);
Modified:
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorGetKeyValTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorGetKeyValTest.java 2008-04-28
12:18:52 UTC (rev 5718)
+++
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorGetKeyValTest.java 2008-04-28
14:00:06 UTC (rev 5719)
@@ -4,7 +4,7 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.interceptors.OptimisticCreateIfNotExistsInterceptor;
import org.jboss.cache.interceptors.OptimisticNodeInterceptor;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
import org.jboss.cache.loader.SamplePojo;
import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.transaction.GlobalTransaction;
@@ -35,8 +35,8 @@
listener = new TestListener();
cache = createCacheWithListener(listener);
- VisitorInterceptor interceptor = TestingUtil.findInterceptor(cache,
OptimisticCreateIfNotExistsInterceptor.class);
- VisitorInterceptor nodeInterceptor = TestingUtil.findInterceptor(cache,
OptimisticNodeInterceptor.class);
+ CommandInterceptor interceptor = TestingUtil.findInterceptor(cache,
OptimisticCreateIfNotExistsInterceptor.class);
+ CommandInterceptor nodeInterceptor = TestingUtil.findInterceptor(cache,
OptimisticNodeInterceptor.class);
dummy = new MockInterceptor();
interceptor.setNext(nodeInterceptor);
Modified:
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorGetKeysTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorGetKeysTest.java 2008-04-28
12:18:52 UTC (rev 5718)
+++
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorGetKeysTest.java 2008-04-28
14:00:06 UTC (rev 5719)
@@ -4,7 +4,7 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.interceptors.OptimisticCreateIfNotExistsInterceptor;
import org.jboss.cache.interceptors.OptimisticNodeInterceptor;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
import org.jboss.cache.loader.SamplePojo;
import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.transaction.GlobalTransaction;
@@ -35,8 +35,8 @@
listener = new TestListener();
cache = createCacheWithListener(listener);
- VisitorInterceptor interceptor = TestingUtil.findInterceptor(cache,
OptimisticCreateIfNotExistsInterceptor.class);
- VisitorInterceptor nodeInterceptor = TestingUtil.findInterceptor(cache,
OptimisticNodeInterceptor.class);
+ CommandInterceptor interceptor = TestingUtil.findInterceptor(cache,
OptimisticCreateIfNotExistsInterceptor.class);
+ CommandInterceptor nodeInterceptor = TestingUtil.findInterceptor(cache,
OptimisticNodeInterceptor.class);
dummy = new MockInterceptor();
interceptor.setNext(nodeInterceptor);
Modified:
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorKeyValTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorKeyValTest.java 2008-04-28
12:18:52 UTC (rev 5718)
+++
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorKeyValTest.java 2008-04-28
14:00:06 UTC (rev 5719)
@@ -4,7 +4,7 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.interceptors.OptimisticCreateIfNotExistsInterceptor;
import org.jboss.cache.interceptors.OptimisticNodeInterceptor;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
import org.jboss.cache.loader.SamplePojo;
import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.transaction.GlobalTransaction;
@@ -35,8 +35,8 @@
listener = new TestListener();
cache = createCacheWithListener(listener);
- VisitorInterceptor interceptor = TestingUtil.findInterceptor(cache,
OptimisticCreateIfNotExistsInterceptor.class);
- VisitorInterceptor nodeInterceptor = TestingUtil.findInterceptor(cache,
OptimisticNodeInterceptor.class);
+ CommandInterceptor interceptor = TestingUtil.findInterceptor(cache,
OptimisticCreateIfNotExistsInterceptor.class);
+ CommandInterceptor nodeInterceptor = TestingUtil.findInterceptor(cache,
OptimisticNodeInterceptor.class);
dummy = new MockInterceptor();
interceptor.setNext(nodeInterceptor);
Modified:
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorPutEraseTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorPutEraseTest.java 2008-04-28
12:18:52 UTC (rev 5718)
+++
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorPutEraseTest.java 2008-04-28
14:00:06 UTC (rev 5719)
@@ -4,7 +4,7 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.interceptors.OptimisticCreateIfNotExistsInterceptor;
import org.jboss.cache.interceptors.OptimisticNodeInterceptor;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
import org.jboss.cache.loader.SamplePojo;
import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.transaction.GlobalTransaction;
@@ -38,8 +38,8 @@
listener = new TestListener();
cache = createCacheWithListener(listener);
- VisitorInterceptor interceptor = TestingUtil.findInterceptor(cache,
OptimisticCreateIfNotExistsInterceptor.class);
- VisitorInterceptor nodeInterceptor = TestingUtil.findInterceptor(cache,
OptimisticNodeInterceptor.class);
+ CommandInterceptor interceptor = TestingUtil.findInterceptor(cache,
OptimisticCreateIfNotExistsInterceptor.class);
+ CommandInterceptor nodeInterceptor = TestingUtil.findInterceptor(cache,
OptimisticNodeInterceptor.class);
dummy = new MockInterceptor();
interceptor.setNext(nodeInterceptor);
Modified:
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorPutMapTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorPutMapTest.java 2008-04-28
12:18:52 UTC (rev 5718)
+++
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorPutMapTest.java 2008-04-28
14:00:06 UTC (rev 5719)
@@ -4,7 +4,7 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.interceptors.OptimisticCreateIfNotExistsInterceptor;
import org.jboss.cache.interceptors.OptimisticNodeInterceptor;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
import org.jboss.cache.loader.SamplePojo;
import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.transaction.GlobalTransaction;
@@ -38,8 +38,8 @@
listener = new TestListener();
cache = createCacheWithListener(listener);
- VisitorInterceptor interceptor = TestingUtil.findInterceptor(cache,
OptimisticCreateIfNotExistsInterceptor.class);
- VisitorInterceptor nodeInterceptor = TestingUtil.findInterceptor(cache,
OptimisticNodeInterceptor.class);
+ CommandInterceptor interceptor = TestingUtil.findInterceptor(cache,
OptimisticCreateIfNotExistsInterceptor.class);
+ CommandInterceptor nodeInterceptor = TestingUtil.findInterceptor(cache,
OptimisticNodeInterceptor.class);
dummy = new MockInterceptor();
interceptor.setNext(nodeInterceptor);
Modified:
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorRemoveDataTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorRemoveDataTest.java 2008-04-28
12:18:52 UTC (rev 5718)
+++
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorRemoveDataTest.java 2008-04-28
14:00:06 UTC (rev 5719)
@@ -4,7 +4,7 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.interceptors.OptimisticCreateIfNotExistsInterceptor;
import org.jboss.cache.interceptors.OptimisticNodeInterceptor;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
import org.jboss.cache.loader.SamplePojo;
import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.transaction.GlobalTransaction;
@@ -38,8 +38,8 @@
listener = new TestListener();
cache = createCacheWithListener(listener);
- VisitorInterceptor interceptor = TestingUtil.findInterceptor(cache,
OptimisticCreateIfNotExistsInterceptor.class);
- VisitorInterceptor nodeInterceptor = TestingUtil.findInterceptor(cache,
OptimisticNodeInterceptor.class);
+ CommandInterceptor interceptor = TestingUtil.findInterceptor(cache,
OptimisticCreateIfNotExistsInterceptor.class);
+ CommandInterceptor nodeInterceptor = TestingUtil.findInterceptor(cache,
OptimisticNodeInterceptor.class);
dummy = new MockInterceptor();
interceptor.setNext(nodeInterceptor);
Modified:
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorRemoveKeyValTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorRemoveKeyValTest.java 2008-04-28
12:18:52 UTC (rev 5718)
+++
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorRemoveKeyValTest.java 2008-04-28
14:00:06 UTC (rev 5719)
@@ -10,7 +10,7 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.interceptors.OptimisticCreateIfNotExistsInterceptor;
import org.jboss.cache.interceptors.OptimisticNodeInterceptor;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
import org.jboss.cache.loader.SamplePojo;
import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.transaction.GlobalTransaction;
@@ -44,8 +44,8 @@
listener = new TestListener();
cache = createCacheWithListener(listener);
- VisitorInterceptor interceptor = TestingUtil.findInterceptor(cache,
OptimisticCreateIfNotExistsInterceptor.class);
- VisitorInterceptor nodeInterceptor = TestingUtil.findInterceptor(cache,
OptimisticNodeInterceptor.class);
+ CommandInterceptor interceptor = TestingUtil.findInterceptor(cache,
OptimisticCreateIfNotExistsInterceptor.class);
+ CommandInterceptor nodeInterceptor = TestingUtil.findInterceptor(cache,
OptimisticNodeInterceptor.class);
dummy = new MockInterceptor();
interceptor.setNext(nodeInterceptor);
Modified:
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorTransactionTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorTransactionTest.java 2008-04-28
12:18:52 UTC (rev 5718)
+++
core/trunk/src/test/java/org/jboss/cache/optimistic/NodeInterceptorTransactionTest.java 2008-04-28
14:00:06 UTC (rev 5719)
@@ -9,7 +9,7 @@
import org.jboss.cache.CacheSPI;
import org.jboss.cache.interceptors.OptimisticCreateIfNotExistsInterceptor;
import org.jboss.cache.interceptors.OptimisticNodeInterceptor;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
import org.jboss.cache.misc.TestingUtil;
import static org.testng.AssertJUnit.*;
import org.testng.annotations.Test;
@@ -27,8 +27,8 @@
TestListener listener = new TestListener();
final CacheSPI cache = createCacheWithListener(listener);
- VisitorInterceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
- VisitorInterceptor nodeInterceptor = new OptimisticNodeInterceptor();
+ CommandInterceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
+ CommandInterceptor nodeInterceptor = new OptimisticNodeInterceptor();
MockInterceptor dummy = new MockInterceptor();
interceptor.setNext(nodeInterceptor);
@@ -56,8 +56,8 @@
TestListener listener = new TestListener();
final CacheSPI cache = createCacheWithListener(listener);
- VisitorInterceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
- VisitorInterceptor nodeInterceptor = new OptimisticNodeInterceptor();
+ CommandInterceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
+ CommandInterceptor nodeInterceptor = new OptimisticNodeInterceptor();
MockInterceptor dummy = new MockInterceptor();
interceptor.setNext(nodeInterceptor);
Modified:
core/trunk/src/test/java/org/jboss/cache/optimistic/OptimisticCreateIfNotExistsInterceptorTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/optimistic/OptimisticCreateIfNotExistsInterceptorTest.java 2008-04-28
12:18:52 UTC (rev 5718)
+++
core/trunk/src/test/java/org/jboss/cache/optimistic/OptimisticCreateIfNotExistsInterceptorTest.java 2008-04-28
14:00:06 UTC (rev 5719)
@@ -10,7 +10,7 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.commands.write.PutKeyValueCommand;
import org.jboss.cache.interceptors.OptimisticCreateIfNotExistsInterceptor;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
import org.jboss.cache.loader.SamplePojo;
import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.transaction.DummyTransactionManager;
@@ -64,7 +64,7 @@
TestListener listener = new TestListener();
final CacheSPI cache = createCacheWithListener(listener);
- VisitorInterceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
+ CommandInterceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
MockInterceptor dummy = new MockInterceptor();
interceptor.setNext(dummy);
@@ -96,7 +96,7 @@
TestListener listener = new TestListener();
final CacheSPI cache = createCacheWithListener(listener);
- VisitorInterceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
+ CommandInterceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
MockInterceptor dummy = new MockInterceptor();
interceptor.setNext(dummy);
@@ -139,7 +139,7 @@
TestListener listener = new TestListener();
final CacheSPI cache = createCacheWithListener(listener);
- VisitorInterceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
+ CommandInterceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
MockInterceptor dummy = new MockInterceptor();
interceptor.setNext(dummy);
TestingUtil.replaceInterceptorChain(cache, interceptor);
Modified:
core/trunk/src/test/java/org/jboss/cache/optimistic/ThreadedOptimisticCreateIfNotExistsInterceptorTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/optimistic/ThreadedOptimisticCreateIfNotExistsInterceptorTest.java 2008-04-28
12:18:52 UTC (rev 5718)
+++
core/trunk/src/test/java/org/jboss/cache/optimistic/ThreadedOptimisticCreateIfNotExistsInterceptorTest.java 2008-04-28
14:00:06 UTC (rev 5719)
@@ -9,7 +9,7 @@
import org.jboss.cache.CacheSPI;
import org.jboss.cache.Fqn;
import org.jboss.cache.interceptors.OptimisticCreateIfNotExistsInterceptor;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
import org.jboss.cache.loader.SamplePojo;
import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.transaction.DummyTransactionManager;
@@ -48,8 +48,8 @@
TestListener listener = new TestListener();
final CacheSPI<Object, Object> cache = createCacheWithListener(listener);
- VisitorInterceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
- VisitorInterceptor dummy = new MockInterceptor();
+ CommandInterceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
+ CommandInterceptor dummy = new MockInterceptor();
interceptor.setNext(dummy);
TestingUtil.replaceInterceptorChain(cache, interceptor);
@@ -112,8 +112,8 @@
TestListener listener = new TestListener();
final CacheSPI<Object, Object> cache = createCacheWithListener(listener);
- VisitorInterceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
- VisitorInterceptor dummy = new MockInterceptor();
+ CommandInterceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
+ CommandInterceptor dummy = new MockInterceptor();
interceptor.setNext(dummy);
TestingUtil.replaceInterceptorChain(cache, interceptor);
Modified:
core/trunk/src/test/java/org/jboss/cache/optimistic/ValidatorInterceptorTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/optimistic/ValidatorInterceptorTest.java 2008-04-28
12:18:52 UTC (rev 5718)
+++
core/trunk/src/test/java/org/jboss/cache/optimistic/ValidatorInterceptorTest.java 2008-04-28
14:00:06 UTC (rev 5719)
@@ -18,7 +18,7 @@
import org.jboss.cache.interceptors.OptimisticCreateIfNotExistsInterceptor;
import org.jboss.cache.interceptors.OptimisticNodeInterceptor;
import org.jboss.cache.interceptors.OptimisticValidatorInterceptor;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
import org.jboss.cache.loader.SamplePojo;
import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.transaction.GlobalTransaction;
@@ -53,10 +53,10 @@
cache = createCacheWithListener();
mgr = cache.getTransactionManager();
- VisitorInterceptor ici = TestingUtil.findInterceptor(cache,
InvocationContextInterceptor.class);
- VisitorInterceptor validateInterceptor = TestingUtil.findInterceptor(cache,
OptimisticValidatorInterceptor.class);
- VisitorInterceptor interceptor = TestingUtil.findInterceptor(cache,
OptimisticCreateIfNotExistsInterceptor.class);
- VisitorInterceptor nodeInterceptor = TestingUtil.findInterceptor(cache,
OptimisticNodeInterceptor.class);
+ CommandInterceptor ici = TestingUtil.findInterceptor(cache,
InvocationContextInterceptor.class);
+ CommandInterceptor validateInterceptor = TestingUtil.findInterceptor(cache,
OptimisticValidatorInterceptor.class);
+ CommandInterceptor interceptor = TestingUtil.findInterceptor(cache,
OptimisticCreateIfNotExistsInterceptor.class);
+ CommandInterceptor nodeInterceptor = TestingUtil.findInterceptor(cache,
OptimisticNodeInterceptor.class);
dummy = new MockInterceptor();
ici.setNext(validateInterceptor);
validateInterceptor.setNext(interceptor);
@@ -389,7 +389,7 @@
mgr.commit();
}
- public static class ResetRemoteFlagInterceptor extends VisitorInterceptor
+ public static class ResetRemoteFlagInterceptor extends CommandInterceptor
{
public Object handleDefault(InvocationContext ctx, VisitableCommand command) throws
Throwable
{