[jbosscache-commits] JBoss Cache SVN: r5720 - in core/trunk/src: main/java/org/jboss/cache/jmx and 6 other directories.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Mon Apr 28 10:00:46 EDT 2008


Author: manik.surtani at jboss.com
Date: 2008-04-28 10:00:46 -0400 (Mon, 28 Apr 2008)
New Revision: 5720

Modified:
   core/trunk/src/main/java/org/jboss/cache/interceptors/base/PostProcessingChainedInterceptor.java
   core/trunk/src/main/java/org/jboss/cache/interceptors/base/SkipCheckChainedInterceptor.java
   core/trunk/src/main/java/org/jboss/cache/jmx/CacheJmxWrapper.java
   core/trunk/src/main/java/org/jboss/cache/jmx/JmxUtil.java
   core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicationConfigTest.java
   core/trunk/src/test/java/org/jboss/cache/factories/CustomInterceptorChainTest.java
   core/trunk/src/test/java/org/jboss/cache/factories/InterceptorChainFactoryTest.java
   core/trunk/src/test/java/org/jboss/cache/factories/InterceptorChainTestBase.java
   core/trunk/src/test/java/org/jboss/cache/invocation/InterceptorChainTest.java
   core/trunk/src/test/java/org/jboss/cache/marshall/MarshalledValueTest.java
   core/trunk/src/test/java/org/jboss/cache/mgmt/MgmtCoreTest.java
   core/trunk/src/test/java/org/jboss/cache/misc/TestingUtil.java
Log:
More refactoring

Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/base/PostProcessingChainedInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/base/PostProcessingChainedInterceptor.java	2008-04-28 14:00:06 UTC (rev 5719)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/base/PostProcessingChainedInterceptor.java	2008-04-28 14:00:46 UTC (rev 5720)
@@ -29,7 +29,7 @@
  * @author Mircea.Markus at jboss.com
  * @since 2.2
  */
-public abstract class PostProcessingChainedInterceptor extends VisitorInterceptor
+public abstract class PostProcessingChainedInterceptor extends CommandInterceptor
 {
    @Override
    public final Object handlePutDataMapCommand(InvocationContext ctx, PutDataMapCommand command) throws Throwable

Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/base/SkipCheckChainedInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/base/SkipCheckChainedInterceptor.java	2008-04-28 14:00:06 UTC (rev 5719)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/base/SkipCheckChainedInterceptor.java	2008-04-28 14:00:46 UTC (rev 5720)
@@ -30,7 +30,7 @@
  * @author Mircea.Markus at jboss.com
  * @since 2.2
  */
-public abstract class SkipCheckChainedInterceptor extends VisitorInterceptor
+public abstract class SkipCheckChainedInterceptor extends CommandInterceptor
 {
    @Override
    public final Object handlePutDataMapCommand(InvocationContext ctx, PutDataMapCommand command) throws Throwable

Modified: core/trunk/src/main/java/org/jboss/cache/jmx/CacheJmxWrapper.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/jmx/CacheJmxWrapper.java	2008-04-28 14:00:06 UTC (rev 5719)
+++ core/trunk/src/main/java/org/jboss/cache/jmx/CacheJmxWrapper.java	2008-04-28 14:00:46 UTC (rev 5720)
@@ -36,7 +36,7 @@
 import org.jboss.cache.config.EvictionConfig;
 import org.jboss.cache.config.RuntimeConfig;
 import org.jboss.cache.factories.XmlConfigurationParser;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
 import org.jboss.cache.util.CachePrinter;
 import org.jgroups.Address;
 import org.jgroups.Channel;
@@ -936,7 +936,7 @@
       if (registerInterceptors && !interceptorsRegistered && server != null)
       {
          log.debug("Registering interceptors");
-         List<VisitorInterceptor> interc = cache.getInterceptorChain();
+         List<CommandInterceptor> interc = cache.getInterceptorChain();
          if (interc != null && interc.size() > 0)
          {
             try

Modified: core/trunk/src/main/java/org/jboss/cache/jmx/JmxUtil.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/jmx/JmxUtil.java	2008-04-28 14:00:06 UTC (rev 5719)
+++ core/trunk/src/main/java/org/jboss/cache/jmx/JmxUtil.java	2008-04-28 14:00:46 UTC (rev 5720)
@@ -22,7 +22,7 @@
 package org.jboss.cache.jmx;
 
 import org.jboss.cache.config.Configuration;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
 
 import javax.management.JMException;
 import javax.management.MBeanServer;
@@ -68,7 +68,7 @@
     * @param cache the cache having the set of interceptors to be registered
     * @param registerCache whether the cache itself should be registered
     */
-   public static void registerInterceptors(MBeanServer server, List<VisitorInterceptor> interceptors, String cacheObjectName)
+   public static void registerInterceptors(MBeanServer server, List<CommandInterceptor> interceptors, String cacheObjectName)
          throws JMException
    {
       if (server == null || interceptors == null || cacheObjectName == null)
@@ -76,7 +76,7 @@
          return;
       }
 
-      for (VisitorInterceptor interceptor : interceptors)
+      for (CommandInterceptor interceptor : interceptors)
       {
          if (!interceptor.getStatisticsEnabled())
             continue;
@@ -153,7 +153,7 @@
    * @param cache the cache having the set of interceptors to be unregistered
    * @param unregisterCache whether the cache itself should be unregistered
    */
-   public static void unregisterInterceptors(MBeanServer server, List<VisitorInterceptor> interceptors, String cacheObjectName)
+   public static void unregisterInterceptors(MBeanServer server, List<CommandInterceptor> interceptors, String cacheObjectName)
          throws Exception
    {
       if (server == null || interceptors == null || cacheObjectName == null)
@@ -161,7 +161,7 @@
          return;
       }
 
-      for (VisitorInterceptor interceptor : interceptors)
+      for (CommandInterceptor interceptor : interceptors)
       {
          // for JDK 1.4, must parse name and remove package prefix
          // for JDK 1.5, can use getSimpleName() to establish class name without package prefix

Modified: core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicationConfigTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicationConfigTest.java	2008-04-28 14:00:06 UTC (rev 5719)
+++ core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicationConfigTest.java	2008-04-28 14:00:46 UTC (rev 5720)
@@ -13,7 +13,7 @@
 import org.jboss.cache.config.Configuration;
 import org.jboss.cache.factories.XmlConfigurationParser;
 import org.jboss.cache.interceptors.DataGravitatorInterceptor;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
 import org.jboss.cache.xml.XmlHelper;
 import static org.testng.AssertJUnit.*;
 import org.testng.annotations.AfterMethod;
@@ -92,7 +92,7 @@
 
       // test Data Gravitator
       boolean hasDG = false;
-      for (VisitorInterceptor interceptor : cache.getInterceptorChain())
+      for (CommandInterceptor interceptor : cache.getInterceptorChain())
       {
          hasDG = hasDG || (interceptor instanceof DataGravitatorInterceptor);
       }

Modified: core/trunk/src/test/java/org/jboss/cache/factories/CustomInterceptorChainTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/factories/CustomInterceptorChainTest.java	2008-04-28 14:00:06 UTC (rev 5719)
+++ core/trunk/src/test/java/org/jboss/cache/factories/CustomInterceptorChainTest.java	2008-04-28 14:00:46 UTC (rev 5720)
@@ -3,7 +3,7 @@
 import org.jboss.cache.CacheSPI;
 import org.jboss.cache.DefaultCacheFactory;
 import org.jboss.cache.config.Configuration;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
 import static org.testng.AssertJUnit.assertEquals;
 import static org.testng.AssertJUnit.fail;
 import org.testng.annotations.AfterMethod;
@@ -53,11 +53,11 @@
 
    public void testInjectionAtHead()
    {
-      List<VisitorInterceptor> interceptors = cache.getInterceptorChain();
+      List<CommandInterceptor> interceptors = cache.getInterceptorChain();
       assertEquals("Expecting 6 interceptors", 6, interceptors.size());
       assertInterceptorLinkage(interceptors);
 
-      VisitorInterceptor x = new TestInterceptor();
+      CommandInterceptor x = new TestInterceptor();
       cache.addInterceptor(x, 0);
 
       interceptors = cache.getInterceptorChain();
@@ -69,11 +69,11 @@
 
    public void testInjectionAtTail()
    {
-      List<VisitorInterceptor> interceptors = cache.getInterceptorChain();
+      List<CommandInterceptor> interceptors = cache.getInterceptorChain();
       assertEquals("Expecting 6 interceptors", 6, interceptors.size());
       assertInterceptorLinkage(interceptors);
 
-      VisitorInterceptor x = new TestInterceptor();
+      CommandInterceptor x = new TestInterceptor();
       cache.addInterceptor(x, 6);
 
       interceptors = cache.getInterceptorChain();
@@ -85,11 +85,11 @@
 
    public void testInjectionInMiddle()
    {
-      List<VisitorInterceptor> interceptors = cache.getInterceptorChain();
+      List<CommandInterceptor> interceptors = cache.getInterceptorChain();
       assertEquals("Expecting 6 interceptors", 6, interceptors.size());
       assertInterceptorLinkage(interceptors);
 
-      VisitorInterceptor x = new TestInterceptor();
+      CommandInterceptor x = new TestInterceptor();
       cache.addInterceptor(x, 3);
 
       interceptors = cache.getInterceptorChain();
@@ -101,11 +101,11 @@
 
    public void testInjectionBeyondTail()
    {
-      List<VisitorInterceptor> interceptors = cache.getInterceptorChain();
+      List<CommandInterceptor> interceptors = cache.getInterceptorChain();
       assertEquals("Expecting 6 interceptors", 6, interceptors.size());
       assertInterceptorLinkage(interceptors);
 
-      VisitorInterceptor x = new TestInterceptor();
+      CommandInterceptor x = new TestInterceptor();
       try
       {
          cache.addInterceptor(x, 9);
@@ -119,8 +119,8 @@
 
    public void testRemoveAtHead()
    {
-      List<VisitorInterceptor> interceptors = cache.getInterceptorChain();
-      VisitorInterceptor afterHead = interceptors.get(1);
+      List<CommandInterceptor> interceptors = cache.getInterceptorChain();
+      CommandInterceptor afterHead = interceptors.get(1);
       assertEquals("Expecting 6 interceptors", 6, interceptors.size());
       assertInterceptorLinkage(interceptors);
 
@@ -135,8 +135,8 @@
 
    public void testRemoveAtTail()
    {
-      List<VisitorInterceptor> interceptors = cache.getInterceptorChain();
-      VisitorInterceptor beforeTail = interceptors.get(4);
+      List<CommandInterceptor> interceptors = cache.getInterceptorChain();
+      CommandInterceptor beforeTail = interceptors.get(4);
       assertEquals("Expecting 6 interceptors", 6, interceptors.size());
       assertInterceptorLinkage(interceptors);
 
@@ -154,7 +154,7 @@
 
    public void testRemoveAtMiddle()
    {
-      List<VisitorInterceptor> interceptors = cache.getInterceptorChain();
+      List<CommandInterceptor> interceptors = cache.getInterceptorChain();
       assertEquals("Expecting 6 interceptors", 6, interceptors.size());
       assertInterceptorLinkage(interceptors);
 
@@ -167,7 +167,7 @@
 
    public void testRemoveBeyondTail()
    {
-      List<VisitorInterceptor> interceptors = cache.getInterceptorChain();
+      List<CommandInterceptor> interceptors = cache.getInterceptorChain();
       assertEquals("Expecting 6 interceptors", 6, interceptors.size());
       assertInterceptorLinkage(interceptors);
 
@@ -183,7 +183,7 @@
    }
 
 
-   public static class TestInterceptor extends VisitorInterceptor
+   public static class TestInterceptor extends CommandInterceptor
    {
    }
 }

Modified: core/trunk/src/test/java/org/jboss/cache/factories/InterceptorChainFactoryTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/factories/InterceptorChainFactoryTest.java	2008-04-28 14:00:06 UTC (rev 5719)
+++ core/trunk/src/test/java/org/jboss/cache/factories/InterceptorChainFactoryTest.java	2008-04-28 14:00:46 UTC (rev 5720)
@@ -7,7 +7,7 @@
 import org.jboss.cache.config.CacheLoaderConfig;
 import org.jboss.cache.config.EvictionConfig;
 import org.jboss.cache.interceptors.*;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
 import org.jboss.cache.misc.TestingUtil;
 import org.jboss.cache.xml.XmlHelper;
 import static org.testng.AssertJUnit.assertEquals;
@@ -47,8 +47,8 @@
    {
       cache.getConfiguration().setExposeManagementStatistics(false);
       InterceptorChain chain = getInterceptorChainFactory(cache).buildInterceptorChain();
-      List<VisitorInterceptor> list = chain.asList();
-      Iterator<VisitorInterceptor> interceptors = list.iterator();
+      List<CommandInterceptor> list = chain.asList();
+      Iterator<CommandInterceptor> interceptors = list.iterator();
 
       System.out.println("testBareConfig interceptors are:\n" + list);
       assertNotNull(list);
@@ -70,8 +70,8 @@
       cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
 
       InterceptorChain chain = getInterceptorChainFactory(cache).buildInterceptorChain();
-      List<VisitorInterceptor> list = chain.asList();
-      Iterator<VisitorInterceptor> interceptors = list.iterator();
+      List<CommandInterceptor> list = chain.asList();
+      Iterator<CommandInterceptor> interceptors = list.iterator();
 
       System.out.println("testTxConfig interceptors are:\n" + list);
       assertNotNull(list);
@@ -117,8 +117,8 @@
       cache.getConfiguration().setFetchInMemoryState(false);
       cache.create();
       InterceptorChain chain = getInterceptorChainFactory(cache).buildInterceptorChain();
-      List<VisitorInterceptor> list = chain.asList();
-      Iterator<VisitorInterceptor> interceptors = list.iterator();
+      List<CommandInterceptor> list = chain.asList();
+      Iterator<CommandInterceptor> interceptors = list.iterator();
 
       System.out.println("testSharedCacheLoaderConfig interceptors are:\n" + list);
       assertNotNull(list);
@@ -146,8 +146,8 @@
       cache.getConfiguration().setFetchInMemoryState(false);
       cache.create();
       InterceptorChain chain = getInterceptorChainFactory(cache).buildInterceptorChain();
-      List<VisitorInterceptor> list = chain.asList();
-      Iterator<VisitorInterceptor> interceptors = list.iterator();
+      List<CommandInterceptor> list = chain.asList();
+      Iterator<CommandInterceptor> interceptors = list.iterator();
 
       System.out.println("testUnsharedCacheLoaderConfig interceptors are:\n" + list);
       assertNotNull(list);
@@ -172,8 +172,8 @@
       cache.getConfiguration().setCacheMode("repl_sync");
       cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
       InterceptorChain chain = getInterceptorChainFactory(cache).buildInterceptorChain();
-      List<VisitorInterceptor> list = chain.asList();
-      Iterator<VisitorInterceptor> interceptors = list.iterator();
+      List<CommandInterceptor> list = chain.asList();
+      Iterator<CommandInterceptor> interceptors = list.iterator();
 
       System.out.println("testTxAndRepl interceptors are:\n" + list);
       assertNotNull(list);
@@ -197,8 +197,8 @@
       cache.getConfiguration().setNodeLockingOptimistic(true);
 
       InterceptorChain chain = getInterceptorChainFactory(cache).buildInterceptorChain();
-      List<VisitorInterceptor> list = chain.asList();
-      Iterator<VisitorInterceptor> interceptors = list.iterator();
+      List<CommandInterceptor> list = chain.asList();
+      Iterator<CommandInterceptor> interceptors = list.iterator();
 
       assertEquals(8, list.size());
 
@@ -221,8 +221,8 @@
       cache.getConfiguration().setCacheMode("REPL_SYNC");
 
       InterceptorChain chain = getInterceptorChainFactory(cache).buildInterceptorChain();
-      List<VisitorInterceptor> list = chain.asList();
-      Iterator<VisitorInterceptor> interceptors = list.iterator();
+      List<CommandInterceptor> list = chain.asList();
+      Iterator<CommandInterceptor> interceptors = list.iterator();
 
       assertEquals(9, list.size());
 
@@ -246,8 +246,8 @@
       cache.getConfiguration().setCacheLoaderConfig(getCacheLoaderConfig(false, false));
       cache.create();
       InterceptorChain chain = getInterceptorChainFactory(cache).buildInterceptorChain();
-      List<VisitorInterceptor> list = chain.asList();
-      Iterator<VisitorInterceptor> interceptors = list.iterator();
+      List<CommandInterceptor> list = chain.asList();
+      Iterator<CommandInterceptor> interceptors = list.iterator();
 
       assertEquals(10, list.size());
 
@@ -272,8 +272,8 @@
       cache.getConfiguration().setCacheLoaderConfig(getCacheLoaderConfig(true, false));
       cache.create();
       InterceptorChain chain = getInterceptorChainFactory(cache).buildInterceptorChain();
-      List<VisitorInterceptor> list = chain.asList();
-      Iterator<VisitorInterceptor> interceptors = list.iterator();
+      List<CommandInterceptor> list = chain.asList();
+      Iterator<CommandInterceptor> interceptors = list.iterator();
 
       assertEquals(10, list.size());
 
@@ -297,8 +297,8 @@
       cache.getConfiguration().setCacheMode("REPL_ASYNC");
 
       InterceptorChain chain = getInterceptorChainFactory(cache).buildInterceptorChain();
-      List<VisitorInterceptor> list = chain.asList();
-      Iterator<VisitorInterceptor> interceptors = list.iterator();
+      List<CommandInterceptor> list = chain.asList();
+      Iterator<CommandInterceptor> interceptors = list.iterator();
 
       assertEquals(6, list.size());
 
@@ -334,8 +334,8 @@
    {
       cache.getConfiguration().setExposeManagementStatistics(true);
       InterceptorChain chain = getInterceptorChainFactory(cache).buildInterceptorChain();
-      List<VisitorInterceptor> list = chain.asList();
-      Iterator<VisitorInterceptor> interceptors = list.iterator();
+      List<CommandInterceptor> list = chain.asList();
+      Iterator<CommandInterceptor> interceptors = list.iterator();
 
       System.out.println("testCacheMgmtConfig interceptors are:\n" + list);
       assertNotNull(list);
@@ -365,8 +365,8 @@
       }
       );
       InterceptorChain chain = getInterceptorChainFactory(cache).buildInterceptorChain();
-      List<VisitorInterceptor> list = chain.asList();
-      Iterator<VisitorInterceptor> interceptors = list.iterator();
+      List<CommandInterceptor> list = chain.asList();
+      Iterator<CommandInterceptor> interceptors = list.iterator();
 
       System.out.println("testEvictionInterceptorConfig interceptors are:\n" + list);
       assertNotNull(list);
@@ -400,8 +400,8 @@
       cache.getConfiguration().setNodeLockingScheme("OPTIMISTIC");
       cache.create();// initialise various subsystems such as BRManager
       InterceptorChain chain = getInterceptorChainFactory(cache).buildInterceptorChain();
-      List<VisitorInterceptor> list = chain.asList();
-      Iterator<VisitorInterceptor> interceptors = list.iterator();
+      List<CommandInterceptor> list = chain.asList();
+      Iterator<CommandInterceptor> interceptors = list.iterator();
 
       System.out.println("testEvictionInterceptorConfig interceptors are:\n" + list);
       assertNotNull(list);
@@ -438,8 +438,8 @@
       cache.getConfiguration().setCacheMode("REPL_SYNC");
       cache.create();// initialise various subsystems such as BRManager
       InterceptorChain chain = getInterceptorChainFactory(cache).buildInterceptorChain();
-      List<VisitorInterceptor> list = chain.asList();
-      Iterator<VisitorInterceptor> interceptors = list.iterator();
+      List<CommandInterceptor> list = chain.asList();
+      Iterator<CommandInterceptor> interceptors = list.iterator();
 
       System.out.println("testEvictionInterceptorConfig interceptors are:\n" + list);
       assertNotNull(list);

Modified: core/trunk/src/test/java/org/jboss/cache/factories/InterceptorChainTestBase.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/factories/InterceptorChainTestBase.java	2008-04-28 14:00:06 UTC (rev 5719)
+++ core/trunk/src/test/java/org/jboss/cache/factories/InterceptorChainTestBase.java	2008-04-28 14:00:46 UTC (rev 5720)
@@ -1,6 +1,6 @@
 package org.jboss.cache.factories;
 
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
 import static org.testng.AssertJUnit.assertEquals;
 
 import java.util.List;
@@ -10,10 +10,10 @@
  */
 public abstract class InterceptorChainTestBase
 {
-   protected void assertInterceptorLinkage(List<VisitorInterceptor> list)
+   protected void assertInterceptorLinkage(List<CommandInterceptor> list)
    {
-      VisitorInterceptor previous = null;
-      for (VisitorInterceptor i : list)
+      CommandInterceptor previous = null;
+      for (CommandInterceptor i : list)
       {
          if (previous == null)
          {

Modified: core/trunk/src/test/java/org/jboss/cache/invocation/InterceptorChainTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/invocation/InterceptorChainTest.java	2008-04-28 14:00:06 UTC (rev 5719)
+++ core/trunk/src/test/java/org/jboss/cache/invocation/InterceptorChainTest.java	2008-04-28 14:00:46 UTC (rev 5720)
@@ -6,7 +6,7 @@
 import org.jboss.cache.interceptors.InvocationContextInterceptor;
 import org.jboss.cache.interceptors.PessimisticLockInterceptor;
 import org.jboss.cache.interceptors.TxInterceptor;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
@@ -22,11 +22,11 @@
 @Test(groups = {"functional"})
 public class InterceptorChainTest
 {
-   private VisitorInterceptor icInterceptor;
-   private VisitorInterceptor invalidationInterceptor;
-   private VisitorInterceptor txInterceptor;
-   private VisitorInterceptor pessimisticInterceptor;
-   private VisitorInterceptor callInterceptor;
+   private CommandInterceptor icInterceptor;
+   private CommandInterceptor invalidationInterceptor;
+   private CommandInterceptor txInterceptor;
+   private CommandInterceptor pessimisticInterceptor;
+   private CommandInterceptor callInterceptor;
    private InterceptorChain chain;
 
    @BeforeMethod
@@ -47,7 +47,7 @@
       pessimisticInterceptor.setNext(callInterceptor);
 
       InterceptorChain chain = new InterceptorChain(invalidationInterceptor);
-      List<VisitorInterceptor> expectedList = new ArrayList<VisitorInterceptor>();
+      List<CommandInterceptor> expectedList = new ArrayList<CommandInterceptor>();
       expectedList.add(invalidationInterceptor);
       expectedList.add(txInterceptor);
       expectedList.add(pessimisticInterceptor);
@@ -156,7 +156,7 @@
       assert txInterceptor.getNext().equals(invalidationInterceptor);
    }
 
-   private VisitorInterceptor create(Class<? extends VisitorInterceptor> toInstantiate)
+   private CommandInterceptor create(Class<? extends CommandInterceptor> toInstantiate)
    {
       try
       {

Modified: core/trunk/src/test/java/org/jboss/cache/marshall/MarshalledValueTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/marshall/MarshalledValueTest.java	2008-04-28 14:00:06 UTC (rev 5719)
+++ core/trunk/src/test/java/org/jboss/cache/marshall/MarshalledValueTest.java	2008-04-28 14:00:46 UTC (rev 5720)
@@ -12,7 +12,7 @@
 import org.jboss.cache.factories.ComponentRegistry;
 import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
 import org.jboss.cache.interceptors.MarshalledValueInterceptor;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
 import org.jboss.cache.loader.DummyInMemoryCacheLoader;
 import org.jboss.cache.misc.TestingUtil;
 import org.jboss.cache.notifications.annotation.CacheListener;
@@ -320,7 +320,7 @@
       }
    }
 
-   class MarshalledValueListenerInterceptor extends VisitorInterceptor
+   class MarshalledValueListenerInterceptor extends CommandInterceptor
    {
       int invocationCount = 0;
 

Modified: core/trunk/src/test/java/org/jboss/cache/mgmt/MgmtCoreTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/mgmt/MgmtCoreTest.java	2008-04-28 14:00:06 UTC (rev 5719)
+++ core/trunk/src/test/java/org/jboss/cache/mgmt/MgmtCoreTest.java	2008-04-28 14:00:46 UTC (rev 5720)
@@ -5,7 +5,7 @@
 import org.jboss.cache.Fqn;
 import org.jboss.cache.config.Configuration;
 import org.jboss.cache.interceptors.CacheMgmtInterceptor;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
 import static org.testng.AssertJUnit.*;
 import org.testng.annotations.AfterMethod;
 import org.testng.annotations.BeforeMethod;
@@ -231,13 +231,13 @@
 
    private CacheMgmtInterceptor getCacheMgmtInterceptor()
    {
-      List<VisitorInterceptor> interceptors = cache.getInterceptorChain();
+      List<CommandInterceptor> interceptors = cache.getInterceptorChain();
       if (interceptors.isEmpty())
       {
          return null;
       }
 
-      for (VisitorInterceptor interceptor : interceptors)
+      for (CommandInterceptor interceptor : interceptors)
       {
          if (interceptor instanceof CacheMgmtInterceptor)
          {

Modified: core/trunk/src/test/java/org/jboss/cache/misc/TestingUtil.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/misc/TestingUtil.java	2008-04-28 14:00:06 UTC (rev 5719)
+++ core/trunk/src/test/java/org/jboss/cache/misc/TestingUtil.java	2008-04-28 14:00:46 UTC (rev 5720)
@@ -16,7 +16,7 @@
 import org.jboss.cache.factories.CommandsFactory;
 import org.jboss.cache.factories.ComponentRegistry;
 import org.jboss.cache.interceptors.InterceptorChain;
-import org.jboss.cache.interceptors.base.VisitorInterceptor;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
 import org.jboss.cache.invocation.CacheInvocationDelegate;
 import org.jboss.cache.loader.CacheLoader;
 import org.jboss.cache.loader.CacheLoaderManager;
@@ -75,9 +75,9 @@
       }
    }
 
-   public static <T extends VisitorInterceptor> T findInterceptor(CacheSPI<?, ?> cache, Class<T> interceptorToFind)
+   public static <T extends CommandInterceptor> T findInterceptor(CacheSPI<?, ?> cache, Class<T> interceptorToFind)
    {
-      for (VisitorInterceptor i : cache.getInterceptorChain())
+      for (CommandInterceptor i : cache.getInterceptorChain())
       {
          if (interceptorToFind.isInstance(i)) return interceptorToFind.cast(i);
       }
@@ -93,7 +93,7 @@
     * @param interceptorToInject           interceptor instance to inject.
     * @param interceptorAfterWhichToInject class of interceptor to search for in the chain and after which to add your interceptor
     */
-   public static void injectInterceptor(CacheSPI<?, ?> cache, VisitorInterceptor interceptorToInject, Class<? extends VisitorInterceptor> interceptorAfterWhichToInject)
+   public static void injectInterceptor(CacheSPI<?, ?> cache, CommandInterceptor interceptorToInject, Class<? extends CommandInterceptor> interceptorAfterWhichToInject)
    {
       cache.addInterceptor(interceptorToInject, interceptorAfterWhichToInject);
    }
@@ -498,11 +498,11 @@
     * @param cache       cache that needs to be altered
     * @param interceptor the first interceptor in the new chain.
     */
-   public static void replaceInterceptorChain(CacheSPI<?, ?> cache, VisitorInterceptor interceptor)
+   public static void replaceInterceptorChain(CacheSPI<?, ?> cache, CommandInterceptor interceptor)
    {
       ComponentRegistry cr = extractComponentRegistry(cache);
       // make sure all interceptors here are wired.
-      VisitorInterceptor i = interceptor;
+      CommandInterceptor i = interceptor;
       do
       {
          cr.wireDependencies(i);




More information about the jbosscache-commits mailing list