JBoss Cache SVN: r5723 - in core/trunk/src: main/java/org/jboss/cache/interceptors and 12 other directories.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-04-28 10:53:03 -0400 (Mon, 28 Apr 2008)
New Revision: 5723
Modified:
core/trunk/src/main/java/org/jboss/cache/DataContainer.java
core/trunk/src/main/java/org/jboss/cache/interceptors/ActivationInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/CacheLoaderInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/InterceptorChain.java
core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java
core/trunk/src/main/java/org/jboss/cache/loader/jdbm/JdbmCacheLoader.java
core/trunk/src/main/java/org/jboss/cache/lock/LockUtil.java
core/trunk/src/main/java/org/jboss/cache/marshall/NodeData.java
core/trunk/src/main/java/org/jboss/cache/transaction/TransactionEntry.java
core/trunk/src/test/java/org/jboss/cache/api/ResidentNodesTest.java
core/trunk/src/test/java/org/jboss/cache/lock/NonBlockingWriterLockTest.java
core/trunk/src/test/java/org/jboss/cache/lock/pessimistic/ConcurrentPutRemoveTest.java
core/trunk/src/test/java/org/jboss/cache/manager/CacheManagerTest.java
core/trunk/src/test/java/org/jboss/cache/multiplexer/BadMuxConfigTest.java
core/trunk/src/test/java/org/jboss/cache/passivation/PassivationActivationCallbacksTestCase.java
core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransfer200Test.java
Log:
more refactoring
Modified: core/trunk/src/main/java/org/jboss/cache/DataContainer.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/DataContainer.java 2008-04-28 14:31:25 UTC (rev 5722)
+++ core/trunk/src/main/java/org/jboss/cache/DataContainer.java 2008-04-28 14:53:03 UTC (rev 5723)
@@ -538,27 +538,6 @@
return new Object[]{result, n};
}
- /**
- * Returns true if a node has all children loaded and initialized.
- * todo - this belongs to NodeSPI, should be moved in 3.x
- */
- public boolean allInitialized(NodeSPI<?, ?> n)
- {
- if (!n.isChildrenLoaded())
- {
- return false;
- }
- for (NodeSPI child : n.getChildrenDirect())
- {
- if (!child.isDataLoaded())
- {
- return false;
- }
- }
- return true;
-
- }
-
public void createNodesLocally(Fqn<?> fqn, Map<?, ?> data) throws CacheException
{
int treeNodeSize;
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/ActivationInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/ActivationInterceptor.java 2008-04-28 14:31:25 UTC (rev 5722)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/ActivationInterceptor.java 2008-04-28 14:53:03 UTC (rev 5723)
@@ -1,6 +1,5 @@
package org.jboss.cache.interceptors;
-import org.jboss.cache.DataContainer;
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.Modification;
@@ -18,8 +17,7 @@
import org.jboss.cache.commands.write.RemoveKeyCommand;
import org.jboss.cache.commands.write.RemoveNodeCommand;
import org.jboss.cache.factories.annotations.Inject;
-import org.jboss.cache.loader.CacheLoader;
-import org.jboss.cache.notifications.Notifier;
+import org.jboss.cache.factories.annotations.Start;
import org.jboss.cache.transaction.GlobalTransaction;
import org.jboss.cache.transaction.TransactionEntry;
@@ -46,6 +44,7 @@
protected TransactionManager txMgr = null;
private long activations = 0;
+ ActivationModificationsBuilder builder;
/**
* List<Transaction> that we have registered for
@@ -65,6 +64,12 @@
this.txMgr = txMgr;
}
+ @Start
+ public void createModificationsBuilder()
+ {
+ builder = new ActivationModificationsBuilder();
+ }
+
@Override
public Object handleRemoveDataCommand(InvocationContext ctx, RemoveDataCommand command) throws Throwable
{
@@ -155,7 +160,7 @@
// node not null and attributes have been loaded?
if (!n.getChildrenDirect().isEmpty())
{
- boolean result = dataContainer.allInitialized(n);
+ boolean result = childrenLoaded(n);
if (result)
{
log.debug("children all initialized");
@@ -170,6 +175,23 @@
}
}
+ private static boolean childrenLoaded(NodeSPI<?, ?> node)
+ {
+ if (!node.isChildrenLoaded())
+ {
+ return false;
+ }
+ for (NodeSPI child : node.getChildrenDirect())
+ {
+ if (!child.isDataLoaded())
+ {
+ return false;
+ }
+ }
+ return true;
+
+ }
+
@Override
public Object handleOptimisticPrepareCommand(InvocationContext ctx, OptimisticPrepareCommand command) throws Throwable
{
@@ -258,7 +280,7 @@
throw new Exception("entry for transaction " + gtx + " not found in transaction table");
}
List<Modification> cacheLoaderModifications = new ArrayList<Modification>();
- ActivationModificationsBuilder builder = new ActivationModificationsBuilder(dataContainer, loader, notifier);
+
builder.visitCollection(null, entry.getCacheLoaderModifications());
if (cacheLoaderModifications.size() > 0)
{
@@ -266,22 +288,12 @@
}
}
- public static class ActivationModificationsBuilder extends AbstractVisitor
+ public class ActivationModificationsBuilder extends AbstractVisitor
{
private List<Modification> cacheLoaderModifications = new ArrayList<Modification>();
- private DataContainer dataContainer;
- private CacheLoader loader;
- private Notifier notifier;
private int txActs = 0;
- public ActivationModificationsBuilder(DataContainer dataContainer, CacheLoader loader, Notifier notifier)
- {
- this.dataContainer = dataContainer;
- this.loader = loader;
- this.notifier = notifier;
- }
-
@Override
public Object handleRemoveNodeCommand(InvocationContext ctx, RemoveNodeCommand removeNodeCommand) throws Throwable
{
@@ -313,7 +325,7 @@
if (n != null && n.isDataLoaded())
{
// has children?
- boolean result = dataContainer.allInitialized(n);
+ boolean result = childrenLoaded(n);
if (!n.getChildrenDirect().isEmpty() && result)
{
// children have been loaded, remove the node
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 14:31:25 UTC (rev 5722)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/CacheLoaderInterceptor.java 2008-04-28 14:53:03 UTC (rev 5723)
@@ -5,6 +5,7 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.NodeSPI;
+import org.jboss.cache.commands.ReversibleCommand;
import org.jboss.cache.commands.read.GetChildrenNamesCommand;
import org.jboss.cache.commands.read.GetDataMapCommand;
import org.jboss.cache.commands.read.GetKeyValueCommand;
@@ -440,12 +441,14 @@
*/
private boolean wasRemovedInTx(Fqn fqn, GlobalTransaction t)
{
- if (t == null)
+ if (t == null) return false;
+ TransactionEntry entry = txTable.get(t);
+
+ for (ReversibleCommand txCacheCommand : entry.getCacheLoaderModifications())
{
- return false;
+ if (txCacheCommand instanceof RemoveNodeCommand && fqn.isChildOrEquals(txCacheCommand.getFqn())) return true;
}
- TransactionEntry entry = txTable.get(t);
- return entry.wasRemovedInTx(fqn);
+ return false;
}
/**
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 14:31:25 UTC (rev 5722)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/InterceptorChain.java 2008-04-28 14:53:03 UTC (rev 5723)
@@ -21,7 +21,6 @@
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
-// TODO: Move to org.jboss.cache.interceptors
public class InterceptorChain
{
/**
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 14:31:25 UTC (rev 5722)
+++ core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java 2008-04-28 14:53:03 UTC (rev 5723)
@@ -43,7 +43,6 @@
*
* @author Manik Surtani (<a href="mailto:manik@jboss.org">manik(a)jboss.org</a>)
* @since 2.1.0
- * todo [mmarkus] consider renaming this as it does not look as an Delegate (rather as a facade)
*/
@SuppressWarnings("unchecked")
public class CacheInvocationDelegate<K, V> extends AbstractInvocationDelegate implements CacheSPI<K, V>
Modified: core/trunk/src/main/java/org/jboss/cache/loader/jdbm/JdbmCacheLoader.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/jdbm/JdbmCacheLoader.java 2008-04-28 14:31:25 UTC (rev 5722)
+++ core/trunk/src/main/java/org/jboss/cache/loader/jdbm/JdbmCacheLoader.java 2008-04-28 14:53:03 UTC (rev 5723)
@@ -51,8 +51,7 @@
* N represents a node, K represents a key block. k and v represent key/value
* pairs.
* <p/>
- * TODO the browse operations lock the entire tree; eventually the JDBM team
- * plans to fix this.
+ * The browse operations lock the entire tree; eventually the JDBM team plans to fix this.
*
* @author Elias Ross
* @version $Id$
Modified: core/trunk/src/main/java/org/jboss/cache/lock/LockUtil.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/lock/LockUtil.java 2008-04-28 14:31:25 UTC (rev 5722)
+++ core/trunk/src/main/java/org/jboss/cache/lock/LockUtil.java 2008-04-28 14:53:03 UTC (rev 5723)
@@ -262,7 +262,7 @@
if (gtx == lock.getWriterOwner()
|| lock.getReaderOwners().contains(gtx))
{
- // TODO should we throw an exception??
+ // perhaps we should throw an exception?
lock.release(gtx);
status = TransactionLockStatus.STATUS_BROKEN;
}
Modified: core/trunk/src/main/java/org/jboss/cache/marshall/NodeData.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/marshall/NodeData.java 2008-04-28 14:31:25 UTC (rev 5722)
+++ core/trunk/src/main/java/org/jboss/cache/marshall/NodeData.java 2008-04-28 14:53:03 UTC (rev 5723)
@@ -14,7 +14,7 @@
* @author Bela Ban
* @version $Id$
*/
-// TODO: In 3.0.0, remove Externalizable and rely on the CacheMarshaller.
+// TODO: 3.0.0: remove Externalizable and rely on the CacheMarshaller.
public class NodeData implements Externalizable
{
private Fqn<?> fqn = null;
@@ -63,7 +63,7 @@
return false;
}
- // TODO: Remove in 3.0.0 and replace with marshallNodeData/unmarshallNodeData methods in the CacheMarshaller so that we can use the same marshalling framework for Fqns.
+ // TODO: 3.0.0: Remove and replace with marshallNodeData/unmarshallNodeData methods in the CacheMarshaller so that we can use the same marshalling framework for Fqns.
public void writeExternal(ObjectOutput out) throws IOException
{
out.writeObject(fqn);
@@ -78,7 +78,7 @@
}
}
- // TODO: Remove in 3.0.0 and replace with marshallNodeData/unmarshallNodeData methods in the CacheMarshaller so that we can use the same marshalling framework for Fqns.
+ // TODO: 3.0.0: Remove in and replace with marshallNodeData/unmarshallNodeData methods in the CacheMarshaller so that we can use the same marshalling framework for Fqns.
@SuppressWarnings("unchecked")
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
Modified: core/trunk/src/main/java/org/jboss/cache/transaction/TransactionEntry.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/transaction/TransactionEntry.java 2008-04-28 14:31:25 UTC (rev 5722)
+++ core/trunk/src/main/java/org/jboss/cache/transaction/TransactionEntry.java 2008-04-28 14:53:03 UTC (rev 5723)
@@ -13,7 +13,6 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.Modification;
import org.jboss.cache.commands.ReversibleCommand;
-import org.jboss.cache.commands.write.RemoveNodeCommand;
import org.jboss.cache.config.Option;
import org.jboss.cache.interceptors.OrderedSynchronizationHandler;
import org.jboss.cache.lock.IdentityLock;
@@ -396,19 +395,6 @@
return !modificationList.isEmpty() || !classLoadeModList.isEmpty();
}
- public boolean wasRemovedInTx(Fqn fqn)
- {
- for (ReversibleCommand txCacheCommand : getCacheLoaderModifications())
- {
- //todo - revisit this as it is ugly. phps add an isRemovred(fqn) somwhere on command hierarchy?
- if (txCacheCommand instanceof RemoveNodeCommand && fqn.isChildOrEquals(((RemoveNodeCommand) txCacheCommand).getFqn()))
- {
- return true;
- }
- }
- return false;
- }
-
/**
* Cleans up internal state
*/
Modified: core/trunk/src/test/java/org/jboss/cache/api/ResidentNodesTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/ResidentNodesTest.java 2008-04-28 14:31:25 UTC (rev 5722)
+++ core/trunk/src/test/java/org/jboss/cache/api/ResidentNodesTest.java 2008-04-28 14:53:03 UTC (rev 5723)
@@ -26,7 +26,6 @@
@Test(groups = {"functional"})
public class ResidentNodesTest
{
-
private CacheSPI<Object, Object> cache;
private final String TEST_NODES_ROOT = "residentNodesTest";
Modified: core/trunk/src/test/java/org/jboss/cache/lock/NonBlockingWriterLockTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/lock/NonBlockingWriterLockTest.java 2008-04-28 14:31:25 UTC (rev 5722)
+++ core/trunk/src/test/java/org/jboss/cache/lock/NonBlockingWriterLockTest.java 2008-04-28 14:53:03 UTC (rev 5723)
@@ -27,7 +27,7 @@
* @version 1.0
*/
@Test(groups = {"functional"}, enabled = false)
-// TODO: This is not a very good test. There is a lot of timing related stuff with regards to the order of execution of reader and writer threads that is not taken into account, producing variable results. Needs to be rewritten.
+// TODO: 2.2.0: This is not a very good test. There is a lot of timing related stuff with regards to the order of execution of reader and writer threads that is not taken into account, producing variable results. Needs to be rewritten.
public class NonBlockingWriterLockTest
{
static final NonBlockingWriterLock lock_ = new NonBlockingWriterLock();
Modified: core/trunk/src/test/java/org/jboss/cache/lock/pessimistic/ConcurrentPutRemoveTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/lock/pessimistic/ConcurrentPutRemoveTest.java 2008-04-28 14:31:25 UTC (rev 5722)
+++ core/trunk/src/test/java/org/jboss/cache/lock/pessimistic/ConcurrentPutRemoveTest.java 2008-04-28 14:53:03 UTC (rev 5723)
@@ -61,8 +61,8 @@
}
}
- @Test(invocationCount = 500, enabled = false)
- // TODO: This is still a known failure
+ @Test(invocationCount = 500, enabled = true)
+ // TODO: 3.0.0: This is still a known failure. MVCC in 3.0.0 will fix this; enable it in 3.0.0.
public void testLock() throws Exception
{
System.out.println("ConcurrentPutRemoveTest.testLock count = " + (++count));
Modified: core/trunk/src/test/java/org/jboss/cache/manager/CacheManagerTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/manager/CacheManagerTest.java 2008-04-28 14:31:25 UTC (rev 5722)
+++ core/trunk/src/test/java/org/jboss/cache/manager/CacheManagerTest.java 2008-04-28 14:53:03 UTC (rev 5723)
@@ -7,37 +7,35 @@
package org.jboss.cache.manager;
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertFalse;
-import static org.testng.AssertJUnit.assertNull;
-import static org.testng.AssertJUnit.assertTrue;
-
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
import org.jboss.cache.Cache;
import org.jboss.cache.CacheManagerImpl;
import org.jboss.cache.CacheStatus;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.config.ConfigurationRegistry;
import org.jgroups.JChannelFactory;
+import static org.testng.AssertJUnit.*;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.Test;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
/**
* Tests CacheRegistryImpl.
- *
+ *
* @author Brian Stansberry
*/
@Test(groups = {"functional"})
public class CacheManagerTest
{
- /** A file that includes every configuration element I could think of */
+ /**
+ * A file that includes every configuration element I could think of
+ */
public static final String DEFAULT_CONFIGURATION_FILE = "META-INF/jbc2-configs.xml";
-
+
private Set<Cache<Object, Object>> caches = new HashSet<Cache<Object, Object>>();
-
+
@AfterMethod(alwaysRun = true)
public void tearDown() throws Exception
{
@@ -54,14 +52,13 @@
}
}
}
-
+
/**
* A test that instantiates a CacheRegistryImpl and cycles through all its
* configs, creating and releasing each.
- *
- * TODO It's late; I just put a bunch of stuff in one test method.
- * Refactor or something.
- *
+ * <p/>
+ * TODO: 2.2.0: Break this up into more fine-grained tests
+ *
* @throws Exception
*/
public void testBasic() throws Exception
@@ -70,55 +67,55 @@
cf.setMultiplexerConfig("stacks.xml"); // the default stacks in jgroups.jar
CacheManagerImpl registry = new CacheManagerImpl(DEFAULT_CONFIGURATION_FILE, cf);
registry.start();
-
+
ConfigurationRegistry configRegistry = registry.getConfigurationRegistry();
-
+
Set<String> configNames = registry.getConfigurationNames();
assertEquals(7, configNames.size());
Set<String> cacheNames = registry.getCacheNames();
assertEquals(0, cacheNames.size());
-
+
for (String configName : configNames)
{
assertNull(configName + " not created", registry.getCache(configName, false));
- Cache<Object, Object> cache = registry.getCache(configName, true);
+ Cache<Object, Object> cache = registry.getCache(configName, true);
caches.add(cache);
-
+
// Cache shouldn't be started
assertEquals(CacheStatus.INSTANTIATED, cache.getCacheStatus());
cache.create();
cache.start();
-
+
// Config should be a clone
Configuration rawConfig = configRegistry.getConfiguration(configName);
Configuration realConfig = cache.getConfiguration();
assertFalse(rawConfig == realConfig);
assertEquals(rawConfig.getClusterName(), realConfig.getClusterName());
}
-
+
cacheNames = registry.getCacheNames();
assertEquals(configNames, cacheNames);
-
+
// Test basic releasing of caches
for (String configName : configNames)
{
- registry.releaseCache(configName);
+ registry.releaseCache(configName);
}
-
+
cacheNames = registry.getCacheNames();
assertEquals(0, cacheNames.size());
-
+
// We shouldn't have affected configuration set
Set<String> configNames2 = registry.getConfigurationNames();
assertEquals(configNames, configNames2);
-
+
// Releasing only checkout of cache should have destroyed it
for (Iterator<Cache<Object, Object>> it = caches.iterator(); it.hasNext();)
{
assertEquals(CacheStatus.DESTROYED, it.next().getCacheStatus());
it.remove();
}
-
+
// Get cache w/o asking to create returns null
String configName = configNames.iterator().next();
assertNull(configName + " not created", registry.getCache(configName, false));
@@ -126,30 +123,30 @@
Cache<Object, Object> cache = registry.getCache(configName, true);
assertFalse(null == cache);
caches.add(cache);
-
+
cache.create();
cache.start();
-
+
// Test 2 checkouts of the same cache
- Cache<Object, Object> cache2 = registry.getCache(configName, true);
+ Cache<Object, Object> cache2 = registry.getCache(configName, true);
assertTrue(cache == cache2);
-
+
registry.releaseCache(configName);
-
+
// One release does not cause registry to stop cache
assertEquals(CacheStatus.STARTED, cache.getCacheStatus());
-
+
registry.stop();
-
+
// Now it's stopped
assertEquals(CacheStatus.DESTROYED, cache.getCacheStatus());
caches.remove(cache);
-
+
cacheNames = registry.getCacheNames();
assertEquals(0, cacheNames.size());
assertEquals(cacheNames, registry.getConfigurationNames());
}
-
+
public void testNullConfigResource() throws Exception
{
JChannelFactory cf = new JChannelFactory();
@@ -157,7 +154,7 @@
String configResource = null;
CacheManagerImpl registry = new CacheManagerImpl(configResource, cf);
registry.start();
-
+
assertEquals("No configs", 0, registry.getConfigurationNames().size());
}
}
Modified: core/trunk/src/test/java/org/jboss/cache/multiplexer/BadMuxConfigTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/multiplexer/BadMuxConfigTest.java 2008-04-28 14:31:25 UTC (rev 5722)
+++ core/trunk/src/test/java/org/jboss/cache/multiplexer/BadMuxConfigTest.java 2008-04-28 14:53:03 UTC (rev 5723)
@@ -57,7 +57,7 @@
public void testValidMuxConfig() throws Exception
{
- //todo this test hangs on forever. Uncomment it and make it work...
+ // TODO: 2.2.0: this test hangs on forever. Uncomment it and make it work...
// muxHelper.configureCacheForMux(cache);
//
// checkStart(false, true);
Modified: core/trunk/src/test/java/org/jboss/cache/passivation/PassivationActivationCallbacksTestCase.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/passivation/PassivationActivationCallbacksTestCase.java 2008-04-28 14:31:25 UTC (rev 5722)
+++ core/trunk/src/test/java/org/jboss/cache/passivation/PassivationActivationCallbacksTestCase.java 2008-04-28 14:53:03 UTC (rev 5723)
@@ -202,7 +202,6 @@
try
{
- // TODO Can this cause deadlock in the cache level? Should be ok but need review.
Object bean = cache.get(fqn, "bean");
if (bean != null)
{
Modified: core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransfer200Test.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransfer200Test.java 2008-04-28 14:31:25 UTC (rev 5722)
+++ core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransfer200Test.java 2008-04-28 14:53:03 UTC (rev 5723)
@@ -14,17 +14,12 @@
import org.jboss.cache.buddyreplication.BuddyFqnTransformer;
import org.jboss.cache.buddyreplication.BuddyManager;
import org.jboss.cache.config.BuddyReplicationConfig;
-import org.jboss.cache.factories.XmlConfigurationParser;
import org.jboss.cache.loader.CacheLoader;
import org.jboss.cache.marshall.MarshalledValue;
import org.jboss.cache.misc.TestingUtil;
import static org.testng.AssertJUnit.*;
import org.testng.annotations.Test;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
import java.lang.reflect.Method;
/**
@@ -462,18 +457,9 @@
private BuddyReplicationConfig getBuddyConfig() throws Exception
{
- // TODO just build the object and skip the legacy XML step
- DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
- DocumentBuilder db = dbf.newDocumentBuilder();
- Document doc = db.newDocument();
- Element config = doc.createElement("config");
- doc.appendChild(config);
- Element enabled = doc.createElement("buddyReplicationEnabled");
- enabled.appendChild(doc.createTextNode("true"));
- config.appendChild(enabled);
- Element pool = doc.createElement("buddyPoolName");
- pool.appendChild(doc.createTextNode("TEST"));
- config.appendChild(pool);
- return XmlConfigurationParser.parseBuddyReplicationConfig(config);
+ BuddyReplicationConfig brc = new BuddyReplicationConfig();
+ brc.setEnabled(true);
+ brc.setBuddyPoolName("TEST");
+ return brc;
}
}
16 years, 8 months
JBoss Cache SVN: r5722 - in core/trunk/src: main/java/org/jboss/cache/commands/read and 10 other directories.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-04-28 10:31:25 -0400 (Mon, 28 Apr 2008)
New Revision: 5722
Modified:
core/trunk/src/main/java/org/jboss/cache/LifecycleManager.java
core/trunk/src/main/java/org/jboss/cache/commands/read/AbstractDataCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/read/GetChildrenNamesCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/read/GetDataMapCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/read/GetKeyValueCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/read/GetKeysCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/read/GetNodeCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/read/GravitateDataCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/read/RemoteExistsCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/remote/ClusteredGetCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/remote/DataGravitationCleanupCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/CreateNodeCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/EvictCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/InvalidateCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/MoveCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/PutDataMapCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/PutKeyValueCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveDataCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveKeyCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveNodeCommand.java
core/trunk/src/main/java/org/jboss/cache/factories/CommandsFactory.java
core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java
core/trunk/src/main/java/org/jboss/cache/interceptors/ActivationInterceptor.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/CacheStoreInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/EvictionInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticCreateIfNotExistsInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticNodeInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticValidatorInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/PassivationInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java
core/trunk/src/main/java/org/jboss/cache/lock/LockManager.java
core/trunk/src/main/java/org/jboss/cache/marshall/AbstractMarshaller.java
core/trunk/src/main/java/org/jboss/cache/util/CachePrinter.java
core/trunk/src/test/java/org/jboss/cache/demo/JBossCacheGUI.java
core/trunk/src/test/java/org/jboss/cache/loader/BdbjeCacheLoaderTest.java
Log:
Renamed
Modified: core/trunk/src/main/java/org/jboss/cache/LifecycleManager.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/LifecycleManager.java 2008-04-28 14:03:57 UTC (rev 5721)
+++ core/trunk/src/main/java/org/jboss/cache/LifecycleManager.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -32,7 +32,7 @@
private Notifier notifier;
private RegionManager regionManager;
private NodeFactory nodeFactory;
- private DataContainer cacheData;
+ private DataContainer dataContainer;
private BuddyManager buddyManager;
private RPCManager rpcManager;
private ComponentRegistry componentRegistry;
@@ -49,7 +49,7 @@
this.nodeFactory = nodeFactory;
this.buddyManager = buddyManager;
this.rpcManager = rpcManager;
- this.cacheData = cacheData;
+ this.dataContainer = cacheData;
this.componentRegistry = componentRegistry;
}
@@ -197,7 +197,7 @@
// this will recreate any missing components based on the current config
componentRegistry.updateDependencies();
- componentRegistry.wireDependencies(cacheData.getRoot());
+ componentRegistry.wireDependencies(dataContainer.getRoot());
cacheStatus = CacheStatus.STARTING;
@@ -349,8 +349,8 @@
// unset transaction manager reference
cacheStatus = CacheStatus.STOPPED;
// empty in-memory state
- cacheData.getRoot().clearDataDirect();
- cacheData.getRoot().removeChildrenDirect();
+ dataContainer.getRoot().clearDataDirect();
+ dataContainer.getRoot().removeChildrenDirect();
}
//todo - this should reather be implemented as follows:
@@ -377,10 +377,10 @@
// if we don't already have a root or the new (temp) root is of a different class (optimistic vs pessimistic) to
// the current root, then we use the new one.
- Class currentRootType = cacheData.getRoot() == null ? null : ((NodeInvocationDelegate) cacheData.getRoot()).getDelegationTarget().getClass();
+ Class currentRootType = dataContainer.getRoot() == null ? null : ((NodeInvocationDelegate) dataContainer.getRoot()).getDelegationTarget().getClass();
Class tempRootType = ((NodeInvocationDelegate) tempRoot).getDelegationTarget().getClass();
- if (!tempRootType.equals(currentRootType)) cacheData.setRoot(tempRoot);
+ if (!tempRootType.equals(currentRootType)) dataContainer.setRoot(tempRoot);
}
/**
@@ -427,7 +427,7 @@
buddyManager.init();
if (buddyManager.isEnabled())
{
- cacheData.registerInternalFqn(BuddyManager.BUDDY_BACKUP_SUBTREE_FQN);
+ dataContainer.registerInternalFqn(BuddyManager.BUDDY_BACKUP_SUBTREE_FQN);
}
}
}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/read/AbstractDataCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/read/AbstractDataCommand.java 2008-04-28 14:03:57 UTC (rev 5721)
+++ core/trunk/src/main/java/org/jboss/cache/commands/read/AbstractDataCommand.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -14,12 +14,12 @@
public abstract class AbstractDataCommand implements DataCommand
{
protected Fqn fqn;
- protected DataContainer cacheData;
+ protected DataContainer dataContainer;
@Inject
- public void initialize(DataContainer cacheData)
+ public void initialize(DataContainer dataContainer)
{
- this.cacheData = cacheData;
+ this.dataContainer = dataContainer;
}
public Fqn getFqn()
@@ -63,4 +63,13 @@
result = 31 * result + getClass().hashCode();
return result;
}
+
+ @Override
+ public String toString()
+ {
+ return getClass().getSimpleName() +
+ "{" +
+ "fqn=" + fqn +
+ '}';
+ }
}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/read/GetChildrenNamesCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/read/GetChildrenNamesCommand.java 2008-04-28 14:03:57 UTC (rev 5721)
+++ core/trunk/src/main/java/org/jboss/cache/commands/read/GetChildrenNamesCommand.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -30,7 +30,7 @@
public Object perform(InvocationContext ctx)
{
- NodeSPI n = cacheData.findNode(fqn);
+ NodeSPI n = dataContainer.findNode(fqn);
if (n == null) return null;
Set childNames = new HashSet();
Map childrenMap = n.getChildrenMapDirect();
@@ -59,12 +59,4 @@
{
return METHOD_ID;
}
-
- @Override
- public String toString()
- {
- return "GetChildrenNamesCommand{" +
- "fqn=" + fqn +
- "}";
- }
}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/read/GetDataMapCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/read/GetDataMapCommand.java 2008-04-28 14:03:57 UTC (rev 5721)
+++ core/trunk/src/main/java/org/jboss/cache/commands/read/GetDataMapCommand.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -28,7 +28,7 @@
public Object perform(InvocationContext ctx)
{
- NodeSPI n = cacheData.findNode(fqn);
+ NodeSPI n = dataContainer.findNode(fqn);
if (n == null) return null;
return Collections.unmodifiableMap(n.getDataDirect());
}
@@ -42,13 +42,4 @@
{
return METHOD_ID;
}
-
- @Override
- public String toString()
- {
- return "GetDataMapCommand{" +
- "cacheData=" + cacheData +
- ", fqn=" + fqn +
- '}';
- }
}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/read/GetKeyValueCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/read/GetKeyValueCommand.java 2008-04-28 14:03:57 UTC (rev 5721)
+++ core/trunk/src/main/java/org/jboss/cache/commands/read/GetKeyValueCommand.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -52,7 +52,7 @@
append(sendNodeEvent).append("\")"));
}
if (sendNodeEvent) notifier.notifyNodeVisited(fqn, true, ctx);
- NodeSPI n = cacheData.findNode(fqn);
+ NodeSPI n = dataContainer.findNode(fqn);
if (n == null)
{
log.trace("node not found");
Modified: core/trunk/src/main/java/org/jboss/cache/commands/read/GetKeysCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/read/GetKeysCommand.java 2008-04-28 14:03:57 UTC (rev 5721)
+++ core/trunk/src/main/java/org/jboss/cache/commands/read/GetKeysCommand.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -29,7 +29,7 @@
public Object perform(InvocationContext ctx)
{
- NodeSPI n = cacheData.findNode(fqn);
+ NodeSPI n = dataContainer.findNode(fqn);
if (n == null)
{
return null;
@@ -47,12 +47,4 @@
{
return METHOD_ID;
}
-
- @Override
- public String toString()
- {
- return "GetKeysCommand{" +
- "fqn=" + fqn +
- "}";
- }
}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/read/GetNodeCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/read/GetNodeCommand.java 2008-04-28 14:03:57 UTC (rev 5721)
+++ core/trunk/src/main/java/org/jboss/cache/commands/read/GetNodeCommand.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -25,7 +25,7 @@
public Object perform(InvocationContext ctx)
{
- return cacheData.findNode(fqn);
+ return dataContainer.findNode(fqn);
}
public Object acceptVisitor(InvocationContext ctx, Visitor visitor) throws Throwable
@@ -37,12 +37,4 @@
{
return METHOD_ID;
}
-
- @Override
- public String toString()
- {
- return "GetNodeCommand{" +
- "fqn=" + fqn +
- "}";
- }
}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/read/GravitateDataCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/read/GravitateDataCommand.java 2008-04-28 14:03:57 UTC (rev 5721)
+++ core/trunk/src/main/java/org/jboss/cache/commands/read/GravitateDataCommand.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -77,7 +77,7 @@
if (actualNode == null && searchSubtrees)
{
log.trace("Looking at backup trees.");
- NodeSPI backupSubtree = cacheData.findNode(BuddyManager.BUDDY_BACKUP_SUBTREE_FQN);
+ NodeSPI backupSubtree = dataContainer.findNode(BuddyManager.BUDDY_BACKUP_SUBTREE_FQN);
if (backupSubtree != null)
{
// need to loop through backupSubtree's children
@@ -144,7 +144,7 @@
backupNodeFqn = BuddyFqnTransformer.getBackupFqn(BuddyFqnTransformer.getGroupNameFromAddress(rpcManager.getLocalAddress()), fqn);
}
- List<NodeData> list = cacheData.getNodeData(new LinkedList<NodeData>(), (NodeSPI) actualNode);
+ List<NodeData> list = dataContainer.getNodeData(new LinkedList<NodeData>(), (NodeSPI) actualNode);
return GravitateResult.subtreeResult(list, backupNodeFqn);
}
@@ -213,7 +213,7 @@
public String toString()
{
return "GravitateDataCommand{" +
- "rpcManager=" + rpcManager +
+ "fqn=" + fqn +
", searchSubtrees=" + searchSubtrees +
'}';
}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/read/RemoteExistsCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/read/RemoteExistsCommand.java 2008-04-28 14:03:57 UTC (rev 5721)
+++ core/trunk/src/main/java/org/jboss/cache/commands/read/RemoteExistsCommand.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -32,7 +32,7 @@
public Object perform(InvocationContext ctx)
{
- Node n = cacheData.peek(fqn, false);
+ Node n = dataContainer.peek(fqn, false);
return n != null;
}
@@ -45,10 +45,4 @@
{
return METHOD_ID;
}
-
- @Override
- public String toString()
- {
- return "RemoteExistsNodeCommand{}";
- }
}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/remote/ClusteredGetCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/remote/ClusteredGetCommand.java 2008-04-28 14:03:57 UTC (rev 5721)
+++ core/trunk/src/main/java/org/jboss/cache/commands/remote/ClusteredGetCommand.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -23,9 +23,9 @@
{
public static final int METHOD_ID = 22;
- private DataCommand cacheDataComand;
+ private DataCommand dataCommand;
private Boolean searchBackupSubtrees;
- private DataContainer cacheData;
+ private DataContainer dataContainer;
private InterceptorChain interceptorChain;
private static final Log log = LogFactory.getLog(ClusteredGetCommand.class);
@@ -36,17 +36,17 @@
trace = log.isTraceEnabled();
}
- public ClusteredGetCommand(Boolean searchBackupSubtrees, DataCommand cacheDataComand)
+ public ClusteredGetCommand(Boolean searchBackupSubtrees, DataCommand dataCommand)
{
this();
this.searchBackupSubtrees = searchBackupSubtrees;
- this.cacheDataComand = cacheDataComand;
+ this.dataCommand = dataCommand;
}
@Inject
- public void initialize(DataContainer cacheData, InterceptorChain interceptorChain)
+ public void initialize(DataContainer dataContainer, InterceptorChain interceptorChain)
{
- this.cacheData = cacheData;
+ this.dataContainer = dataContainer;
this.interceptorChain = interceptorChain;
}
@@ -59,16 +59,16 @@
public Object perform(InvocationContext context) throws Throwable
{
if (trace)
- log.trace("Clustered Get called with params: " + cacheDataComand + ", " + searchBackupSubtrees);
+ log.trace("Clustered Get called with params: " + dataCommand + ", " + searchBackupSubtrees);
Object callResults = null;
try
{
- if (trace) log.trace("Clustered get: invoking call with Fqn " + cacheDataComand.getFqn());
+ if (trace) log.trace("Clustered get: invoking call with Fqn " + dataCommand.getFqn());
InvocationContext ctx = interceptorChain.getInvocationContext();
ctx.setOriginLocal(false);
// very hacky to be calling this command directly.
- callResults = cacheDataComand.perform(ctx);
+ callResults = dataCommand.perform(ctx);
boolean found = validResult(callResults);
if (trace) log.trace("Got result " + callResults + ", found=" + found);
if (found && callResults == null) callResults = createEmptyResults();
@@ -102,11 +102,11 @@
*/
private boolean validResult(Object callResults)
{
- if (cacheDataComand instanceof GetDataMapCommand || cacheDataComand instanceof GetChildrenNamesCommand)
+ if (dataCommand instanceof GetDataMapCommand || dataCommand instanceof GetChildrenNamesCommand)
{
- return callResults != null && cacheData.exists(cacheDataComand.getFqn());
+ return callResults != null && dataContainer.exists(dataCommand.getFqn());
}
- return cacheDataComand instanceof RemoteExistsCommand && (Boolean) callResults;
+ return dataCommand instanceof RemoteExistsCommand && (Boolean) callResults;
}
/**
@@ -114,7 +114,7 @@
*/
private Object createEmptyResults()
{
- if (cacheDataComand instanceof GetDataMapCommand || cacheDataComand instanceof GetChildrenNamesCommand)
+ if (dataCommand instanceof GetDataMapCommand || dataCommand instanceof GetChildrenNamesCommand)
{
return Collections.emptyMap();
}
@@ -126,19 +126,19 @@
return searchBackupSubtrees;
}
- public DataCommand getCacheDataComand()
+ public DataCommand getDataCommand()
{
- return cacheDataComand;
+ return dataCommand;
}
public Object[] getParameters()
{
- return new Object[]{cacheDataComand, searchBackupSubtrees}; //To change body of implemented methods use File | Settings | File Templates.
+ return new Object[]{dataCommand, searchBackupSubtrees}; //To change body of implemented methods use File | Settings | File Templates.
}
public void setParameters(int commandId, Object[] args)
{
- cacheDataComand = (DataCommand) args[0];
+ dataCommand = (DataCommand) args[0];
searchBackupSubtrees = (Boolean) args[1];
}
@@ -150,7 +150,7 @@
ClusteredGetCommand that = (ClusteredGetCommand) o;
- if (cacheDataComand != null ? !cacheDataComand.equals(that.cacheDataComand) : that.cacheDataComand != null)
+ if (dataCommand != null ? !dataCommand.equals(that.dataCommand) : that.dataCommand != null)
return false;
if (searchBackupSubtrees != null ? !searchBackupSubtrees.equals(that.searchBackupSubtrees) : that.searchBackupSubtrees != null)
return false;
@@ -162,7 +162,7 @@
public int hashCode()
{
int result;
- result = (cacheDataComand != null ? cacheDataComand.hashCode() : 0);
+ result = (dataCommand != null ? dataCommand.hashCode() : 0);
result = 31 * result + (searchBackupSubtrees != null ? searchBackupSubtrees.hashCode() : 0);
return result;
}
@@ -171,9 +171,9 @@
public String toString()
{
return "ClusteredGetCommand{" +
- "cacheDataComand=" + cacheDataComand +
+ "dataCommand=" + dataCommand +
", searchBackupSubtrees=" + searchBackupSubtrees +
- ", cacheData=" + cacheData +
+ ", cacheData=" + dataContainer +
", interceptorChain=" + interceptorChain +
'}';
}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/remote/DataGravitationCleanupCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/remote/DataGravitationCleanupCommand.java 2008-04-28 14:03:57 UTC (rev 5721)
+++ core/trunk/src/main/java/org/jboss/cache/commands/remote/DataGravitationCleanupCommand.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -33,7 +33,7 @@
private GlobalTransactionContainer transactionHelper;
private InterceptorChain invoker;
private CommandsFactory commandsFactory;
- private DataContainer cacheData;
+ private DataContainer dataContainer;
private static final Log log = LogFactory.getLog(DataGravitationCleanupCommand.class);
private static boolean trace;
@@ -58,13 +58,13 @@
@Inject
public void initialize(BuddyManager buddyManager, InterceptorChain invoker, GlobalTransactionContainer transactionHelper,
- CommandsFactory commandsFactory, DataContainer cacheData)
+ CommandsFactory commandsFactory, DataContainer dataContainer)
{
this.buddyManager = buddyManager;
this.invoker = invoker;
this.transactionHelper = transactionHelper;
this.commandsFactory = commandsFactory;
- this.cacheData = cacheData;
+ this.dataContainer = dataContainer;
}
public Object perform(InvocationContext ctx) throws Throwable
@@ -84,14 +84,14 @@
// if this is a DIRECT child of a DEAD buddy backup region, then remove the empty dead region structural node.
if (BuddyFqnTransformer.isDeadBackupFqn(backup) && BuddyFqnTransformer.isDeadBackupRoot(backup.getParent().getParent()))
{
- NodeSPI deadBackupRoot = cacheData.peek(backup.getParent(), false);
+ NodeSPI deadBackupRoot = dataContainer.peek(backup.getParent(), false);
if (deadBackupRoot.getChildrenMapDirect().isEmpty())
{
if (trace) log.trace("Removing dead backup region " + deadBackupRoot.getFqn());
executeRemove(gtx, deadBackupRoot.getFqn());
// now check the grand parent and see if we are free of versions
- deadBackupRoot = cacheData.peek(deadBackupRoot.getFqn().getParent(), false);
+ deadBackupRoot = dataContainer.peek(deadBackupRoot.getFqn().getParent(), false);
if (deadBackupRoot.getChildrenMapDirect().isEmpty())
{
if (trace) log.trace("Removing dead backup region " + deadBackupRoot.getFqn());
@@ -137,9 +137,9 @@
private void evictNode(Fqn fqn) throws Throwable
{
- if (cacheData.exists(fqn))
+ if (dataContainer.exists(fqn))
{
- List<Fqn> toEvict = cacheData.getNodesForEviction(fqn, true);
+ List<Fqn> toEvict = dataContainer.getNodesForEviction(fqn, true);
for (Fqn aFqn : toEvict)
{
EvictCommand evictFqnCommand = commandsFactory.buildEvictFqnCommand(aFqn);
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/CreateNodeCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/CreateNodeCommand.java 2008-04-28 14:03:57 UTC (rev 5721)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/CreateNodeCommand.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -49,7 +49,7 @@
public Object perform(InvocationContext ctx) throws Throwable
{
- Object[] results = cacheData.createNodes(fqn);
+ Object[] results = dataContainer.createNodes(fqn);
List<NodeSPI> created = (List<NodeSPI>) results[0];
boolean foundFqn = false;
@@ -75,7 +75,7 @@
{
if (newlyCreated != null)
{
- for (Fqn f : newlyCreated) cacheData.realRemove(f, true);
+ for (Fqn f : newlyCreated) dataContainer.realRemove(f, true);
}
}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/EvictCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/EvictCommand.java 2008-04-28 14:03:57 UTC (rev 5721)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/EvictCommand.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -29,7 +29,7 @@
if (recursive)
{
- List<Fqn> nodesToEvict = cacheData.getNodesForEviction(fqn, true);
+ List<Fqn> nodesToEvict = dataContainer.getNodesForEviction(fqn, true);
for (Fqn aFqn : nodesToEvict)
{
@@ -46,7 +46,7 @@
void evictNode(Fqn fqn, InvocationContext ctx)
{
notifier.notifyNodeEvicted(fqn, true, ctx);
- cacheData.evict(fqn);
+ dataContainer.evict(fqn);
notifier.notifyNodeEvicted(fqn, false, ctx);
}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/InvalidateCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/InvalidateCommand.java 2008-04-28 14:03:57 UTC (rev 5721)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/InvalidateCommand.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -76,7 +76,7 @@
if (!isOptimisticLocking) return null;
// check if a tombstone already exists
- NodeSPI nodeSPI = cacheData.peek(fqn, false, true);
+ NodeSPI nodeSPI = dataContainer.peek(fqn, false, true);
if (nodeSPI == null)
{
if (dataVersion == null)
@@ -110,7 +110,7 @@
{
log.error("Unable to create tombstone!", e);
}
- nodeSPI = (NodeSPI) cacheData.getRoot().getChild(fqn);
+ nodeSPI = (NodeSPI) dataContainer.getRoot().getChild(fqn);
}
node = nodeSPI;
}
@@ -126,7 +126,7 @@
if (dataVersion != null)
{
- NodeSPI n = cacheData.peek(fqn, false, true);
+ NodeSPI n = dataContainer.peek(fqn, false, true);
n.setVersion(dataVersion);
}
return null;
@@ -137,7 +137,7 @@
{
// Find the node. This will lock it (if <tt>locking</tt> is true) and
// add the temporarily created parent nodes to the TX's node list if tx != null)
- NodeSPI n = cacheData.findNode(fqn, dataVersion);
+ NodeSPI n = dataContainer.findNode(fqn, dataVersion);
if (n == null)
{
log.warn("node " + fqn + " not found");
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/MoveCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/MoveCommand.java 2008-04-28 14:03:57 UTC (rev 5721)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/MoveCommand.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -78,14 +78,14 @@
public void _move(Fqn nodeToMoveFqn, Fqn newParentFqn, boolean skipNotifications, InvocationContext ctx)
{
// the actual move algorithm.
- NodeSPI newParent = cacheData.findNode(newParentFqn);
+ NodeSPI newParent = dataContainer.findNode(newParentFqn);
if (newParent == null)
{
throw new NodeNotExistsException("New parent node " + newParentFqn + " does not exist when attempting to move node!!");
}
- NodeSPI node = cacheData.findNode(nodeToMoveFqn);
+ NodeSPI node = dataContainer.findNode(nodeToMoveFqn);
if (node == null)
{
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/PutDataMapCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/PutDataMapCommand.java 2008-04-28 14:03:57 UTC (rev 5721)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/PutDataMapCommand.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -57,7 +57,7 @@
{
log.trace("perform(" + globalTransaction + ", \"" + fqn + "\", " + data + " undo=" + createUndoOps + " erase=" + eraseContents + ")");
}
- NodeSPI nodeSPI = cacheData.findNodeCheck(globalTransaction, fqn, false);
+ NodeSPI nodeSPI = dataContainer.findNodeCheck(globalTransaction, fqn, false);
Map dataDirect = nodeSPI.getDataDirect();
if (!dataDirect.isEmpty())
{
@@ -76,7 +76,7 @@
{
if (trace) log.trace("rollback(" + globalTransaction + ", " + fqn + ", " + data + ")");
- NodeSPI n = cacheData.findNode(fqn, null, true);
+ NodeSPI n = dataContainer.findNode(fqn, null, true);
if (n != null)
{
n.clearDataDirect();
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/PutKeyValueCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/PutKeyValueCommand.java 2008-04-28 14:03:57 UTC (rev 5721)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/PutKeyValueCommand.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -63,7 +63,7 @@
// if this is a rollback then don't fire notifications.
boolean isRollback = false;
- NodeSPI n = cacheData.findNodeCheck(globalTransaction, fqn, isRollback);
+ NodeSPI n = dataContainer.findNodeCheck(globalTransaction, fqn, isRollback);
Map rawData = n.getDataDirect();
notifier.notifyNodeModified(fqn, true, NodeModifiedEvent.ModificationType.PUT_DATA, rawData, ctx);
oldValue = n.putDirect(key, value);
@@ -77,14 +77,14 @@
{
if (this.oldValue == null)
{
- NodeSPI n = cacheData.findNode(fqn);
+ NodeSPI n = dataContainer.findNode(fqn);
if (n == null) throw new CacheException("node " + fqn + " not found for rollback!");
n.removeDirect(key);
}
else
{
log.trace("Rolling back, setting the old value : " + oldValue);
- NodeSPI n = cacheData.findNodeCheck(globalTransaction, fqn, false);
+ NodeSPI n = dataContainer.findNodeCheck(globalTransaction, fqn, false);
n.putDirect(key, oldValue);
}
}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveDataCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveDataCommand.java 2008-04-28 14:03:57 UTC (rev 5721)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveDataCommand.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -51,7 +51,7 @@
public Object perform(InvocationContext ctx)
{
if (trace) log.trace("perform(" + globalTransaction + ", \"" + fqn + "\")");
- NodeSPI targetNode = cacheData.findNode(fqn, dataVersion);
+ NodeSPI targetNode = dataContainer.findNode(fqn, dataVersion);
if (targetNode == null)
{
log.warn("node " + fqn + " not found");
@@ -114,7 +114,7 @@
{
if (trace) log.trace("rollback(" + globalTransaction + ", \"" + fqn + "\", " + originalData + ")");
boolean isRollback = true;
- NodeSPI nodeSPI = cacheData.findNodeCheck(globalTransaction, fqn, isRollback);
+ NodeSPI nodeSPI = dataContainer.findNodeCheck(globalTransaction, fqn, isRollback);
nodeSPI.putAllDirect(originalData);
}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveKeyCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveKeyCommand.java 2008-04-28 14:03:57 UTC (rev 5721)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveKeyCommand.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -50,7 +50,7 @@
{
if (trace) log.trace("perform(" + globalTransaction + ", \"" + fqn + "\", key=" + key + ")");
- NodeSPI n = cacheData.findNode(fqn);
+ NodeSPI n = dataContainer.findNode(fqn);
if (n == null)
{
log.warn("node " + fqn + " not found");
@@ -67,7 +67,7 @@
public void rollback()
{
- NodeSPI targetNode = cacheData.findNodeCheck(globalTransaction, fqn, true);
+ NodeSPI targetNode = dataContainer.findNodeCheck(globalTransaction, fqn, true);
targetNode.putDirect(key, oldValue);
}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveNodeCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveNodeCommand.java 2008-04-28 14:03:57 UTC (rev 5721)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveNodeCommand.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -55,7 +55,7 @@
log.trace("perform(" + globalTransaction + ", \"" + fqn + "\", undo=" + createUndoOps + ")");
// Find the node. This will add the temporarily created parent nodes to the TX's node list if globalTransaction != null)
- targetNode = cacheData.findNode(fqn, dataVersion, true);
+ targetNode = dataContainer.findNode(fqn, dataVersion, true);
if (targetNode == null)
{
if (trace) log.trace("node " + fqn + " not found");
@@ -145,7 +145,7 @@
log.error("parent fqn or childName or childNode was null");
return;
}
- NodeSPI parentNode = cacheData.findNode(parentFqn);
+ NodeSPI parentNode = dataContainer.findNode(parentFqn);
if (parentNode == null)
{
log.warn("node " + parentFqn + " not found");
Modified: core/trunk/src/main/java/org/jboss/cache/factories/CommandsFactory.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/factories/CommandsFactory.java 2008-04-28 14:03:57 UTC (rev 5721)
+++ core/trunk/src/main/java/org/jboss/cache/factories/CommandsFactory.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -269,9 +269,9 @@
return command;
}
- public ClusteredGetCommand buildClusteredGetCommand(Boolean searchBackupSubtrees, DataCommand cacheDataComand)
+ public ClusteredGetCommand buildClusteredGetCommand(Boolean searchBackupSubtrees, DataCommand dataCommand)
{
- ClusteredGetCommand command = new ClusteredGetCommand(searchBackupSubtrees, cacheDataComand);
+ ClusteredGetCommand command = new ClusteredGetCommand(searchBackupSubtrees, dataCommand);
registry.wireDependencies(command);
return command;
}
Modified: core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java 2008-04-28 14:03:57 UTC (rev 5721)
+++ core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -632,7 +632,7 @@
Component spi = componentLookup.get(CacheSPI.class.getName());
Component interceptorChain = componentLookup.get(InterceptorChain.class.getName());
Component lifeCycleManager = componentLookup.get(LifecycleManager.class.getName());
- Component cacheData = componentLookup.get(DataContainer.class.getName());
+ Component dataContainer = componentLookup.get(DataContainer.class.getName());
Component conf = componentLookup.get(Configuration.class.getName());
Component cr = componentLookup.get(ComponentRegistry.class.getName());
@@ -647,12 +647,12 @@
spi.changeState(CONSTRUCTED);
interceptorChain.changeState(CONSTRUCTED);
lifeCycleManager.changeState(CONSTRUCTED);
- cacheData.changeState(CONSTRUCTED);
+ dataContainer.changeState(CONSTRUCTED);
conf.changeState(CONSTRUCTED);
cr.changeState(CONSTRUCTED);
bootstrap = new Bootstrap((ClassLoader) deployerClassLoader.instance, (InterceptorChain) interceptorChain.instance,
- (LifecycleManager) lifeCycleManager.instance, (DataContainer) cacheData.instance, (CacheSPI) spi.instance,
+ (LifecycleManager) lifeCycleManager.instance, (DataContainer) dataContainer.instance, (CacheSPI) spi.instance,
(ComponentRegistry) cr.instance, (Configuration) conf.instance);
overallState = null;
@@ -970,18 +970,18 @@
{
final InterceptorChain interceptorChain;
final LifecycleManager lifecycleManager;
- final DataContainer cacheData;
+ final DataContainer dataContainer;
final CacheSPI cacheSPI;
final ComponentRegistry componentRegistry;
final Configuration configuration;
private final ClassLoader deployerClassLoader;
Bootstrap(ClassLoader deployerClassLoader, InterceptorChain interceptorChain, LifecycleManager lifecycleManager,
- DataContainer cacheData, CacheSPI cacheSPI, ComponentRegistry componentRegistry, Configuration configuration)
+ DataContainer dataContainer, CacheSPI cacheSPI, ComponentRegistry componentRegistry, Configuration configuration)
{
this.deployerClassLoader = deployerClassLoader;
this.lifecycleManager = lifecycleManager;
- this.cacheData = cacheData;
+ this.dataContainer = dataContainer;
this.interceptorChain = interceptorChain;
this.cacheSPI = cacheSPI;
this.componentRegistry = componentRegistry;
@@ -1007,7 +1007,7 @@
registerComponent(ComponentRegistry.class.getName(), componentRegistry, ComponentRegistry.class);
registerComponent(InterceptorChain.class.getName(), interceptorChain, InterceptorChain.class);
registerComponent(LifecycleManager.class.getName(), lifecycleManager, LifecycleManager.class);
- registerComponent(DataContainer.class.getName(), cacheData, DataContainer.class);
+ registerComponent(DataContainer.class.getName(), dataContainer, DataContainer.class);
registerComponent(CacheSPI.class.getName(), cacheSPI, CacheSPI.class);
}
}
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/ActivationInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/ActivationInterceptor.java 2008-04-28 14:03:57 UTC (rev 5721)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/ActivationInterceptor.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -150,12 +150,12 @@
private void removeNodeFromCacheLoader(InvocationContext ctx, Fqn fqn) throws Throwable
{
NodeSPI n;
- if (((n = cacheData.peek(fqn, true, false)) != null) && n.isDataLoaded() && loader.exists(fqn))
+ if (((n = dataContainer.peek(fqn, true, false)) != null) && n.isDataLoaded() && loader.exists(fqn))
{
// node not null and attributes have been loaded?
if (!n.getChildrenDirect().isEmpty())
{
- boolean result = cacheData.allInitialized(n);
+ boolean result = dataContainer.allInitialized(n);
if (result)
{
log.debug("children all initialized");
@@ -258,7 +258,7 @@
throw new Exception("entry for transaction " + gtx + " not found in transaction table");
}
List<Modification> cacheLoaderModifications = new ArrayList<Modification>();
- ActivationModificationsBuilder builder = new ActivationModificationsBuilder(cacheData, loader, notifier);
+ ActivationModificationsBuilder builder = new ActivationModificationsBuilder(dataContainer, loader, notifier);
builder.visitCollection(null, entry.getCacheLoaderModifications());
if (cacheLoaderModifications.size() > 0)
{
@@ -270,14 +270,14 @@
{
private List<Modification> cacheLoaderModifications = new ArrayList<Modification>();
- private DataContainer cacheData;
+ private DataContainer dataContainer;
private CacheLoader loader;
private Notifier notifier;
private int txActs = 0;
- public ActivationModificationsBuilder(DataContainer cacheData, CacheLoader loader, Notifier notifier)
+ public ActivationModificationsBuilder(DataContainer dataContainer, CacheLoader loader, Notifier notifier)
{
- this.cacheData = cacheData;
+ this.dataContainer = dataContainer;
this.loader = loader;
this.notifier = notifier;
}
@@ -306,14 +306,14 @@
private void handlePutCommand(InvocationContext ctx, Fqn fqn)
throws Exception
{
- if (fqn != null && cacheData.peek(fqn, false, false) != null && loader.exists(fqn))
+ if (fqn != null && dataContainer.peek(fqn, false, false) != null && loader.exists(fqn))
{
- NodeSPI n = cacheData.peek(fqn, true, false);// don't load
+ NodeSPI n = dataContainer.peek(fqn, true, false);// don't load
// node not null and attributes have been loaded?
if (n != null && n.isDataLoaded())
{
// has children?
- boolean result = cacheData.allInitialized(n);
+ boolean result = dataContainer.allInitialized(n);
if (!n.getChildrenDirect().isEmpty() && result)
{
// children have been loaded, remove the node
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 14:03:57 UTC (rev 5721)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/CacheLoaderInterceptor.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -54,7 +54,7 @@
protected TransactionTable txTable = null;
protected Configuration config;
protected CacheLoader loader;
- protected DataContainer cacheData;
+ protected DataContainer dataContainer;
protected Notifier notifier;
protected boolean isActivation = false;
@@ -70,13 +70,13 @@
@Inject
protected void injectDependencies(TransactionTable txTable, CacheLoaderManager clm, Configuration configuration,
- DataContainer cacheData, Configuration config, LockManager lockManager, Notifier notifier)
+ DataContainer dataContainer, Configuration config, LockManager lockManager, Notifier notifier)
{
this.txTable = txTable;
this.clm = clm;
CacheMode mode = configuration.getCacheMode();
usingOptimisticInvalidation = configuration.isNodeLockingOptimistic() && mode.isInvalidation();
- this.cacheData = cacheData;
+ this.dataContainer = dataContainer;
this.config = config;
this.lockManager = lockManager;
this.notifier = notifier;
@@ -150,7 +150,7 @@
if (fqn != null)
{
loadIfNeeded(ctx, fqn, null, false, false, false, txTable.get(ctx.getGlobalTransaction()), false, false, true);
- NodeSPI n = cacheData.peek(fqn, true, true);
+ NodeSPI n = dataContainer.peek(fqn, true, true);
loadChildren(fqn, n, false, false, ctx);
}
return invokeNextInterceptor(ctx, command);
@@ -193,7 +193,7 @@
Fqn fqn = (Fqn) i.previous();
try
{
- cacheData.evict(fqn, false);
+ dataContainer.evict(fqn, false);
}
catch (CacheException e)
{
@@ -237,7 +237,7 @@
private void loadIfNeeded(InvocationContext ctx, Fqn fqn, Object key, boolean allKeys, boolean initNode, boolean acquireLock, TransactionEntry entry, boolean recursive, boolean isMove, boolean bypassLoadingData) throws Throwable
{
- NodeSPI n = cacheData.peek(fqn, true, true);
+ NodeSPI n = dataContainer.peek(fqn, true, true);
boolean mustLoad = mustLoad(n, key, allKeys);
if (trace)
@@ -428,7 +428,7 @@
lockManager.acquireLocksWithTimeout(ctx, fqn, lockType, false, false, false, false, null, false);
if (recursive)
{
- NodeSPI node = cacheData.peek(fqn, false, false);
+ NodeSPI node = dataContainer.peek(fqn, false, false);
lockManager.acquireLocksOnChildren(node, lockType, ctx);
}
}
@@ -505,7 +505,7 @@
@SuppressWarnings("unchecked")
private NodeSPI createNodes(Fqn fqn, TransactionEntry entry) throws Exception
{
- Object[] results = cacheData.createNodes(fqn);
+ Object[] results = dataContainer.createNodes(fqn);
List<NodeSPI> createdNodes = (List<NodeSPI>) results[0];
NodeSPI lastCreated = null;
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 14:03:57 UTC (rev 5721)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/CacheMgmtInterceptor.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -51,12 +51,12 @@
private long m_start = System.currentTimeMillis();
private long m_reset = m_start;
- private DataContainer cacheData;
+ private DataContainer dataContainer;
@Inject
- public void setDependencies(DataContainer cacheData)
+ public void setDependencies(DataContainer dataContainer)
{
- this.cacheData = cacheData;
+ this.dataContainer = dataContainer;
}
@Override
@@ -166,12 +166,12 @@
public int getNumberOfAttributes()
{
- return cacheData.getNumberOfAttributes();
+ return dataContainer.getNumberOfAttributes();
}
public int getNumberOfNodes()
{
- return cacheData.getNumberOfNodes();
+ return dataContainer.getNumberOfNodes();
}
public long getElapsedTime()
@@ -192,8 +192,8 @@
retval.put("Misses", m_misses);
retval.put("Stores", m_stores);
retval.put("Evictions", m_evictions);
- retval.put("NumberOfAttributes", cacheData.getNumberOfAttributes());
- retval.put("NumberOfNodes", cacheData.getNumberOfNodes());
+ retval.put("NumberOfAttributes", dataContainer.getNumberOfAttributes());
+ retval.put("NumberOfNodes", dataContainer.getNumberOfNodes());
retval.put("ElapsedTime", getElapsedTime());
retval.put("TimeSinceReset", getTimeSinceReset());
retval.put("AverageReadTime", getAverageReadTime());
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/CacheStoreInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/CacheStoreInterceptor.java 2008-04-28 14:03:57 UTC (rev 5721)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/CacheStoreInterceptor.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -56,7 +56,7 @@
private long cacheStores = 0;
private CacheLoader loader;
private Configuration configuration;
- private DataContainer cacheData;
+ private DataContainer dataContainer;
private CacheLoaderManager loaderManager;
public CacheStoreInterceptor()
@@ -66,7 +66,7 @@
}
@Inject
- protected void init(DataContainer cacheData, CacheLoaderManager loaderManager, TransactionManager txManager, TransactionTable txTable, CacheLoaderConfig clConfig, Configuration configuration)
+ protected void init(DataContainer dataContainer, CacheLoaderManager loaderManager, TransactionManager txManager, TransactionTable txTable, CacheLoaderConfig clConfig, Configuration configuration)
{
// never inject a CacheLoader at this stage - only a CacheLoaderManager, since the CacheLoaderManager only creates a CacheLoader instance when it @Starts.
this.loaderManager = loaderManager;
@@ -74,7 +74,7 @@
txMgr = txManager;
this.txTable = txTable;
this.configuration = configuration;
- this.cacheData = cacheData;
+ this.dataContainer = dataContainer;
}
@Start
@@ -233,7 +233,7 @@
{
loader.removeData(command.getFqn());
// we need to mark this node as data loaded
- NodeSPI n = cacheData.peek(command.getFqn(), false, false);
+ NodeSPI n = dataContainer.peek(command.getFqn(), false, false);
if (n != null)
{
n.setDataLoaded(true);
@@ -268,7 +268,7 @@
{
loader.removeData(command.getFqn());
// if we are erasing all the data then consider this node loaded
- NodeSPI n = cacheData.peek(command.getFqn(), false, false);//cache.peek(fqn, false);
+ NodeSPI n = dataContainer.peek(command.getFqn(), false, false);//cache.peek(fqn, false);
n.setDataLoaded(true);
return returnValue;
}
@@ -313,7 +313,7 @@
for (Fqn f : affectedFqns)
{
// NOT going to store tombstones!!
- NodeSPI n = cacheData.peek(f, false, false);
+ NodeSPI n = dataContainer.peek(f, false, false);
if (n != null)
{
Map internalState = n.getInternalState(true);
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java 2008-04-28 14:03:57 UTC (rev 5721)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -73,16 +73,16 @@
* cleanup commands corresponding to all gravitate calls made during the course of the transaction in question.
*/
private Map<GlobalTransaction, List<ReplicableCommand>> cleanupCommands = new ConcurrentHashMap<GlobalTransaction, List<ReplicableCommand>>();
- private DataContainer cacheData;
+ private DataContainer dataContainer;
private Configuration config;
private CommandsFactory commandsFactory;
private CacheSPI cacheSPI;
@Inject
- public void injectComponents(BuddyManager buddyManager, Configuration config, DataContainer cacheData, CommandsFactory commandsFactory, CacheSPI cacheSPI)
+ public void injectComponents(BuddyManager buddyManager, Configuration config, DataContainer dataContainer, CommandsFactory commandsFactory, CacheSPI cacheSPI)
{
this.buddyManager = buddyManager;
- this.cacheData = cacheData;
+ this.dataContainer = dataContainer;
this.commandsFactory = commandsFactory;
this.cacheSPI = cacheSPI;
this.config = config;
@@ -170,7 +170,7 @@
}
else
{
- if (cacheData.peek(command.getFqn(), false, false) == null)
+ if (dataContainer.peek(command.getFqn(), false, false) == null)
{
// gravitation is necessary.
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 14:03:57 UTC (rev 5721)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/EvictionInterceptor.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -40,12 +40,12 @@
{
protected RegionManager regionManager;
- private DataContainer cacheData;
+ private DataContainer dataContainer;
@Inject
- public void initialize(DataContainer cacheData)
+ public void initialize(DataContainer dataContainer)
{
- this.cacheData = cacheData;
+ this.dataContainer = dataContainer;
}
/**
@@ -231,7 +231,7 @@
return;
}
- NodeSPI<?, ?> nodeSPI = cacheData.peek(event.getFqn(), false, false);//cache.peek(event.getFqn(), false);
+ NodeSPI<?, ?> nodeSPI = dataContainer.peek(event.getFqn(), false, false);//cache.peek(event.getFqn(), false);
//we do not trigger eviction events for resident nodes
if (nodeSPI != null && nodeSPI.isResident())
{
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticCreateIfNotExistsInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticCreateIfNotExistsInterceptor.java 2008-04-28 14:03:57 UTC (rev 5721)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticCreateIfNotExistsInterceptor.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -44,17 +44,17 @@
*/
private NodeFactory nodeFactory;
- private DataContainer cacheData;
+ private DataContainer dataContainer;
private CacheSPI cache;
private long lockAcquisitionTimeout;
@Inject
- private void injectDependencies(NodeFactory nodeFactory, DataContainer cacheData, CacheSPI cacheSPI)
+ private void injectDependencies(NodeFactory nodeFactory, DataContainer dataContainer, CacheSPI cacheSPI)
{
this.nodeFactory = nodeFactory;
- this.cacheData = cacheData;
+ this.dataContainer = dataContainer;
this.cache = cacheSPI;
this.lockAcquisitionTimeout = cacheSPI.getConfiguration().getLockAcquisitionTimeout();
}
@@ -79,7 +79,7 @@
List<Fqn> fqns = new ArrayList<Fqn>();
fqns.add(command.getTo());
// peek into Node and get a hold of all child fqns as these need to be in the workspace.
- NodeSPI node = cacheData.peek(command.getFqn(), true, true);
+ NodeSPI node = dataContainer.peek(command.getFqn(), true, true);
greedyGetFqns(fqns, node, command.getTo());
if (trace) log.trace("Adding Fqns " + fqns + " for a move() operation.");
for (Fqn f : fqns)
@@ -98,7 +98,7 @@
private void createNode(InvocationContext ctx, Fqn targetFqn, boolean suppressNotification) throws CacheException
{
// if (cache.peek(targetFqn, false) != null) return;
- if (cacheData.peek(targetFqn, false, false) != null) return;
+ if (dataContainer.peek(targetFqn, false, false) != null) return;
// we do nothing if targetFqn is null
if (targetFqn == null) return;
@@ -125,7 +125,7 @@
// we do not have the root in the workspace! Put it into thr workspace now.
if (workspaceNode == null)
{
- NodeSPI node = cacheData.getRoot();
+ NodeSPI node = dataContainer.getRoot();
workspaceNode = lockAndCreateWorkspaceNode(nodeFactory, node, workspace, gtx, lockAcquisitionTimeout);
workspace.addNode(workspaceNode);
log.debug("Created root node in workspace.");
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticNodeInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticNodeInterceptor.java 2008-04-28 14:03:57 UTC (rev 5721)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticNodeInterceptor.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -58,17 +58,17 @@
private NodeFactory nodeFactory;
private Notifier notifier;
private CacheLoaderManager cacheLoaderManager;
- private DataContainer cacheData;
+ private DataContainer dataContainer;
private long lockAcquisitionTimeout;
@Inject
protected void injectDependencies(Notifier notifier, NodeFactory nodeFactory, CacheLoaderManager cacheLoaderManager,
- DataContainer cacheData, Configuration configuration)
+ DataContainer dataContainer, Configuration configuration)
{
this.notifier = notifier;
this.nodeFactory = nodeFactory;
this.cacheLoaderManager = cacheLoaderManager;
- this.cacheData = cacheData;
+ this.dataContainer = dataContainer;
this.lockAcquisitionTimeout = configuration.getLockAcquisitionTimeout();
}
@@ -556,7 +556,7 @@
// if we do not have the node then we need to add it to the workspace
if (workspaceNode == null)
{
- NodeSPI node = cacheData.peek(fqn, true, includeInvalidNodes);
+ NodeSPI node = dataContainer.peek(fqn, true, includeInvalidNodes);
if (node == null) return null;
GlobalTransaction gtx = ctx.getGlobalTransaction();
workspaceNode = lockAndCreateWorkspaceNode(nodeFactory, node, workspace, gtx, lockAcquisitionTimeout);
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticValidatorInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticValidatorInterceptor.java 2008-04-28 14:03:57 UTC (rev 5721)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticValidatorInterceptor.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -51,12 +51,12 @@
{
private boolean useTombstones;
- private DataContainer cacheData;
+ private DataContainer dataContainer;
@Inject
- public void initialize(CacheSPI cache, DataContainer cacheData)
+ public void initialize(CacheSPI cache, DataContainer dataContainer)
{
- this.cacheData = cacheData;
+ this.dataContainer = dataContainer;
CacheMode mode = cache.getConfiguration().getCacheMode();
useTombstones = (mode == CacheMode.INVALIDATION_ASYNC) || (mode == CacheMode.INVALIDATION_SYNC);
}
@@ -79,7 +79,7 @@
if (trace) log.trace("Validating version for node [" + fqn + "]");
NodeSPI underlyingNode;
- underlyingNode = cacheData.peek(fqn, true, true);
+ underlyingNode = dataContainer.peek(fqn, true, true);
// if this is a newly created node then we expect the underlying node to be null.
// also, if the node has been deleted in the WS and the underlying node is null, this *may* be ok ... will test again later when comparing versions
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 14:03:57 UTC (rev 5721)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/PassivationInterceptor.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -32,14 +32,14 @@
protected CacheLoader loader;
private Notifier notifier;
private Configuration configuration;
- private DataContainer cacheData;
+ private DataContainer dataContainer;
@Inject
- public void setDependencies(Notifier notifier, Configuration configuration, DataContainer cacheData, CacheLoaderManager loaderManager)
+ public void setDependencies(Notifier notifier, Configuration configuration, DataContainer dataContainer, CacheLoaderManager loaderManager)
{
this.notifier = notifier;
this.configuration = configuration;
- this.cacheData = cacheData;
+ this.dataContainer = dataContainer;
this.loader = loaderManager.getCacheLoader();
}
@@ -105,7 +105,7 @@
{
throw new NodeNotLoadedException();
}
- NodeSPI n = cacheData.peek(fqn, true, false);
+ NodeSPI n = dataContainer.peek(fqn, true, false);
if (n != null)
{
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2008-04-28 14:03:57 UTC (rev 5721)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -58,16 +58,16 @@
public class PessimisticLockInterceptor extends PostProcessingChainedInterceptor
{
private TransactionTable txTable;
- private DataContainer cacheData;
+ private DataContainer dataContainer;
private LockManager lockManager;
private Configuration configuration;
private long lockAcquisitionTimeout;
@Inject
- public void injectDependencies(Configuration configuration, DataContainer cacheImpl, TransactionTable txTable, LockManager lockManager)
+ public void injectDependencies(Configuration configuration, DataContainer dataContainer, TransactionTable txTable, LockManager lockManager)
{
lockAcquisitionTimeout = configuration.getLockAcquisitionTimeout();
- this.cacheData = cacheImpl;
+ this.dataContainer = dataContainer;
this.txTable = txTable;
this.lockManager = lockManager;
this.configuration = configuration;
@@ -92,7 +92,7 @@
{
if (trace) log.trace("Suppressing locking, creating nodes if necessary");
int treeNodeSize = command.getFqn().size();
- NodeSPI n = cacheData.getRoot();
+ NodeSPI n = dataContainer.getRoot();
for (int i = 0; i < treeNodeSize; i++)
{
Object childName = command.getFqn().get(i);
@@ -150,7 +150,7 @@
{
for (Fqn fqn : entry.getRemovedNodes())
{
- cacheData.realRemove(fqn, false);
+ dataContainer.realRemove(fqn, false);
}
// 1. Revert the modifications by running the undo-op list in reverse. This *cannot* throw any exceptions !
entry.undoOperations();
@@ -178,18 +178,18 @@
{
txTable.get(ctx.getGlobalTransaction()).addRemovedNode(command.getFqn());
}
- lockManager.acquireLocksOnChildren(cacheData.peek(command.getFqn(), true, false), NodeLock.LockType.WRITE, ctx);
+ lockManager.acquireLocksOnChildren(dataContainer.peek(command.getFqn(), true, false), NodeLock.LockType.WRITE, ctx);
}
if (command.getTo() != null && !(configuration.getIsolationLevel() == IsolationLevel.NONE))
{
//now for an RL for the new parent.
if (trace) log.trace("Attempting to get RL on new parent [" + command.getTo() + "]");
lockManager.lock(ctx, command.getTo(), NodeLock.LockType.READ, false, timeout, false, false, null, false);
- lockManager.acquireLocksOnChildren(cacheData.peek(command.getTo(), true, false), NodeLock.LockType.READ, ctx);
+ lockManager.acquireLocksOnChildren(dataContainer.peek(command.getTo(), true, false), NodeLock.LockType.READ, ctx);
}
Object retValue = invokeNextInterceptor(ctx, command);
// do a REAL remove here.
- NodeSPI n = cacheData.peek(command.getFqn(), true, false);
+ NodeSPI n = dataContainer.peek(command.getFqn(), true, false);
if (n != null)
{
n.getLock().releaseAll(Thread.currentThread());
@@ -217,7 +217,7 @@
nodeSPI.markAsDeleted(true);
}
}
- lockManager.acquireLocksOnChildren(cacheData.peek(command.getFqn(), false, false), NodeLock.LockType.WRITE, ctx, entry, true);
+ lockManager.acquireLocksOnChildren(dataContainer.peek(command.getFqn(), false, false), NodeLock.LockType.WRITE, ctx, entry, true);
if (!createdNodes.isEmpty())
{
@@ -232,11 +232,11 @@
//todo [mmarkus] this logic should be moved within moveNodeCommand, as it is plain removal logic
if (ctx.getGlobalTransaction() == null)
{
- for (NodeSPI nodeSPI : createdNodes) cacheData.realRemove(nodeSPI.getFqn(), true);
- cacheData.realRemove(command.getFqn(), true);
+ for (NodeSPI nodeSPI : createdNodes) dataContainer.realRemove(nodeSPI.getFqn(), true);
+ dataContainer.realRemove(command.getFqn(), true);
//todo end of the logic that needs to be moved
- NodeSPI n = cacheData.peek(command.getFqn(), true, false);
+ NodeSPI n = dataContainer.peek(command.getFqn(), true, false);
if (n != null)
{
n.getLock().releaseAll(Thread.currentThread());
@@ -316,7 +316,7 @@
// first remove nodes that should be deleted.
for (Fqn fqn : entry.getRemovedNodes())
{
- cacheData.realRemove(fqn, false);
+ dataContainer.realRemove(fqn, 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-04-28 14:03:57 UTC (rev 5721)
+++ core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -58,7 +58,7 @@
private RPCManager rpcManager;
private RegionManager regionManager;
private Marshaller marshaller;
- private DataContainer cacheData;
+ private DataContainer dataContainer;
private CommandsFactory commandsFactory;// tu be built here and imjected within any CacheCommand instance. Also pass this to the interceptor chain
private GlobalTransactionContainer transactionHelper;
@@ -66,7 +66,7 @@
public void initialize(StateTransferManager stateTransferManager, CacheLoaderManager cacheLoaderManager, Notifier notifier,
TransactionManager transactionManager, BuddyManager buddyManager, TransactionTable transactionTable,
RPCManager rpcManager, RegionManager regionManager, Marshaller marshaller,
- GlobalTransactionContainer transactionHelper, CommandsFactory commandsFactory, DataContainer cacheData)
+ GlobalTransactionContainer transactionHelper, CommandsFactory commandsFactory, DataContainer dataContainer)
{
this.stateTransferManager = stateTransferManager;
this.cacheLoaderManager = cacheLoaderManager;
@@ -77,7 +77,7 @@
this.rpcManager = rpcManager;
this.regionManager = regionManager;
this.marshaller = marshaller;
- this.cacheData = cacheData;
+ this.dataContainer = dataContainer;
this.commandsFactory = commandsFactory;
this.transactionHelper = transactionHelper;
}
@@ -91,14 +91,14 @@
this.transactionTable = null;
this.rpcManager = null;
this.marshaller = null;
- this.cacheData = null;
+ this.dataContainer = null;
this.commandsFactory = null;
}
@Override
public String toString()
{
- return cacheData == null ? super.toString() : cacheData.toString();
+ return dataContainer == null ? super.toString() : dataContainer.toString();
}
public Configuration getConfiguration()
@@ -108,7 +108,7 @@
public NodeSPI<K, V> getRoot()
{
- return (NodeSPI<K, V>) cacheData.getRoot();
+ return (NodeSPI<K, V>) dataContainer.getRoot();
}
public TransactionManager getTransactionManager()
@@ -173,12 +173,12 @@
public int getNumberOfAttributes()
{
- return cacheData.getNumberOfAttributes();
+ return dataContainer.getNumberOfAttributes();
}
public int getNumberOfNodes()
{
- return cacheData.getNumberOfNodes();
+ return dataContainer.getNumberOfNodes();
}
public RegionManager getRegionManager()
@@ -198,12 +198,12 @@
public Set<Fqn> getInternalFqns()
{
- return cacheData.getInternalFqns();
+ return dataContainer.getInternalFqns();
}
public int getNumberOfLocksHeld()
{
- return cacheData.getNumberOfLocksHeld();
+ return dataContainer.getNumberOfLocksHeld();
}
public boolean exists(String fqn)
@@ -236,12 +236,12 @@
public NodeSPI<K, V> peek(Fqn fqn, boolean includeDeletedNodes, boolean includeInvalidNodes)
{
- return (NodeSPI<K, V>) cacheData.peek(fqn, includeDeletedNodes, includeInvalidNodes);
+ return (NodeSPI<K, V>) dataContainer.peek(fqn, includeDeletedNodes, includeInvalidNodes);
}
public NodeSPI<K, V> peek(Fqn fqn, boolean includeDeletedNodes)
{
- return (NodeSPI<K, V>) cacheData.peek(fqn, includeDeletedNodes);
+ return (NodeSPI<K, V>) dataContainer.peek(fqn, includeDeletedNodes);
}
public void addCacheListener(Object listener)
@@ -576,9 +576,9 @@
return getChildrenNames(Fqn.fromString(fqn));
}
- public DataContainer getCacheData()
+ public DataContainer getDataContainer()
{
- return cacheData;
+ return dataContainer;
}
protected void cacheStatusCheck(InvocationContext ctx)
Modified: core/trunk/src/main/java/org/jboss/cache/lock/LockManager.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/lock/LockManager.java 2008-04-28 14:03:57 UTC (rev 5721)
+++ core/trunk/src/main/java/org/jboss/cache/lock/LockManager.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -30,19 +30,19 @@
private Configuration configuration;
private long lockAcquisitionTimeout;
- private DataContainer cacheData;
+ private DataContainer dataContainer;
private NodeSPI rootNode;
private TransactionTable txTable;
private CommandsFactory commandsFactory;
@Inject
- public void inject(Configuration configuration, DataContainer cacheData, TransactionTable txTable,
+ public void inject(Configuration configuration, DataContainer dataContainer, TransactionTable txTable,
CommandsFactory commandsFactory)
{
this.configuration = configuration;
lockAcquisitionTimeout = configuration.getLockAcquisitionTimeout();
- this.cacheData = cacheData;
- rootNode = cacheData.getRoot();
+ this.dataContainer = dataContainer;
+ rootNode = dataContainer.getRoot();
this.txTable = txTable;
this.commandsFactory = commandsFactory;
}
@@ -71,7 +71,7 @@
created = lock(ctx, fqn, lockType, createIfNotExists, timeout, acquireLockOnParent, reverseRemoveCheck, createdNodes, skipNotification);
firstTry = false;
}
- while (createIfNotExists && (cacheData.peek(fqn, false, false) == null));// keep trying until we have the lock (fixes concurrent remove())
+ while (createIfNotExists && (dataContainer.peek(fqn, false, false) == null));// keep trying until we have the lock (fixes concurrent remove())
return created;
}
@@ -147,7 +147,7 @@
manageReverseRemove(gtx, currentNode, reverseRemoveCheck, createdNodes);
// make sure the lock we acquired isn't on a deleted node/is an orphan!!
// look into invalidated nodes as well
- NodeSPI repeek = cacheData.peek(currentNodeFqn, true, true);
+ NodeSPI repeek = dataContainer.peek(currentNodeFqn, true, true);
if (currentNode != repeek)
{
if (log.isTraceEnabled())
@@ -156,7 +156,7 @@
// check if the parent exists!!
// look into invalidated nodes as well
currentNode.getLock().releaseAll(owner);
- if (parent == null || cacheData.peek(parent.getFqn(), true, true) == null)
+ if (parent == null || dataContainer.peek(parent.getFqn(), true, true) == null)
{
// crap!
if (log.isTraceEnabled())
@@ -221,7 +221,7 @@
{
return true;// we're doing a remove and we've reached the PARENT node of the target to be removed.
}
- if (!isTargetNode && cacheData.peek(targetFqn.getAncestor(currentNodeIndex + 2), false, false) == null)
+ if (!isTargetNode && dataContainer.peek(targetFqn.getAncestor(currentNodeIndex + 2), false, false) == null)
//if (!isTargetNode && cache.peek(targetFqn.getAncestor(currentNodeIndex + 2), false) == null)
//if (!isTargetNode && cache.peek(new Fqn(currentNode.getFqn(), targetFqn.get(currentNodeIndex + 1)), false) == null)
{
Modified: core/trunk/src/main/java/org/jboss/cache/marshall/AbstractMarshaller.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/marshall/AbstractMarshaller.java 2008-04-28 14:03:57 UTC (rev 5721)
+++ core/trunk/src/main/java/org/jboss/cache/marshall/AbstractMarshaller.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -171,7 +171,7 @@
fqn = extractFqn(((ReplicateCommand) cmd).getModifications().get(0));
break;
case ClusteredGetCommand.METHOD_ID:
- fqn = ((ClusteredGetCommand) cmd).getCacheDataComand().getFqn();
+ fqn = ((ClusteredGetCommand) cmd).getDataCommand().getFqn();
break;
default:
if (cmd instanceof DataCommand)
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 14:03:57 UTC (rev 5721)
+++ core/trunk/src/main/java/org/jboss/cache/util/CachePrinter.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -23,7 +23,7 @@
public static String printCacheDetails(Cache c)
{
// internal cast
- DataContainer ci = ((CacheInvocationDelegate) c).getCacheData();
+ DataContainer ci = ((CacheInvocationDelegate) c).getDataContainer();
return ci.printDetails();
}
@@ -36,7 +36,7 @@
public static String printCacheLockingInfo(Cache c)
{
// internal cast
- DataContainer cd = ((CacheInvocationDelegate) c).getCacheData();
+ DataContainer cd = ((CacheInvocationDelegate) c).getDataContainer();
return cd.printLockInfo();
}
Modified: core/trunk/src/test/java/org/jboss/cache/demo/JBossCacheGUI.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/demo/JBossCacheGUI.java 2008-04-28 14:03:57 UTC (rev 5721)
+++ core/trunk/src/test/java/org/jboss/cache/demo/JBossCacheGUI.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -14,7 +14,6 @@
import org.jboss.cache.Cache;
import org.jboss.cache.Fqn;
import org.jboss.cache.Node;
-import org.jboss.cache.invocation.CacheInvocationDelegate;
import org.jboss.cache.lock.TimeoutException;
import org.jboss.cache.notifications.annotation.CacheListener;
import org.jboss.cache.notifications.annotation.NodeCreated;
@@ -26,6 +25,7 @@
import org.jboss.cache.notifications.event.NodeEvent;
import org.jboss.cache.notifications.event.NodeModifiedEvent;
import org.jboss.cache.notifications.event.ViewChangedEvent;
+import org.jboss.cache.util.CachePrinter;
import org.jgroups.Address;
import javax.swing.*;
@@ -1064,7 +1064,7 @@
public void actionPerformed(ActionEvent e)
{
- System.out.println("\n*** lock information ****\n" + ((CacheInvocationDelegate) cache).getCacheData().printLockInfo());
+ System.out.println("\n*** lock information ****\n" + CachePrinter.printCacheLockingInfo(cache));
}
}
Modified: core/trunk/src/test/java/org/jboss/cache/loader/BdbjeCacheLoaderTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/loader/BdbjeCacheLoaderTest.java 2008-04-28 14:03:57 UTC (rev 5721)
+++ core/trunk/src/test/java/org/jboss/cache/loader/BdbjeCacheLoaderTest.java 2008-04-28 14:31:25 UTC (rev 5722)
@@ -1,9 +1,9 @@
package org.jboss.cache.loader;
-import static org.testng.AssertJUnit.assertEquals;
-
import org.jboss.cache.Fqn;
import org.jboss.cache.misc.TestingUtil;
+import static org.testng.AssertJUnit.assertEquals;
+import org.testng.annotations.Test;
/**
* Runs the same tests as {@link FileCacheLoaderTest}, but with Berkeley DB instead of a file-based CacheLoader
@@ -11,6 +11,7 @@
* @author Bela Ban
* @version $Id$
*/
+@Test(groups = "functional")
public class BdbjeCacheLoaderTest extends CacheLoaderTestsBase
{
protected void configureCache() throws Exception
16 years, 8 months
JBoss Cache SVN: r5721 - in core/trunk/src/main/java/org/jboss/cache/commands: write and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-04-28 10:03:57 -0400 (Mon, 28 Apr 2008)
New Revision: 5721
Removed:
core/trunk/src/main/java/org/jboss/cache/commands/read/RemoteExistsNodeCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/EvictNodeCommand.java
Log:
Deleted: core/trunk/src/main/java/org/jboss/cache/commands/read/RemoteExistsNodeCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/read/RemoteExistsNodeCommand.java 2008-04-28 14:00:46 UTC (rev 5720)
+++ core/trunk/src/main/java/org/jboss/cache/commands/read/RemoteExistsNodeCommand.java 2008-04-28 14:03:57 UTC (rev 5721)
@@ -1,52 +0,0 @@
-package org.jboss.cache.commands.read;
-
-import org.jboss.cache.Fqn;
-import org.jboss.cache.InvocationContext;
-import org.jboss.cache.Node;
-import org.jboss.cache.commands.Visitor;
-
-/**
- * Checks whether a given node exists in current in-memory state of the cache.
- * Does not acquire any locks in doing so (result may be dirty read). Does
- * not attempt to load nodes from a cache loader (may return false if a
- * node has been evicted).
- *
- * @author Mircea.Markus(a)jboss.com
- * @since 2.2
- * todo - this is only used when remote cache calls exists, nut sure it is necessary to have it as a command
- */
-public class RemoteExistsNodeCommand extends AbstractDataCommand
-{
- public static final int METHOD_ID = 16;
-
- public RemoteExistsNodeCommand()
- {
- }
-
- public RemoteExistsNodeCommand(Fqn fqn)
- {
- this.fqn = fqn;
- }
-
- public Object perform(InvocationContext ctx)
- {
- Node n = cacheData.peek(fqn, false);
- return n != null;
- }
-
- public Object acceptVisitor(InvocationContext ctx, Visitor visitor) throws Throwable
- {
- return visitor.handleExistsNodeCommand(ctx, this);
- }
-
- public int getCommandId()
- {
- return METHOD_ID;
- }
-
- @Override
- public String toString()
- {
- return "RemoteExistsNodeCommand{}";
- }
-}
Deleted: core/trunk/src/main/java/org/jboss/cache/commands/write/EvictNodeCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/EvictNodeCommand.java 2008-04-28 14:00:46 UTC (rev 5720)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/EvictNodeCommand.java 2008-04-28 14:03:57 UTC (rev 5721)
@@ -1,60 +0,0 @@
-package org.jboss.cache.commands.write;
-
-import org.jboss.cache.Fqn;
-import org.jboss.cache.InvocationContext;
-import org.jboss.cache.commands.Visitor;
-
-/**
- * Implements functionality defined by {@link org.jboss.cache.CacheSPI#evict(org.jboss.cache.Fqn)}
- *
- * @author Mircea.Markus(a)jboss.com
- * @since 2.2
- */
-public class EvictNodeCommand extends AbstractVersionedDataCommand
-{
- public static final int METHOD_ID = 8;
- public static final int VERSIONED_METHOD_ID = 9;
-
- public EvictNodeCommand(Fqn fqn)
- {
- this.fqn = fqn;
- }
-
- public Object perform(InvocationContext ctx)
- {
- notifier.notifyNodeEvicted(fqn, true, ctx);
- boolean evicted = cacheData.evict(fqn);
- notifier.notifyNodeEvicted(fqn, false, ctx);
- return evicted;
- }
-
- public Object acceptVisitor(InvocationContext ctx, Visitor visitor) throws Throwable
- {
- return visitor.handleEvictFqnCommand(ctx, this);
- }
-
- public int getCommandId()
- {
- return isVersioned() ? VERSIONED_METHOD_ID : METHOD_ID;
- }
-
- @Override
- protected boolean isVersionedId(int id)
- {
- return VERSIONED_METHOD_ID == id;
- }
-
- @Override
- public String toString()
- {
- return "EvictNodeCommand{" +
- "fqn=" + fqn +
- ", dataVersion=" + dataVersion +
- "}";
- }
-
- public void rollback()
- {
- // this is a no-op.
- }
-}
16 years, 8 months
JBoss Cache SVN: r5720 - in core/trunk/src: main/java/org/jboss/cache/jmx and 6 other directories.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)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(a)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(a)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);
16 years, 8 months
JBoss Cache SVN: r5719 - in core/trunk/src: main/java/org/jboss/cache/factories and 7 other directories.
by jbosscache-commits@lists.jboss.org
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(a)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
{
16 years, 8 months
JBoss Cache SVN: r5718 - in core/trunk/src/main/java/org/jboss/cache: commands/read and 2 other directories.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-04-28 08:18:52 -0400 (Mon, 28 Apr 2008)
New Revision: 5718
Modified:
core/trunk/src/main/java/org/jboss/cache/LifecycleManager.java
core/trunk/src/main/java/org/jboss/cache/commands/read/RemoteExistsCommand.java
core/trunk/src/main/java/org/jboss/cache/interceptors/InterceptorChain.java
core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticLockingInterceptor.java
core/trunk/src/main/java/org/jboss/cache/util/CachePrinter.java
Log:
worked on todos
Modified: core/trunk/src/main/java/org/jboss/cache/LifecycleManager.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/LifecycleManager.java 2008-04-28 12:10:43 UTC (rev 5717)
+++ core/trunk/src/main/java/org/jboss/cache/LifecycleManager.java 2008-04-28 12:18:52 UTC (rev 5718)
@@ -196,9 +196,6 @@
removeConfigurationDependentComponents();
// this will recreate any missing components based on the current config
- //todo [mmarkus] updateDependencies should be moved in this class. Component registry's is not to care
- // todo about particular instances that are manipulated there ; it should be keept generic
- // todo [MANIK] NOT true. The ComponentRegistry is a state machine and is responsible for maintaining states and dependencies.
componentRegistry.updateDependencies();
componentRegistry.wireDependencies(cacheData.getRoot());
@@ -207,15 +204,9 @@
// start all internal components
componentRegistry.start();
- //todo this is important info that needs to be printed, add it somewhere ...
-// if (log.isDebugEnabled())
- //log.debug("ChainedInterceptor chain is:\n" + CachePrinter.printInterceptorChain(cacheCommand));
+ if (log.isDebugEnabled())
+ log.debug("Interceptor chain is: " + componentRegistry.getComponent(InterceptorChain.class));
-// if (configuration.getNodeLockingScheme() == Configuration.NodeLockingScheme.OPTIMISTIC && transactionManager == null)
-// {
-// log.fatal("No transaction manager lookup class has been defined. Transactions cannot be used and thus OPTIMISTIC locking cannot be used! Expect errors!!");
-// }
-
correctRootNodeType();
switch (configuration.getCacheMode())
Modified: core/trunk/src/main/java/org/jboss/cache/commands/read/RemoteExistsCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/read/RemoteExistsCommand.java 2008-04-28 12:10:43 UTC (rev 5717)
+++ core/trunk/src/main/java/org/jboss/cache/commands/read/RemoteExistsCommand.java 2008-04-28 12:18:52 UTC (rev 5718)
@@ -10,11 +10,12 @@
* Does not acquire any locks in doing so (result may be dirty read). Does
* not attempt to load nodes from a cache loader (may return false if a
* node has been evicted).
+ * <p/>
+ * Specifically used by the {@link org.jboss.cache.loader.ClusteredCacheLoader} to implement {@link org.jboss.cache.loader.CacheLoader#exists(org.jboss.cache.Fqn)}
+ * <p/>
*
* @author Mircea.Markus(a)jboss.com
* @since 2.2
- * todo - this is only used when remote cache calls exists, nut sure it is necessary to have it as a command
- * todo- see if this is used at all!!
*/
public class RemoteExistsCommand extends AbstractDataCommand
{
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:10:43 UTC (rev 5717)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/InterceptorChain.java 2008-04-28 12:18:52 UTC (rev 5718)
@@ -8,6 +8,7 @@
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.interceptors.base.VisitorInterceptor;
import org.jboss.cache.invocation.InvocationContextContainer;
+import org.jboss.cache.util.CachePrinter;
import java.util.ArrayList;
import java.util.Collections;
@@ -298,4 +299,12 @@
{
return invocationContextContainer.get();
}
+
+
+ public String toString()
+ {
+ return "InterceptorChain{\n" +
+ CachePrinter.printInterceptorChain(firstInChain) +
+ "\n}";
+ }
}
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticLockingInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticLockingInterceptor.java 2008-04-28 12:10:43 UTC (rev 5717)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticLockingInterceptor.java 2008-04-28 12:18:52 UTC (rev 5718)
@@ -15,6 +15,7 @@
import org.jboss.cache.commands.tx.RollbackCommand;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.factories.annotations.Inject;
+import org.jboss.cache.factories.annotations.Start;
import static org.jboss.cache.lock.NodeLock.LockType.READ;
import static org.jboss.cache.lock.NodeLock.LockType.WRITE;
import org.jboss.cache.optimistic.TransactionWorkspace;
@@ -44,6 +45,13 @@
lockAcquisitionTimeout = configuration.getLockAcquisitionTimeout();
}
+ @Start
+ private void checkTransactionManager()
+ {
+ if (txManager == null)
+ log.fatal("No transaction manager lookup class has been defined. Transactions cannot be used and thus OPTIMISTIC locking cannot be used! Expect errors!!");
+ }
+
@Override
public Object handleOptimisticPrepareCommand(InvocationContext ctx, OptimisticPrepareCommand command) throws Throwable
{
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:10:43 UTC (rev 5717)
+++ core/trunk/src/main/java/org/jboss/cache/util/CachePrinter.java 2008-04-28 12:18:52 UTC (rev 5718)
@@ -66,7 +66,7 @@
{
sb.append(printInterceptorChain(i.getNext())).append("\n");
}
- sb.append(">> ");
+ sb.append("\t>> ");
sb.append(i.getClass().getName());
}
return sb.toString();
16 years, 8 months
JBoss Cache SVN: r5717 - core/trunk/src/main/java/org/jboss/cache/commands/remote.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-04-28 08:10:43 -0400 (Mon, 28 Apr 2008)
New Revision: 5717
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/remote/AnnounceBuddyPoolNameCommand.java
Log:
worked on todos
Modified: core/trunk/src/main/java/org/jboss/cache/commands/remote/AnnounceBuddyPoolNameCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/remote/AnnounceBuddyPoolNameCommand.java 2008-04-28 12:10:28 UTC (rev 5716)
+++ core/trunk/src/main/java/org/jboss/cache/commands/remote/AnnounceBuddyPoolNameCommand.java 2008-04-28 12:10:43 UTC (rev 5717)
@@ -4,7 +4,6 @@
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.buddyreplication.BuddyManager;
-import org.jboss.cache.commands.ReplicableCommand;
import org.jboss.cache.factories.annotations.Inject;
import org.jgroups.Address;
@@ -12,7 +11,7 @@
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
-public class AnnounceBuddyPoolNameCommand implements ReplicableCommand
+public class AnnounceBuddyPoolNameCommand extends AbstractReplicableCommand
{
public static final int METHOD_ID = 28;
private static final Log log = LogFactory.getLog(AnnounceBuddyPoolNameCommand.class);
16 years, 8 months
JBoss Cache SVN: r5716 - in core/trunk/src/main/java/org/jboss/cache: commands and 10 other directories.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-04-28 08:10:28 -0400 (Mon, 28 Apr 2008)
New Revision: 5716
Added:
core/trunk/src/main/java/org/jboss/cache/commands/read/RemoteExistsCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/remote/AbstractReplicableCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/EvictCommand.java
Modified:
core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyFqnTransformer.java
core/trunk/src/main/java/org/jboss/cache/commands/AbstractVisitor.java
core/trunk/src/main/java/org/jboss/cache/commands/Visitor.java
core/trunk/src/main/java/org/jboss/cache/commands/read/AbstractDataCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/remote/AssignToBuddyGroupCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/remote/ClusteredGetCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/remote/DataGravitationCleanupCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/remote/RemoveFromBuddyGroupCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/remote/ReplicateCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/tx/AbstractTransactionCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/AbstractVersionedDataCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/InvalidateCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveNodeCommand.java
core/trunk/src/main/java/org/jboss/cache/factories/CommandsFactory.java
core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java
core/trunk/src/main/java/org/jboss/cache/interceptors/CacheMgmtInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/EvictionInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticReplicationInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/PassivationInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
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/invocation/CacheInvocationDelegate.java
core/trunk/src/main/java/org/jboss/cache/loader/ClusteredCacheLoader.java
core/trunk/src/main/java/org/jboss/cache/loader/NonManagedConnectionFactory.java
core/trunk/src/main/java/org/jboss/cache/marshall/AbstractMarshaller.java
Log:
worked on todos
Modified: core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyFqnTransformer.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyFqnTransformer.java 2008-04-28 11:19:32 UTC (rev 5715)
+++ core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyFqnTransformer.java 2008-04-28 12:10:28 UTC (rev 5716)
@@ -11,13 +11,13 @@
import org.jboss.cache.commands.read.GetKeysCommand;
import org.jboss.cache.commands.read.GetNodeCommand;
import org.jboss.cache.commands.read.GravitateDataCommand;
-import org.jboss.cache.commands.read.RemoteExistsNodeCommand;
+import org.jboss.cache.commands.read.RemoteExistsCommand;
import org.jboss.cache.commands.tx.CommitCommand;
import org.jboss.cache.commands.tx.OptimisticPrepareCommand;
import org.jboss.cache.commands.tx.PrepareCommand;
import org.jboss.cache.commands.tx.RollbackCommand;
import org.jboss.cache.commands.write.CreateNodeCommand;
-import org.jboss.cache.commands.write.EvictNodeCommand;
+import org.jboss.cache.commands.write.EvictCommand;
import org.jboss.cache.commands.write.InvalidateCommand;
import org.jboss.cache.commands.write.MoveCommand;
import org.jboss.cache.commands.write.PutDataMapCommand;
@@ -100,7 +100,7 @@
}
@Override
- public Object handleEvictFqnCommand(InvocationContext ctx, EvictNodeCommand command) throws Throwable
+ public Object handleEvictFqnCommand(InvocationContext ctx, EvictCommand command) throws Throwable
{
Fqn fqn = getBackupFqn(command.getFqn());
return factory.buildEvictFqnCommand(fqn);
@@ -128,7 +128,7 @@
}
@Override
- public Object handleExistsNodeCommand(InvocationContext ctx, RemoteExistsNodeCommand command) throws Throwable
+ public Object handleExistsNodeCommand(InvocationContext ctx, RemoteExistsCommand command) throws Throwable
{
Fqn transformed = getBackupFqn(command.getFqn());
return factory.buildEvictFqnCommand(transformed);
Modified: core/trunk/src/main/java/org/jboss/cache/commands/AbstractVisitor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/AbstractVisitor.java 2008-04-28 11:19:32 UTC (rev 5715)
+++ core/trunk/src/main/java/org/jboss/cache/commands/AbstractVisitor.java 2008-04-28 12:10:28 UTC (rev 5716)
@@ -7,13 +7,13 @@
import org.jboss.cache.commands.read.GetKeysCommand;
import org.jboss.cache.commands.read.GetNodeCommand;
import org.jboss.cache.commands.read.GravitateDataCommand;
-import org.jboss.cache.commands.read.RemoteExistsNodeCommand;
+import org.jboss.cache.commands.read.RemoteExistsCommand;
import org.jboss.cache.commands.tx.CommitCommand;
import org.jboss.cache.commands.tx.OptimisticPrepareCommand;
import org.jboss.cache.commands.tx.PrepareCommand;
import org.jboss.cache.commands.tx.RollbackCommand;
import org.jboss.cache.commands.write.CreateNodeCommand;
-import org.jboss.cache.commands.write.EvictNodeCommand;
+import org.jboss.cache.commands.write.EvictCommand;
import org.jboss.cache.commands.write.InvalidateCommand;
import org.jboss.cache.commands.write.MoveCommand;
import org.jboss.cache.commands.write.PutDataMapCommand;
@@ -50,7 +50,7 @@
return handleDefault(ctx, command);
}
- public Object handleEvictFqnCommand(InvocationContext ctx, EvictNodeCommand command) throws Throwable
+ public Object handleEvictFqnCommand(InvocationContext ctx, EvictCommand command) throws Throwable
{
return handleDefault(ctx, command);
}
@@ -70,7 +70,7 @@
return handleDefault(ctx, command);
}
- public Object handleExistsNodeCommand(InvocationContext ctx, RemoteExistsNodeCommand command) throws Throwable
+ public Object handleExistsNodeCommand(InvocationContext ctx, RemoteExistsCommand command) throws Throwable
{
return handleDefault(ctx, command);
}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/Visitor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/Visitor.java 2008-04-28 11:19:32 UTC (rev 5715)
+++ core/trunk/src/main/java/org/jboss/cache/commands/Visitor.java 2008-04-28 12:10:28 UTC (rev 5716)
@@ -7,13 +7,13 @@
import org.jboss.cache.commands.read.GetKeysCommand;
import org.jboss.cache.commands.read.GetNodeCommand;
import org.jboss.cache.commands.read.GravitateDataCommand;
-import org.jboss.cache.commands.read.RemoteExistsNodeCommand;
+import org.jboss.cache.commands.read.RemoteExistsCommand;
import org.jboss.cache.commands.tx.CommitCommand;
import org.jboss.cache.commands.tx.OptimisticPrepareCommand;
import org.jboss.cache.commands.tx.PrepareCommand;
import org.jboss.cache.commands.tx.RollbackCommand;
import org.jboss.cache.commands.write.CreateNodeCommand;
-import org.jboss.cache.commands.write.EvictNodeCommand;
+import org.jboss.cache.commands.write.EvictCommand;
import org.jboss.cache.commands.write.InvalidateCommand;
import org.jboss.cache.commands.write.MoveCommand;
import org.jboss.cache.commands.write.PutDataMapCommand;
@@ -67,7 +67,7 @@
1 - evictNodeMethodLocal_id
2 - evictVersionedNodeMethodLocal_id
*/
- Object handleEvictFqnCommand(InvocationContext ctx, EvictNodeCommand evictFqnCommand) throws Throwable;
+ Object handleEvictFqnCommand(InvocationContext ctx, EvictCommand evictFqnCommand) throws Throwable;
/*
equiv of old:
@@ -92,7 +92,7 @@
equiv of old:
1 - existsMethod_id
*/
- Object handleExistsNodeCommand(InvocationContext ctx, RemoteExistsNodeCommand existsNodeCommand) throws Throwable;
+ Object handleExistsNodeCommand(InvocationContext ctx, RemoteExistsCommand existsNodeCommand) throws Throwable;
/*
equiv of old:
Modified: core/trunk/src/main/java/org/jboss/cache/commands/read/AbstractDataCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/read/AbstractDataCommand.java 2008-04-28 11:19:32 UTC (rev 5715)
+++ core/trunk/src/main/java/org/jboss/cache/commands/read/AbstractDataCommand.java 2008-04-28 12:10:28 UTC (rev 5716)
@@ -3,14 +3,14 @@
import org.jboss.cache.DataContainer;
import org.jboss.cache.Fqn;
import org.jboss.cache.commands.DataCommand;
+import org.jboss.cache.factories.annotations.CacheInjectionMethods;
import org.jboss.cache.factories.annotations.Inject;
/**
- * // TODO: MANIK: Document this
- *
* @author Manik Surtani (<a href="mailto:manik@jboss.org">manik(a)jboss.org</a>)
* @since 2.2.0
*/
+@CacheInjectionMethods
public abstract class AbstractDataCommand implements DataCommand
{
protected Fqn fqn;
Copied: core/trunk/src/main/java/org/jboss/cache/commands/read/RemoteExistsCommand.java (from rev 5714, core/trunk/src/main/java/org/jboss/cache/commands/read/RemoteExistsNodeCommand.java)
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/read/RemoteExistsCommand.java (rev 0)
+++ core/trunk/src/main/java/org/jboss/cache/commands/read/RemoteExistsCommand.java 2008-04-28 12:10:28 UTC (rev 5716)
@@ -0,0 +1,53 @@
+package org.jboss.cache.commands.read;
+
+import org.jboss.cache.Fqn;
+import org.jboss.cache.InvocationContext;
+import org.jboss.cache.Node;
+import org.jboss.cache.commands.Visitor;
+
+/**
+ * Checks whether a given node exists in current in-memory state of the cache.
+ * Does not acquire any locks in doing so (result may be dirty read). Does
+ * not attempt to load nodes from a cache loader (may return false if a
+ * node has been evicted).
+ *
+ * @author Mircea.Markus(a)jboss.com
+ * @since 2.2
+ * todo - this is only used when remote cache calls exists, nut sure it is necessary to have it as a command
+ * todo- see if this is used at all!!
+ */
+public class RemoteExistsCommand extends AbstractDataCommand
+{
+ public static final int METHOD_ID = 16;
+
+ public RemoteExistsCommand()
+ {
+ }
+
+ public RemoteExistsCommand(Fqn fqn)
+ {
+ this.fqn = fqn;
+ }
+
+ public Object perform(InvocationContext ctx)
+ {
+ Node n = cacheData.peek(fqn, false);
+ return n != null;
+ }
+
+ public Object acceptVisitor(InvocationContext ctx, Visitor visitor) throws Throwable
+ {
+ return visitor.handleExistsNodeCommand(ctx, this);
+ }
+
+ public int getCommandId()
+ {
+ return METHOD_ID;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "RemoteExistsNodeCommand{}";
+ }
+}
Added: core/trunk/src/main/java/org/jboss/cache/commands/remote/AbstractReplicableCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/remote/AbstractReplicableCommand.java (rev 0)
+++ core/trunk/src/main/java/org/jboss/cache/commands/remote/AbstractReplicableCommand.java 2008-04-28 12:10:28 UTC (rev 5716)
@@ -0,0 +1,16 @@
+package org.jboss.cache.commands.remote;
+
+import org.jboss.cache.commands.ReplicableCommand;
+import org.jboss.cache.factories.annotations.CacheInjectionMethods;
+
+/**
+ * An empty abstract class to provide the {@link org.jboss.cache.factories.annotations.CacheInjectionMethods} annotation
+ * for all subclasses.
+ *
+ * @author Manik Surtani (<a href="mailto:manik@jboss.org">manik(a)jboss.org</a>)
+ * @since 2.2.0
+ */
+@CacheInjectionMethods
+public abstract class AbstractReplicableCommand implements ReplicableCommand
+{
+}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/remote/AssignToBuddyGroupCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/remote/AssignToBuddyGroupCommand.java 2008-04-28 11:19:32 UTC (rev 5715)
+++ core/trunk/src/main/java/org/jboss/cache/commands/remote/AssignToBuddyGroupCommand.java 2008-04-28 12:10:28 UTC (rev 5716)
@@ -4,7 +4,6 @@
import org.jboss.cache.InvocationContext;
import org.jboss.cache.buddyreplication.BuddyGroup;
import org.jboss.cache.buddyreplication.BuddyManager;
-import org.jboss.cache.commands.ReplicableCommand;
import org.jboss.cache.factories.annotations.Inject;
import java.util.Arrays;
@@ -14,7 +13,7 @@
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
-public class AssignToBuddyGroupCommand implements ReplicableCommand
+public class AssignToBuddyGroupCommand extends AbstractReplicableCommand
{
public static final int METHOD_ID = 29;
Modified: core/trunk/src/main/java/org/jboss/cache/commands/remote/ClusteredGetCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/remote/ClusteredGetCommand.java 2008-04-28 11:19:32 UTC (rev 5715)
+++ core/trunk/src/main/java/org/jboss/cache/commands/remote/ClusteredGetCommand.java 2008-04-28 12:10:28 UTC (rev 5716)
@@ -5,10 +5,9 @@
import org.jboss.cache.DataContainer;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.commands.DataCommand;
-import org.jboss.cache.commands.ReplicableCommand;
import org.jboss.cache.commands.read.GetChildrenNamesCommand;
import org.jboss.cache.commands.read.GetDataMapCommand;
-import org.jboss.cache.commands.read.RemoteExistsNodeCommand;
+import org.jboss.cache.commands.read.RemoteExistsCommand;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.interceptors.InterceptorChain;
@@ -20,7 +19,7 @@
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
-public class ClusteredGetCommand implements ReplicableCommand
+public class ClusteredGetCommand extends AbstractReplicableCommand
{
public static final int METHOD_ID = 22;
@@ -107,7 +106,7 @@
{
return callResults != null && cacheData.exists(cacheDataComand.getFqn());
}
- return cacheDataComand instanceof RemoteExistsNodeCommand && (Boolean) callResults;
+ return cacheDataComand instanceof RemoteExistsCommand && (Boolean) callResults;
}
/**
Modified: core/trunk/src/main/java/org/jboss/cache/commands/remote/DataGravitationCleanupCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/remote/DataGravitationCleanupCommand.java 2008-04-28 11:19:32 UTC (rev 5715)
+++ core/trunk/src/main/java/org/jboss/cache/commands/remote/DataGravitationCleanupCommand.java 2008-04-28 12:10:28 UTC (rev 5716)
@@ -8,8 +8,7 @@
import org.jboss.cache.NodeSPI;
import org.jboss.cache.buddyreplication.BuddyFqnTransformer;
import org.jboss.cache.buddyreplication.BuddyManager;
-import org.jboss.cache.commands.ReplicableCommand;
-import org.jboss.cache.commands.write.EvictNodeCommand;
+import org.jboss.cache.commands.write.EvictCommand;
import org.jboss.cache.commands.write.RemoveNodeCommand;
import org.jboss.cache.factories.CommandsFactory;
import org.jboss.cache.factories.annotations.Inject;
@@ -25,7 +24,7 @@
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
-public class DataGravitationCleanupCommand implements ReplicableCommand
+public class DataGravitationCleanupCommand extends AbstractReplicableCommand
{
public static final int METHOD_ID = 34;
@@ -143,7 +142,7 @@
List<Fqn> toEvict = cacheData.getNodesForEviction(fqn, true);
for (Fqn aFqn : toEvict)
{
- EvictNodeCommand evictFqnCommand = commandsFactory.buildEvictFqnCommand(aFqn);
+ EvictCommand evictFqnCommand = commandsFactory.buildEvictFqnCommand(aFqn);
invoker.invoke(evictFqnCommand);
}
}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/remote/RemoveFromBuddyGroupCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/remote/RemoveFromBuddyGroupCommand.java 2008-04-28 11:19:32 UTC (rev 5715)
+++ core/trunk/src/main/java/org/jboss/cache/commands/remote/RemoveFromBuddyGroupCommand.java 2008-04-28 12:10:28 UTC (rev 5716)
@@ -2,14 +2,13 @@
import org.jboss.cache.InvocationContext;
import org.jboss.cache.buddyreplication.BuddyManager;
-import org.jboss.cache.commands.ReplicableCommand;
import org.jboss.cache.factories.annotations.Inject;
/**
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
-public class RemoveFromBuddyGroupCommand implements ReplicableCommand
+public class RemoveFromBuddyGroupCommand extends AbstractReplicableCommand
{
public static final int METHOD_ID = 30;
Modified: core/trunk/src/main/java/org/jboss/cache/commands/remote/ReplicateCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/remote/ReplicateCommand.java 2008-04-28 11:19:32 UTC (rev 5715)
+++ core/trunk/src/main/java/org/jboss/cache/commands/remote/ReplicateCommand.java 2008-04-28 12:10:28 UTC (rev 5716)
@@ -18,7 +18,7 @@
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
-public class ReplicateCommand implements ReplicableCommand
+public class ReplicateCommand extends AbstractReplicableCommand
{
public static final int SINGLE_METHOD_ID = 13;
public static final int MULTIPLE_METHOD_ID = 14;
Modified: core/trunk/src/main/java/org/jboss/cache/commands/tx/AbstractTransactionCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/tx/AbstractTransactionCommand.java 2008-04-28 11:19:32 UTC (rev 5715)
+++ core/trunk/src/main/java/org/jboss/cache/commands/tx/AbstractTransactionCommand.java 2008-04-28 12:10:28 UTC (rev 5716)
@@ -2,6 +2,7 @@
import org.jboss.cache.InvocationContext;
import org.jboss.cache.commands.VisitableCommand;
+import org.jboss.cache.factories.annotations.CacheInjectionMethods;
import org.jboss.cache.transaction.GlobalTransaction;
/**
@@ -10,6 +11,7 @@
* @author Manik Surtani (<a href="mailto:manik@jboss.org">manik(a)jboss.org</a>)
* @since 2.2.0
*/
+@CacheInjectionMethods
public abstract class AbstractTransactionCommand implements VisitableCommand
{
protected GlobalTransaction globalTransaction;
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/AbstractVersionedDataCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/AbstractVersionedDataCommand.java 2008-04-28 11:19:32 UTC (rev 5715)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/AbstractVersionedDataCommand.java 2008-04-28 12:10:28 UTC (rev 5716)
@@ -3,6 +3,7 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.commands.VersionedDataCommand;
import org.jboss.cache.commands.read.AbstractDataCommand;
+import org.jboss.cache.factories.annotations.CacheInjectionMethods;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.notifications.Notifier;
import org.jboss.cache.optimistic.DataVersion;
@@ -14,6 +15,7 @@
* @author Manik Surtani (<a href="mailto:manik@jboss.org">manik(a)jboss.org</a>)
* @since 2.2.0
*/
+@CacheInjectionMethods
public abstract class AbstractVersionedDataCommand extends AbstractDataCommand implements VersionedDataCommand
{
protected DataVersion dataVersion;
Copied: core/trunk/src/main/java/org/jboss/cache/commands/write/EvictCommand.java (from rev 5714, core/trunk/src/main/java/org/jboss/cache/commands/write/EvictNodeCommand.java)
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/EvictCommand.java (rev 0)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/EvictCommand.java 2008-04-28 12:10:28 UTC (rev 5716)
@@ -0,0 +1,106 @@
+package org.jboss.cache.commands.write;
+
+import org.jboss.cache.Fqn;
+import org.jboss.cache.InvocationContext;
+import org.jboss.cache.commands.Visitor;
+
+import java.util.List;
+
+/**
+ * Implements functionality defined by {@link org.jboss.cache.CacheSPI#evict(org.jboss.cache.Fqn)}
+ *
+ * @author Mircea.Markus(a)jboss.com
+ * @since 2.2
+ */
+public class EvictCommand extends AbstractVersionedDataCommand
+{
+ public static final int METHOD_ID = 8;
+ public static final int VERSIONED_METHOD_ID = 9;
+
+ private boolean recursive = false;
+
+ public EvictCommand(Fqn fqn)
+ {
+ this.fqn = fqn;
+ }
+
+ public Object perform(InvocationContext ctx)
+ {
+ if (recursive)
+ {
+
+ List<Fqn> nodesToEvict = cacheData.getNodesForEviction(fqn, true);
+
+ for (Fqn aFqn : nodesToEvict)
+ {
+ evictNode(aFqn, ctx);
+ }
+ }
+ else
+ {
+ evictNode(fqn, ctx);
+ }
+ return null;
+ }
+
+ void evictNode(Fqn fqn, InvocationContext ctx)
+ {
+ notifier.notifyNodeEvicted(fqn, true, ctx);
+ cacheData.evict(fqn);
+ notifier.notifyNodeEvicted(fqn, false, ctx);
+ }
+
+ public Object acceptVisitor(InvocationContext ctx, Visitor visitor) throws Throwable
+ {
+ return visitor.handleEvictFqnCommand(ctx, this);
+ }
+
+ public int getCommandId()
+ {
+ return isVersioned() ? VERSIONED_METHOD_ID : METHOD_ID;
+ }
+
+ @Override
+ protected boolean isVersionedId(int id)
+ {
+ return VERSIONED_METHOD_ID == id;
+ }
+
+ public boolean isRecursive()
+ {
+ return recursive;
+ }
+
+ public void setRecursive(boolean recursive)
+ {
+ this.recursive = recursive;
+ }
+
+ @Override
+ public Object[] getParameters()
+ {
+ throw new UnsupportedOperationException(getClass().getSimpleName() + " is not meant to be marshalled and replicated!");
+ }
+
+ @Override
+ public void setParameters(int commandId, Object[] args)
+ {
+ throw new UnsupportedOperationException(getClass().getSimpleName() + " is not meant to be marshalled and replicated!");
+ }
+
+
+ @Override
+ public String toString()
+ {
+ return "EvictNodeCommand{" +
+ "fqn=" + fqn +
+ ", recursive=" + recursive +
+ ", dataVersion=" + dataVersion +
+ "}";
+ }
+
+ public void rollback()
+ {
+ // this is a no-op.
+ }
+}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/InvalidateCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/InvalidateCommand.java 2008-04-28 11:19:32 UTC (rev 5715)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/InvalidateCommand.java 2008-04-28 12:10:28 UTC (rev 5716)
@@ -12,6 +12,7 @@
import org.jboss.cache.config.Configuration;
import org.jboss.cache.config.Option;
import org.jboss.cache.factories.annotations.Inject;
+import org.jboss.cache.optimistic.DataVersion;
import javax.transaction.Transaction;
import javax.transaction.TransactionManager;
@@ -31,7 +32,7 @@
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
-public class InvalidateCommand extends EvictNodeCommand
+public class InvalidateCommand extends EvictCommand
{
public static final int METHOD_ID = 47;
private static final Log log = LogFactory.getLog(InvalidateCommand.class);
@@ -65,7 +66,7 @@
@Override
public Object perform(InvocationContext ctx)
{
- //todo - rather than using CacheSPI this can rely in cache loader directly to load data
+ //todo - rather than using CacheSPI this should use peek(). The other interceptors should obtain locks and load nodes if necessary for this InvalidateCommand.
Node node = spi.getNode(fqn); // force interceptor chain, load if necessary from cache loader.
if (trace) log.trace("Invalidating fqn:" + fqn);
@@ -185,4 +186,18 @@
", dataVersion=" + dataVersion +
'}';
}
+
+ @Override
+ public Object[] getParameters()
+ {
+ return new Object[]{fqn, dataVersion};
+ }
+
+ @Override
+ public void setParameters(int commandId, Object[] args)
+ {
+ fqn = (Fqn) args[0];
+ dataVersion = (DataVersion) args[1];
+ }
+
}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveNodeCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveNodeCommand.java 2008-04-28 11:19:32 UTC (rev 5715)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveNodeCommand.java 2008-04-28 12:10:28 UTC (rev 5716)
@@ -6,8 +6,6 @@
import org.jboss.cache.InvocationContext;
import org.jboss.cache.NodeSPI;
import org.jboss.cache.commands.Visitor;
-import org.jboss.cache.config.Configuration;
-import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.optimistic.DataVersion;
import org.jboss.cache.transaction.GlobalTransaction;
@@ -27,8 +25,6 @@
private static final Log log = LogFactory.getLog(RemoveNodeCommand.class);
private static boolean trace;
- private boolean isOptimistic;
-
/*parameters*/
private boolean createUndoOps;
private boolean skipSendingNodeEvents;
@@ -52,13 +48,6 @@
this.eviction = eviction;
}
- @Inject
- public void initialize(Configuration configuration)
- {
- this.isOptimistic = configuration.isNodeLockingOptimistic();
- }
-
- //todo - why is this method using optimisticLocking param, as it NEVER gets called in an optimistic cache as it is intercepted
public Object perform(InvocationContext ctx)
{
NodeSPI parentNode;
@@ -79,7 +68,7 @@
boolean found;
// remove subtree from parent
- if (eviction || isOptimistic)
+ if (eviction)
{
// if there is no parent node and the fqn is root, found == true otherwise found == false.
found = targetNode.isValid() && parentNode == null ? fqn.isRoot() : parentNode.removeChildDirect(targetNode.getFqn().getLastElement());
Modified: core/trunk/src/main/java/org/jboss/cache/factories/CommandsFactory.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/factories/CommandsFactory.java 2008-04-28 11:19:32 UTC (rev 5715)
+++ core/trunk/src/main/java/org/jboss/cache/factories/CommandsFactory.java 2008-04-28 12:10:28 UTC (rev 5716)
@@ -13,7 +13,7 @@
import org.jboss.cache.commands.read.GetKeysCommand;
import org.jboss.cache.commands.read.GetNodeCommand;
import org.jboss.cache.commands.read.GravitateDataCommand;
-import org.jboss.cache.commands.read.RemoteExistsNodeCommand;
+import org.jboss.cache.commands.read.RemoteExistsCommand;
import org.jboss.cache.commands.remote.AnnounceBuddyPoolNameCommand;
import org.jboss.cache.commands.remote.AssignToBuddyGroupCommand;
import org.jboss.cache.commands.remote.ClusteredGetCommand;
@@ -25,7 +25,7 @@
import org.jboss.cache.commands.tx.PrepareCommand;
import org.jboss.cache.commands.tx.RollbackCommand;
import org.jboss.cache.commands.write.CreateNodeCommand;
-import org.jboss.cache.commands.write.EvictNodeCommand;
+import org.jboss.cache.commands.write.EvictCommand;
import org.jboss.cache.commands.write.InvalidateCommand;
import org.jboss.cache.commands.write.MoveCommand;
import org.jboss.cache.commands.write.PutDataMapCommand;
@@ -150,9 +150,9 @@
return command;
}
- public EvictNodeCommand buildEvictFqnCommand(Fqn fqn)
+ public EvictCommand buildEvictFqnCommand(Fqn fqn)
{
- EvictNodeCommand command = new EvictNodeCommand(fqn);
+ EvictCommand command = new EvictCommand(fqn);
registry.wireDependencies(command);
return command;
}
@@ -178,9 +178,9 @@
return command;
}
- public RemoteExistsNodeCommand buildExistsNodeCommand(Fqn fqn)
+ public RemoteExistsCommand buildExistsNodeCommand(Fqn fqn)
{
- RemoteExistsNodeCommand command = new RemoteExistsNodeCommand(fqn);
+ RemoteExistsCommand command = new RemoteExistsCommand(fqn);
registry.wireDependencies(command);
return command;
}
@@ -292,12 +292,11 @@
*/
public ReplicableCommand fromStream(int id, Object[] parameters)
{
- // todo: must be a better way to do this!!!
ReplicableCommand returnValue;
switch (id)
{
- case RemoteExistsNodeCommand.METHOD_ID:
- returnValue = new RemoteExistsNodeCommand();
+ case RemoteExistsCommand.METHOD_ID:
+ returnValue = new RemoteExistsCommand();
break;
case GetChildrenNamesCommand.METHOD_ID:
Modified: core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java 2008-04-28 11:19:32 UTC (rev 5715)
+++ core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java 2008-04-28 12:10:28 UTC (rev 5716)
@@ -57,13 +57,13 @@
* </ul>
* <p/>
* Cache configuration can only be changed and will only be reinjected if the cache is not in the {@link org.jboss.cache.CacheStatus#STARTED} state.
- * todo [mmarkus] remove dependecies on components from this class and move it elsewhere (e.g. dependecy on CacgeSPI, Configuration etc)
*
* @author Manik Surtani (<a href="mailto:manik@jboss.org">manik(a)jboss.org</a>)
* @since 2.1.0
*/
public class ComponentRegistry
{
+ // TODO: Needs refactoring
static final Object NULL_COMPONENT = new Object();
State overallState = CONSTRUCTED;
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 11:19:32 UTC (rev 5715)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/CacheMgmtInterceptor.java 2008-04-28 12:10:28 UTC (rev 5716)
@@ -24,7 +24,7 @@
import org.jboss.cache.DataContainer;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.commands.read.GetKeyValueCommand;
-import org.jboss.cache.commands.write.EvictNodeCommand;
+import org.jboss.cache.commands.write.EvictCommand;
import org.jboss.cache.commands.write.PutDataMapCommand;
import org.jboss.cache.commands.write.PutKeyValueCommand;
import org.jboss.cache.factories.annotations.Inject;
@@ -60,7 +60,7 @@
}
@Override
- public Object handleEvictFqnCommand(InvocationContext ctx, EvictNodeCommand command) throws Throwable
+ public Object handleEvictFqnCommand(InvocationContext ctx, EvictCommand command) throws Throwable
{
Object returnValue = invokeNextInterceptor(ctx, command);
m_evictions++;
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java 2008-04-28 11:19:32 UTC (rev 5715)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java 2008-04-28 12:10:28 UTC (rev 5716)
@@ -22,7 +22,7 @@
import org.jboss.cache.commands.read.GetKeysCommand;
import org.jboss.cache.commands.read.GetNodeCommand;
import org.jboss.cache.commands.read.GravitateDataCommand;
-import org.jboss.cache.commands.read.RemoteExistsNodeCommand;
+import org.jboss.cache.commands.read.RemoteExistsCommand;
import org.jboss.cache.commands.remote.DataGravitationCleanupCommand;
import org.jboss.cache.commands.tx.CommitCommand;
import org.jboss.cache.commands.tx.RollbackCommand;
@@ -107,7 +107,7 @@
}
@Override
- public Object handleExistsNodeCommand(InvocationContext ctx, RemoteExistsNodeCommand command) throws Throwable
+ public Object handleExistsNodeCommand(InvocationContext ctx, RemoteExistsCommand command) throws Throwable
{
return handleGetMethod(ctx, command);
}
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 11:19:32 UTC (rev 5715)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/EvictionInterceptor.java 2008-04-28 12:10:28 UTC (rev 5716)
@@ -16,7 +16,7 @@
import org.jboss.cache.commands.read.GetDataMapCommand;
import org.jboss.cache.commands.read.GetKeyValueCommand;
import org.jboss.cache.commands.read.GetNodeCommand;
-import org.jboss.cache.commands.write.EvictNodeCommand;
+import org.jboss.cache.commands.write.EvictCommand;
import org.jboss.cache.commands.write.PutDataMapCommand;
import org.jboss.cache.commands.write.PutKeyValueCommand;
import org.jboss.cache.commands.write.RemoveDataCommand;
@@ -60,7 +60,7 @@
}
@Override
- public Object handleEvictFqnCommand(InvocationContext ctx, EvictNodeCommand command) throws Throwable
+ public Object handleEvictFqnCommand(InvocationContext ctx, EvictCommand command) throws Throwable
{
Fqn fqn = command.getFqn();
Object retVal = invokeNextInterceptor(ctx, command);
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticReplicationInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticReplicationInterceptor.java 2008-04-28 11:19:32 UTC (rev 5715)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticReplicationInterceptor.java 2008-04-28 12:10:28 UTC (rev 5716)
@@ -19,7 +19,7 @@
import org.jboss.cache.commands.tx.OptimisticPrepareCommand;
import org.jboss.cache.commands.tx.RollbackCommand;
import org.jboss.cache.commands.write.CreateNodeCommand;
-import org.jboss.cache.commands.write.EvictNodeCommand;
+import org.jboss.cache.commands.write.EvictCommand;
import org.jboss.cache.commands.write.MoveCommand;
import org.jboss.cache.commands.write.PutDataMapCommand;
import org.jboss.cache.commands.write.PutKeyValueCommand;
@@ -297,9 +297,9 @@
}
@Override
- public Object handleEvictFqnCommand(InvocationContext ctx, EvictNodeCommand command) throws Throwable
+ public Object handleEvictFqnCommand(InvocationContext ctx, EvictCommand command) throws Throwable
{
- EvictNodeCommand clone = commandsFactory.buildEvictFqnCommand(command.getFqn());
+ EvictCommand clone = commandsFactory.buildEvictFqnCommand(command.getFqn());
return setDataVersion(clone, command.getFqn());
}
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 11:19:32 UTC (rev 5715)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/PassivationInterceptor.java 2008-04-28 12:10:28 UTC (rev 5716)
@@ -4,7 +4,7 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.NodeSPI;
-import org.jboss.cache.commands.write.EvictNodeCommand;
+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;
@@ -49,7 +49,7 @@
* store using the CacheLoader.
*/
@Override
- public Object handleEvictFqnCommand(InvocationContext ctx, EvictNodeCommand evictFqnCommand) throws Throwable
+ public Object handleEvictFqnCommand(InvocationContext ctx, EvictCommand evictFqnCommand) throws Throwable
{
Fqn fqn = evictFqnCommand.getFqn();
try
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2008-04-28 11:19:32 UTC (rev 5715)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2008-04-28 12:10:28 UTC (rev 5716)
@@ -18,7 +18,7 @@
import org.jboss.cache.commands.tx.CommitCommand;
import org.jboss.cache.commands.tx.PrepareCommand;
import org.jboss.cache.commands.tx.RollbackCommand;
-import org.jboss.cache.commands.write.EvictNodeCommand;
+import org.jboss.cache.commands.write.EvictCommand;
import org.jboss.cache.commands.write.MoveCommand;
import org.jboss.cache.commands.write.PutDataMapCommand;
import org.jboss.cache.commands.write.PutKeyValueCommand;
@@ -261,7 +261,7 @@
}
@Override
- public Object executeEvictFqnCommand(InvocationContext ctx, EvictNodeCommand command) throws Throwable
+ public Object executeEvictFqnCommand(InvocationContext ctx, EvictCommand command) throws Throwable
{
lockManager.acquireLocksWithTimeout(ctx, command.getFqn(), NodeLock.LockType.WRITE, false, true, false, false, null, false);
return invokeNextInterceptor(ctx, command);
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 11:19:32 UTC (rev 5715)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/base/PostProcessingChainedInterceptor.java 2008-04-28 12:10:28 UTC (rev 5716)
@@ -8,12 +8,12 @@
import org.jboss.cache.commands.read.GetKeysCommand;
import org.jboss.cache.commands.read.GetNodeCommand;
import org.jboss.cache.commands.read.GravitateDataCommand;
-import org.jboss.cache.commands.read.RemoteExistsNodeCommand;
+import org.jboss.cache.commands.read.RemoteExistsCommand;
import org.jboss.cache.commands.tx.CommitCommand;
import org.jboss.cache.commands.tx.OptimisticPrepareCommand;
import org.jboss.cache.commands.tx.PrepareCommand;
import org.jboss.cache.commands.tx.RollbackCommand;
-import org.jboss.cache.commands.write.EvictNodeCommand;
+import org.jboss.cache.commands.write.EvictCommand;
import org.jboss.cache.commands.write.InvalidateCommand;
import org.jboss.cache.commands.write.MoveCommand;
import org.jboss.cache.commands.write.PutDataMapCommand;
@@ -104,7 +104,7 @@
}
@Override
- public final Object handleEvictFqnCommand(InvocationContext ctx, EvictNodeCommand command) throws Throwable
+ public final Object handleEvictFqnCommand(InvocationContext ctx, EvictCommand command) throws Throwable
{
try
{
@@ -116,7 +116,7 @@
}
}
- public Object executeEvictFqnCommand(InvocationContext ctx, EvictNodeCommand command) throws Throwable
+ public Object executeEvictFqnCommand(InvocationContext ctx, EvictCommand command) throws Throwable
{
return executeAll(ctx, command);
}
@@ -176,7 +176,7 @@
}
@Override
- public final Object handleExistsNodeCommand(InvocationContext ctx, RemoteExistsNodeCommand command) throws Throwable
+ public final Object handleExistsNodeCommand(InvocationContext ctx, RemoteExistsCommand command) throws Throwable
{
try
{
@@ -188,7 +188,7 @@
}
}
- public Object executeExistsNodeCommand(InvocationContext ctx, RemoteExistsNodeCommand command) throws Throwable
+ public Object executeExistsNodeCommand(InvocationContext ctx, RemoteExistsCommand command) throws Throwable
{
return executeAll(ctx, command);
}
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 11:19:32 UTC (rev 5715)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/base/SkipCheckChainedInterceptor.java 2008-04-28 12:10:28 UTC (rev 5716)
@@ -8,12 +8,12 @@
import org.jboss.cache.commands.read.GetKeysCommand;
import org.jboss.cache.commands.read.GetNodeCommand;
import org.jboss.cache.commands.read.GravitateDataCommand;
-import org.jboss.cache.commands.read.RemoteExistsNodeCommand;
+import org.jboss.cache.commands.read.RemoteExistsCommand;
import org.jboss.cache.commands.tx.CommitCommand;
import org.jboss.cache.commands.tx.OptimisticPrepareCommand;
import org.jboss.cache.commands.tx.PrepareCommand;
import org.jboss.cache.commands.tx.RollbackCommand;
-import org.jboss.cache.commands.write.EvictNodeCommand;
+import org.jboss.cache.commands.write.EvictCommand;
import org.jboss.cache.commands.write.InvalidateCommand;
import org.jboss.cache.commands.write.MoveCommand;
import org.jboss.cache.commands.write.PutDataMapCommand;
@@ -93,7 +93,7 @@
}
@Override
- public final Object handleEvictFqnCommand(InvocationContext ctx, EvictNodeCommand command) throws Throwable
+ public final Object handleEvictFqnCommand(InvocationContext ctx, EvictCommand command) throws Throwable
{
if (skipInterception(ctx))
{
@@ -102,7 +102,7 @@
return executeEvictFqnCommand(ctx, command);
}
- public Object executeEvictFqnCommand(InvocationContext ctx, EvictNodeCommand command) throws Throwable
+ public Object executeEvictFqnCommand(InvocationContext ctx, EvictCommand command) throws Throwable
{
return executeAll(ctx, command);
}
@@ -153,7 +153,7 @@
}
@Override
- public final Object handleExistsNodeCommand(InvocationContext ctx, RemoteExistsNodeCommand command) throws Throwable
+ public final Object handleExistsNodeCommand(InvocationContext ctx, RemoteExistsCommand command) throws Throwable
{
if (skipInterception(ctx))
{
@@ -162,7 +162,7 @@
return executeExistsNodeCommand(ctx, command);
}
- public Object executeExistsNodeCommand(InvocationContext ctx, RemoteExistsNodeCommand command) throws Throwable
+ public Object executeExistsNodeCommand(InvocationContext ctx, RemoteExistsCommand command) throws Throwable
{
return executeAll(ctx, command);
}
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 11:19:32 UTC (rev 5715)
+++ core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java 2008-04-28 12:10:28 UTC (rev 5716)
@@ -9,6 +9,7 @@
import org.jboss.cache.commands.read.GetKeysCommand;
import org.jboss.cache.commands.read.GetNodeCommand;
import org.jboss.cache.commands.read.GravitateDataCommand;
+import org.jboss.cache.commands.write.EvictCommand;
import org.jboss.cache.commands.write.MoveCommand;
import org.jboss.cache.commands.write.PutDataMapCommand;
import org.jboss.cache.commands.write.PutKeyValueCommand;
@@ -342,12 +343,9 @@
{
InvocationContext ctx = invocationContextContainer.get();
cacheStatusCheck(ctx);
- List<Fqn> nodesToEvict = cacheData.getNodesForEviction(fqn, recursive);
- //todo optimize this so that it performs only one call disregarding
- for (Fqn aFqn : nodesToEvict)
- {
- invoker.invoke(ctx, commandsFactory.buildEvictFqnCommand(aFqn));
- }
+ EvictCommand c = commandsFactory.buildEvictFqnCommand(fqn);
+ c.setRecursive(recursive);
+ invoker.invoke(ctx, c);
}
public void evict(Fqn<?> fqn)
Modified: core/trunk/src/main/java/org/jboss/cache/loader/ClusteredCacheLoader.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/ClusteredCacheLoader.java 2008-04-28 11:19:32 UTC (rev 5715)
+++ core/trunk/src/main/java/org/jboss/cache/loader/ClusteredCacheLoader.java 2008-04-28 12:10:28 UTC (rev 5716)
@@ -18,7 +18,7 @@
import org.jboss.cache.commands.read.GetChildrenNamesCommand;
import org.jboss.cache.commands.read.GetDataMapCommand;
import org.jboss.cache.commands.read.GetKeyValueCommand;
-import org.jboss.cache.commands.read.RemoteExistsNodeCommand;
+import org.jboss.cache.commands.read.RemoteExistsCommand;
import org.jboss.cache.commands.remote.ClusteredGetCommand;
import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
import org.jboss.cache.factories.CommandsFactory;
@@ -190,7 +190,7 @@
lock.acquireLock(name, false);
try
{
- RemoteExistsNodeCommand command = commandsFactory.buildExistsNodeCommand(name);
+ RemoteExistsCommand command = commandsFactory.buildExistsNodeCommand(name);
Object resp = callRemote(command);
return resp != null && (Boolean) resp;
}
Modified: core/trunk/src/main/java/org/jboss/cache/loader/NonManagedConnectionFactory.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/NonManagedConnectionFactory.java 2008-04-28 11:19:32 UTC (rev 5715)
+++ core/trunk/src/main/java/org/jboss/cache/loader/NonManagedConnectionFactory.java 2008-04-28 12:10:28 UTC (rev 5716)
@@ -22,7 +22,7 @@
class NonManagedConnectionFactory implements ConnectionFactory
{
private static final Log log = LogFactory.getLog(NonManagedConnectionFactory.class);
-
+
static final ThreadLocal<Connection> connection = new ThreadLocal<Connection>();
private String url;
@@ -65,14 +65,14 @@
if (log.isTraceEnabled())
{
log.trace("opened tx connection: tx=" + tx + ", con=" + con);
- }
+ }
}
public Connection getConnection()
{
Connection con = connection.get();
-
+
if (con == null)
{
try
@@ -128,11 +128,6 @@
public void rollback(Object tx)
{
Connection con = connection.get();
- if (con == null)
- {
- // todo: prepare was not called. why is rollback called?
- throw new IllegalStateException("Failed to rollback: thread is not associated with the connection!");
- }
try
{
@@ -159,7 +154,7 @@
try
{
con.close();
-
+
if (log.isTraceEnabled())
{
log.trace("closed non tx connection: " + con);
@@ -167,7 +162,7 @@
}
catch (SQLException e)
{
- log.warn("Failed to close connection " + con , e);
+ log.warn("Failed to close connection " + con, e);
}
}
}
@@ -194,20 +189,23 @@
public String getDriverClass()
{
return driverClass;
- }
+ }
protected void loadDriver(String drv)
{
try
{
- if (log.isTraceEnabled()) { log.trace("Attempting to load driver: " + drv); }
+ if (log.isTraceEnabled())
+ {
+ log.trace("Attempting to load driver: " + drv);
+ }
Class.forName(drv).newInstance();
}
catch (Exception e)
{
reportAndRethrowError("Failed to load driver " + drv, e);
}
- }
+ }
private void closeTxConnection(Connection con)
{
Modified: core/trunk/src/main/java/org/jboss/cache/marshall/AbstractMarshaller.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/marshall/AbstractMarshaller.java 2008-04-28 11:19:32 UTC (rev 5715)
+++ core/trunk/src/main/java/org/jboss/cache/marshall/AbstractMarshaller.java 2008-04-28 12:10:28 UTC (rev 5716)
@@ -20,7 +20,7 @@
import org.jboss.cache.commands.read.GetKeyValueCommand;
import org.jboss.cache.commands.read.GetKeysCommand;
import org.jboss.cache.commands.read.GravitateDataCommand;
-import org.jboss.cache.commands.read.RemoteExistsNodeCommand;
+import org.jboss.cache.commands.read.RemoteExistsCommand;
import org.jboss.cache.commands.remote.AnnounceBuddyPoolNameCommand;
import org.jboss.cache.commands.remote.AssignToBuddyGroupCommand;
import org.jboss.cache.commands.remote.ClusteredGetCommand;
@@ -32,7 +32,7 @@
import org.jboss.cache.commands.tx.OptimisticPrepareCommand;
import org.jboss.cache.commands.tx.PrepareCommand;
import org.jboss.cache.commands.tx.RollbackCommand;
-import org.jboss.cache.commands.write.EvictNodeCommand;
+import org.jboss.cache.commands.write.EvictCommand;
import org.jboss.cache.commands.write.InvalidateCommand;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.factories.annotations.ComponentName;
@@ -143,14 +143,14 @@
break;
case GravitateDataCommand.METHOD_ID:
- case EvictNodeCommand.METHOD_ID:
- case EvictNodeCommand.VERSIONED_METHOD_ID:
+ case EvictCommand.METHOD_ID:
+ case EvictCommand.VERSIONED_METHOD_ID:
case InvalidateCommand.METHOD_ID:
case GetChildrenNamesCommand.METHOD_ID:
case GetDataMapCommand.METHOD_ID:
case GetKeyValueCommand.METHOD_ID:
case GetKeysCommand.METHOD_ID:
- case RemoteExistsNodeCommand.METHOD_ID:
+ case RemoteExistsCommand.METHOD_ID:
fqn = ((DataCommand) cmd).getFqn();
break;
16 years, 8 months
JBoss Cache SVN: r5715 - core/trunk/src/main/java/org/jboss/cache.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-04-28 07:19:32 -0400 (Mon, 28 Apr 2008)
New Revision: 5715
Modified:
core/trunk/src/main/java/org/jboss/cache/NodeSPI.java
Log:
Removed unnecessary public modifiers
Modified: core/trunk/src/main/java/org/jboss/cache/NodeSPI.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/NodeSPI.java 2008-04-28 10:18:18 UTC (rev 5714)
+++ core/trunk/src/main/java/org/jboss/cache/NodeSPI.java 2008-04-28 11:19:32 UTC (rev 5715)
@@ -68,14 +68,14 @@
*
* @return true if the data was loaded from the cache loader.
*/
- public boolean isDataLoaded();
+ boolean isDataLoaded();
/**
* Sets if the data was loaded from the cache loader.
*
* @param dataLoaded true if loaded, false otherwise
*/
- public void setDataLoaded(boolean dataLoaded);
+ void setDataLoaded(boolean dataLoaded);
/**
* Returns a map to access the raw children.
16 years, 8 months
JBoss Cache SVN: r5714 - in core/trunk/src: main/java/org/jboss/cache/factories and 6 other directories.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-04-28 06:18:18 -0400 (Mon, 28 Apr 2008)
New Revision: 5714
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/remote/ClusteredGetCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/remote/DataGravitationCleanupCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/remote/ReplicateCommand.java
core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java
core/trunk/src/main/java/org/jboss/cache/factories/EmptyConstructorFactory.java
core/trunk/src/main/java/org/jboss/cache/factories/InterceptorChainFactory.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/marshall/CommandAwareRpcDispatcher.java
core/trunk/src/main/java/org/jboss/cache/marshall/InactiveRegionAwareRpcDispatcher.java
core/trunk/src/test/java/org/jboss/cache/factories/InterceptorChainFactoryTest.java
core/trunk/src/test/java/org/jboss/cache/interceptors/EvictionInterceptorTest.java
core/trunk/src/test/java/org/jboss/cache/invocation/InterceptorChainTest.java
core/trunk/src/test/java/org/jboss/cache/misc/TestingUtil.java
Log:
More refactoring and renaming
Modified: core/trunk/src/main/java/org/jboss/cache/commands/remote/ClusteredGetCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/remote/ClusteredGetCommand.java 2008-04-28 10:17:51 UTC (rev 5713)
+++ core/trunk/src/main/java/org/jboss/cache/commands/remote/ClusteredGetCommand.java 2008-04-28 10:18:18 UTC (rev 5714)
@@ -10,7 +10,7 @@
import org.jboss.cache.commands.read.GetDataMapCommand;
import org.jboss.cache.commands.read.RemoteExistsNodeCommand;
import org.jboss.cache.factories.annotations.Inject;
-import org.jboss.cache.invocation.InterceptorChain;
+import org.jboss.cache.interceptors.InterceptorChain;
import java.util.ArrayList;
import java.util.Collections;
Modified: core/trunk/src/main/java/org/jboss/cache/commands/remote/DataGravitationCleanupCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/remote/DataGravitationCleanupCommand.java 2008-04-28 10:17:51 UTC (rev 5713)
+++ core/trunk/src/main/java/org/jboss/cache/commands/remote/DataGravitationCleanupCommand.java 2008-04-28 10:18:18 UTC (rev 5714)
@@ -13,9 +13,9 @@
import org.jboss.cache.commands.write.RemoveNodeCommand;
import org.jboss.cache.factories.CommandsFactory;
import org.jboss.cache.factories.annotations.Inject;
-import org.jboss.cache.invocation.CacheTransactionHelper;
-import org.jboss.cache.invocation.InterceptorChain;
+import org.jboss.cache.interceptors.InterceptorChain;
import org.jboss.cache.transaction.GlobalTransaction;
+import org.jboss.cache.transaction.GlobalTransactionContainer;
import java.util.List;
@@ -31,7 +31,7 @@
/* dependencies */
private BuddyManager buddyManager;
- private CacheTransactionHelper transactionHelper;
+ private GlobalTransactionContainer transactionHelper;
private InterceptorChain invoker;
private CommandsFactory commandsFactory;
private DataContainer cacheData;
@@ -58,7 +58,7 @@
}
@Inject
- public void initialize(BuddyManager buddyManager, InterceptorChain invoker, CacheTransactionHelper transactionHelper,
+ public void initialize(BuddyManager buddyManager, InterceptorChain invoker, GlobalTransactionContainer transactionHelper,
CommandsFactory commandsFactory, DataContainer cacheData)
{
this.buddyManager = buddyManager;
Modified: core/trunk/src/main/java/org/jboss/cache/commands/remote/ReplicateCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/remote/ReplicateCommand.java 2008-04-28 10:17:51 UTC (rev 5713)
+++ core/trunk/src/main/java/org/jboss/cache/commands/remote/ReplicateCommand.java 2008-04-28 10:18:18 UTC (rev 5714)
@@ -8,7 +8,7 @@
import org.jboss.cache.commands.read.GravitateDataCommand;
import org.jboss.cache.commands.write.PutKeyValueCommand;
import org.jboss.cache.factories.annotations.Inject;
-import org.jboss.cache.invocation.InterceptorChain;
+import org.jboss.cache.interceptors.InterceptorChain;
import java.util.List;
Modified: core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java 2008-04-28 10:17:51 UTC (rev 5713)
+++ core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java 2008-04-28 10:18:18 UTC (rev 5714)
@@ -17,7 +17,7 @@
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.factories.annotations.Start;
import org.jboss.cache.factories.annotations.Stop;
-import org.jboss.cache.invocation.InterceptorChain;
+import org.jboss.cache.interceptors.InterceptorChain;
import org.jboss.cache.util.BeanUtils;
import org.jboss.cache.util.reflect.CachedMethod;
import org.jboss.cache.util.reflect.ReflectionUtil;
Modified: core/trunk/src/main/java/org/jboss/cache/factories/EmptyConstructorFactory.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/factories/EmptyConstructorFactory.java 2008-04-28 10:17:51 UTC (rev 5713)
+++ core/trunk/src/main/java/org/jboss/cache/factories/EmptyConstructorFactory.java 2008-04-28 10:18:18 UTC (rev 5714)
@@ -5,7 +5,6 @@
import org.jboss.cache.config.ConfigurationException;
import org.jboss.cache.factories.annotations.DefaultFactoryFor;
import org.jboss.cache.invocation.CacheInvocationDelegate;
-import org.jboss.cache.invocation.CacheTransactionHelper;
import org.jboss.cache.invocation.InvocationContextContainer;
import org.jboss.cache.loader.CacheLoaderManager;
import org.jboss.cache.lock.LockManager;
@@ -14,6 +13,7 @@
import org.jboss.cache.notifications.Notifier;
import org.jboss.cache.remoting.jgroups.ChannelMessageListener;
import org.jboss.cache.statetransfer.StateTransferManager;
+import org.jboss.cache.transaction.GlobalTransactionContainer;
import org.jboss.cache.transaction.TransactionTable;
/**
@@ -25,7 +25,7 @@
@DefaultFactoryFor(classes = {StateTransferManager.class, TransactionTable.class, RegionManager.class, Notifier.class,
ChannelMessageListener.class, CacheLoaderManager.class, Marshaller.class,
InvocationContextContainer.class, CacheInvocationDelegate.class,
- CacheTransactionHelper.class, DataContainer.class, CommandsFactory.class, LockManager.class})
+ GlobalTransactionContainer.class, DataContainer.class, CommandsFactory.class, LockManager.class})
public class EmptyConstructorFactory extends ComponentFactory
{
@Override
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 10:17:51 UTC (rev 5713)
+++ core/trunk/src/main/java/org/jboss/cache/factories/InterceptorChainFactory.java 2008-04-28 10:18:18 UTC (rev 5714)
@@ -11,7 +11,6 @@
import org.jboss.cache.factories.annotations.DefaultFactoryFor;
import org.jboss.cache.interceptors.*;
import org.jboss.cache.interceptors.base.VisitorInterceptor;
-import org.jboss.cache.invocation.InterceptorChain;
/**
* Factory class that builds an interceptor chain based on cache configuration.
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 10:17:51 UTC (rev 5713)
+++ core/trunk/src/main/java/org/jboss/cache/invocation/AbstractInvocationDelegate.java 2008-04-28 10:18:18 UTC (rev 5714)
@@ -5,6 +5,7 @@
import org.jboss.cache.LifecycleManager;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.factories.annotations.Inject;
+import org.jboss.cache.interceptors.InterceptorChain;
/**
* The JBoss Cache hand-wired interceptor stack. A "minimal" AOP framework which uses delegation through an
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 10:17:51 UTC (rev 5713)
+++ core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java 2008-04-28 10:18:18 UTC (rev 5714)
@@ -24,6 +24,7 @@
import org.jboss.cache.notifications.Notifier;
import org.jboss.cache.statetransfer.StateTransferManager;
import org.jboss.cache.transaction.GlobalTransaction;
+import org.jboss.cache.transaction.GlobalTransactionContainer;
import org.jboss.cache.transaction.TransactionTable;
import org.jgroups.Address;
@@ -58,13 +59,13 @@
private Marshaller marshaller;
private DataContainer cacheData;
private CommandsFactory commandsFactory;// tu be built here and imjected within any CacheCommand instance. Also pass this to the interceptor chain
- private CacheTransactionHelper transactionHelper;
+ private GlobalTransactionContainer transactionHelper;
@Inject
public void initialize(StateTransferManager stateTransferManager, CacheLoaderManager cacheLoaderManager, Notifier notifier,
TransactionManager transactionManager, BuddyManager buddyManager, TransactionTable transactionTable,
RPCManager rpcManager, RegionManager regionManager, Marshaller marshaller,
- CacheTransactionHelper transactionHelper, CommandsFactory commandsFactory, DataContainer cacheData)
+ GlobalTransactionContainer transactionHelper, CommandsFactory commandsFactory, DataContainer cacheData)
{
this.stateTransferManager = stateTransferManager;
this.cacheLoaderManager = cacheLoaderManager;
Modified: core/trunk/src/main/java/org/jboss/cache/marshall/CommandAwareRpcDispatcher.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/marshall/CommandAwareRpcDispatcher.java 2008-04-28 10:17:51 UTC (rev 5713)
+++ core/trunk/src/main/java/org/jboss/cache/marshall/CommandAwareRpcDispatcher.java 2008-04-28 10:18:18 UTC (rev 5714)
@@ -7,7 +7,7 @@
import org.jboss.cache.commands.remote.AnnounceBuddyPoolNameCommand;
import org.jboss.cache.commands.remote.AssignToBuddyGroupCommand;
import org.jboss.cache.commands.remote.RemoveFromBuddyGroupCommand;
-import org.jboss.cache.invocation.InterceptorChain;
+import org.jboss.cache.interceptors.InterceptorChain;
import org.jboss.cache.invocation.InvocationContextContainer;
import org.jgroups.Address;
import org.jgroups.Channel;
Modified: core/trunk/src/main/java/org/jboss/cache/marshall/InactiveRegionAwareRpcDispatcher.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/marshall/InactiveRegionAwareRpcDispatcher.java 2008-04-28 10:17:51 UTC (rev 5713)
+++ core/trunk/src/main/java/org/jboss/cache/marshall/InactiveRegionAwareRpcDispatcher.java 2008-04-28 10:18:18 UTC (rev 5714)
@@ -2,7 +2,7 @@
import org.jboss.cache.LifecycleManager;
import org.jboss.cache.commands.ReplicableCommand;
-import org.jboss.cache.invocation.InterceptorChain;
+import org.jboss.cache.interceptors.InterceptorChain;
import org.jboss.cache.invocation.InvocationContextContainer;
import org.jgroups.Channel;
import org.jgroups.MembershipListener;
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 10:17:51 UTC (rev 5713)
+++ core/trunk/src/test/java/org/jboss/cache/factories/InterceptorChainFactoryTest.java 2008-04-28 10:18:18 UTC (rev 5714)
@@ -8,7 +8,6 @@
import org.jboss.cache.config.EvictionConfig;
import org.jboss.cache.interceptors.*;
import org.jboss.cache.interceptors.base.VisitorInterceptor;
-import org.jboss.cache.invocation.InterceptorChain;
import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.xml.XmlHelper;
import static org.testng.AssertJUnit.assertEquals;
Modified: core/trunk/src/test/java/org/jboss/cache/interceptors/EvictionInterceptorTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/interceptors/EvictionInterceptorTest.java 2008-04-28 10:17:51 UTC (rev 5713)
+++ core/trunk/src/test/java/org/jboss/cache/interceptors/EvictionInterceptorTest.java 2008-04-28 10:18:18 UTC (rev 5714)
@@ -27,7 +27,6 @@
import org.jboss.cache.eviction.EvictedEventNode;
import org.jboss.cache.eviction.NodeEventType;
import org.jboss.cache.factories.CommandsFactory;
-import org.jboss.cache.invocation.InterceptorChain;
import org.jboss.cache.lock.IsolationLevel;
import org.jboss.cache.misc.TestingUtil;
import static org.testng.AssertJUnit.*;
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 10:17:51 UTC (rev 5713)
+++ core/trunk/src/test/java/org/jboss/cache/invocation/InterceptorChainTest.java 2008-04-28 10:18:18 UTC (rev 5714)
@@ -1,6 +1,7 @@
package org.jboss.cache.invocation;
import org.jboss.cache.interceptors.CallInterceptor;
+import org.jboss.cache.interceptors.InterceptorChain;
import org.jboss.cache.interceptors.InvalidationInterceptor;
import org.jboss.cache.interceptors.InvocationContextInterceptor;
import org.jboss.cache.interceptors.PessimisticLockInterceptor;
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 10:17:51 UTC (rev 5713)
+++ core/trunk/src/test/java/org/jboss/cache/misc/TestingUtil.java 2008-04-28 10:18:18 UTC (rev 5714)
@@ -15,9 +15,9 @@
import org.jboss.cache.commands.VisitableCommand;
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.invocation.CacheInvocationDelegate;
-import org.jboss.cache.invocation.InterceptorChain;
import org.jboss.cache.loader.CacheLoader;
import org.jboss.cache.loader.CacheLoaderManager;
import org.jboss.cache.util.CachePrinter;
16 years, 8 months