Author: manik.surtani(a)jboss.com
Date: 2008-07-03 08:20:17 -0400 (Thu, 03 Jul 2008)
New Revision: 6158
Added:
core/trunk/src/main/java/org/jboss/cache/commands/legacy/
core/trunk/src/main/java/org/jboss/cache/commands/legacy/ReversibleCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/
core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/LegacyEvictCommand.java
core/trunk/src/main/java/org/jboss/cache/factories/OptimisticCommandsFactoryImpl.java
core/trunk/src/test/java/org/jboss/cache/commands/legacy/
core/trunk/src/test/java/org/jboss/cache/commands/legacy/write/
Removed:
core/trunk/src/main/java/org/jboss/cache/commands/legacy/ReversibleCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/
core/trunk/src/main/java/org/jboss/cache/commands/pessimistic/
core/trunk/src/test/java/org/jboss/cache/commands/legacy/write/
core/trunk/src/test/java/org/jboss/cache/commands/pessimistic/
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/PessClearDataCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/PessCreateNodeCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/PessMoveCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/PessPutDataMapCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/PessPutForExternalReadCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/PessPutKeyValueCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/PessRemoveKeyCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/PessRemoveNodeCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/EvictCommand.java
core/trunk/src/main/java/org/jboss/cache/factories/CommandsFactoryImpl.java
core/trunk/src/main/java/org/jboss/cache/factories/CommandsMetaFactory.java
core/trunk/src/main/java/org/jboss/cache/factories/PessimisticCommandsFactoryImpl.java
core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
core/trunk/src/test/java/org/jboss/cache/commands/legacy/write/ClearDataCommandTest.java
core/trunk/src/test/java/org/jboss/cache/commands/legacy/write/CreateNodeCommandTest.java
core/trunk/src/test/java/org/jboss/cache/commands/legacy/write/MoveCommandTest.java
core/trunk/src/test/java/org/jboss/cache/commands/legacy/write/PutDataMapCommandTest.java
core/trunk/src/test/java/org/jboss/cache/commands/legacy/write/PutKeyValueCommandTest.java
core/trunk/src/test/java/org/jboss/cache/commands/legacy/write/RemoveKeyCommandTest.java
core/trunk/src/test/java/org/jboss/cache/commands/legacy/write/RemoveNodeCommandTest.java
core/trunk/src/test/java/org/jboss/cache/commands/write/EvictCommandTest.java
Log:
Introduced new command factory for opt locking.
renamed commands.pessimistic pkg to commands.legacy
created new LegacyEvictCommand
Copied: core/trunk/src/main/java/org/jboss/cache/commands/legacy (from rev 6152,
core/trunk/src/main/java/org/jboss/cache/commands/pessimistic)
Deleted: core/trunk/src/main/java/org/jboss/cache/commands/legacy/ReversibleCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/pessimistic/ReversibleCommand.java 2008-07-02
12:01:41 UTC (rev 6152)
+++
core/trunk/src/main/java/org/jboss/cache/commands/legacy/ReversibleCommand.java 2008-07-03
12:20:17 UTC (rev 6158)
@@ -1,20 +0,0 @@
-package org.jboss.cache.commands.pessimistic;
-
-import org.jboss.cache.commands.WriteCommand;
-
-/**
- * A write command that can be reversed by calling a rollback.
- *
- * @author Manik Surtani (<a
href="mailto:manik@jboss.org">manik@jboss.org</a>)
- * @since 3.0
- */
-public interface ReversibleCommand extends WriteCommand
-{
- /**
- * Reverses a command that has already been invoked.
- * <p/>
- * <b>Important</b>: this method will be invoked at the end of
interceptors chain. It should never be called directly from
- * a custom interceptor.
- */
- void rollback();
-}
Copied: core/trunk/src/main/java/org/jboss/cache/commands/legacy/ReversibleCommand.java
(from rev 6157,
core/trunk/src/main/java/org/jboss/cache/commands/pessimistic/ReversibleCommand.java)
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/legacy/ReversibleCommand.java
(rev 0)
+++
core/trunk/src/main/java/org/jboss/cache/commands/legacy/ReversibleCommand.java 2008-07-03
12:20:17 UTC (rev 6158)
@@ -0,0 +1,20 @@
+package org.jboss.cache.commands.legacy;
+
+import org.jboss.cache.commands.WriteCommand;
+
+/**
+ * A write command that can be reversed by calling a rollback.
+ *
+ * @author Manik Surtani (<a
href="mailto:manik@jboss.org">manik@jboss.org</a>)
+ * @since 3.0
+ */
+public interface ReversibleCommand extends WriteCommand
+{
+ /**
+ * Reverses a command that has already been invoked.
+ * <p/>
+ * <b>Important</b>: this method will be invoked at the end of
interceptors chain. It should never be called directly from
+ * a custom interceptor.
+ */
+ void rollback();
+}
Copied: core/trunk/src/main/java/org/jboss/cache/commands/legacy/write (from rev 6157,
core/trunk/src/main/java/org/jboss/cache/commands/pessimistic/write)
Added:
core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/LegacyEvictCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/LegacyEvictCommand.java
(rev 0)
+++
core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/LegacyEvictCommand.java 2008-07-03
12:20:17 UTC (rev 6158)
@@ -0,0 +1,39 @@
+package org.jboss.cache.commands.legacy.write;
+
+import org.jboss.cache.Fqn;
+import org.jboss.cache.NodeSPI;
+import org.jboss.cache.commands.write.EvictCommand;
+import org.jboss.cache.invocation.InvocationContext;
+
+import java.util.Collection;
+
+/**
+ * Evict command for legacy locking schemes like OL and PL.
+ *
+ * @author Manik Surtani (<a
href="mailto:manik@jboss.org">manik@jboss.org</a>)
+ * @since 3.0
+ */
+public class LegacyEvictCommand extends EvictCommand
+{
+ public LegacyEvictCommand(Fqn fqn)
+ {
+ super(fqn);
+ }
+
+ public LegacyEvictCommand()
+ {
+ }
+
+ @Override
+ protected NodeSPI lookupForEviction(InvocationContext ctx, Fqn fqn)
+ {
+ return dataContainer.peek(fqn, false, true);
+ }
+
+ @Override
+ protected Collection<Fqn> getRecursiveEvictionNodes()
+ {
+ return dataContainer.getNodesForEviction(fqn, true);
+ }
+
+}
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/PessClearDataCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/pessimistic/write/PessClearDataCommand.java 2008-07-03
12:04:30 UTC (rev 6157)
+++
core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/PessClearDataCommand.java 2008-07-03
12:20:17 UTC (rev 6158)
@@ -1,8 +1,8 @@
-package org.jboss.cache.commands.pessimistic.write;
+package org.jboss.cache.commands.legacy.write;
import org.jboss.cache.Fqn;
import org.jboss.cache.NodeSPI;
-import org.jboss.cache.commands.pessimistic.ReversibleCommand;
+import org.jboss.cache.commands.legacy.ReversibleCommand;
import org.jboss.cache.commands.write.ClearDataCommand;
import org.jboss.cache.invocation.InvocationContext;
import org.jboss.cache.transaction.GlobalTransaction;
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/PessCreateNodeCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/pessimistic/write/PessCreateNodeCommand.java 2008-07-03
12:04:30 UTC (rev 6157)
+++
core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/PessCreateNodeCommand.java 2008-07-03
12:20:17 UTC (rev 6158)
@@ -1,7 +1,7 @@
-package org.jboss.cache.commands.pessimistic.write;
+package org.jboss.cache.commands.legacy.write;
import org.jboss.cache.Fqn;
-import org.jboss.cache.commands.pessimistic.ReversibleCommand;
+import org.jboss.cache.commands.legacy.ReversibleCommand;
import org.jboss.cache.commands.write.CreateNodeCommand;
import java.util.List;
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/PessMoveCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/pessimistic/write/PessMoveCommand.java 2008-07-03
12:04:30 UTC (rev 6157)
+++
core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/PessMoveCommand.java 2008-07-03
12:20:17 UTC (rev 6158)
@@ -1,7 +1,7 @@
-package org.jboss.cache.commands.pessimistic.write;
+package org.jboss.cache.commands.legacy.write;
import org.jboss.cache.Fqn;
-import org.jboss.cache.commands.pessimistic.ReversibleCommand;
+import org.jboss.cache.commands.legacy.ReversibleCommand;
import org.jboss.cache.commands.write.MoveCommand;
/**
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/PessPutDataMapCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/pessimistic/write/PessPutDataMapCommand.java 2008-07-03
12:04:30 UTC (rev 6157)
+++
core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/PessPutDataMapCommand.java 2008-07-03
12:20:17 UTC (rev 6158)
@@ -1,8 +1,8 @@
-package org.jboss.cache.commands.pessimistic.write;
+package org.jboss.cache.commands.legacy.write;
import org.jboss.cache.Fqn;
import org.jboss.cache.NodeSPI;
-import org.jboss.cache.commands.pessimistic.ReversibleCommand;
+import org.jboss.cache.commands.legacy.ReversibleCommand;
import org.jboss.cache.commands.write.PutDataMapCommand;
import org.jboss.cache.invocation.InvocationContext;
import org.jboss.cache.transaction.GlobalTransaction;
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/PessPutForExternalReadCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/pessimistic/write/PessPutForExternalReadCommand.java 2008-07-03
12:04:30 UTC (rev 6157)
+++
core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/PessPutForExternalReadCommand.java 2008-07-03
12:20:17 UTC (rev 6158)
@@ -1,9 +1,9 @@
-package org.jboss.cache.commands.pessimistic.write;
+package org.jboss.cache.commands.legacy.write;
import org.jboss.cache.CacheException;
import org.jboss.cache.Fqn;
import org.jboss.cache.NodeSPI;
-import org.jboss.cache.commands.pessimistic.ReversibleCommand;
+import org.jboss.cache.commands.legacy.ReversibleCommand;
import org.jboss.cache.commands.write.PutForExternalReadCommand;
import org.jboss.cache.invocation.InvocationContext;
import org.jboss.cache.transaction.GlobalTransaction;
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/PessPutKeyValueCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/pessimistic/write/PessPutKeyValueCommand.java 2008-07-03
12:04:30 UTC (rev 6157)
+++
core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/PessPutKeyValueCommand.java 2008-07-03
12:20:17 UTC (rev 6158)
@@ -1,9 +1,9 @@
-package org.jboss.cache.commands.pessimistic.write;
+package org.jboss.cache.commands.legacy.write;
import org.jboss.cache.CacheException;
import org.jboss.cache.Fqn;
import org.jboss.cache.NodeSPI;
-import org.jboss.cache.commands.pessimistic.ReversibleCommand;
+import org.jboss.cache.commands.legacy.ReversibleCommand;
import org.jboss.cache.commands.write.PutKeyValueCommand;
import org.jboss.cache.invocation.InvocationContext;
import org.jboss.cache.transaction.GlobalTransaction;
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/PessRemoveKeyCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/pessimistic/write/PessRemoveKeyCommand.java 2008-07-03
12:04:30 UTC (rev 6157)
+++
core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/PessRemoveKeyCommand.java 2008-07-03
12:20:17 UTC (rev 6158)
@@ -1,8 +1,8 @@
-package org.jboss.cache.commands.pessimistic.write;
+package org.jboss.cache.commands.legacy.write;
import org.jboss.cache.Fqn;
import org.jboss.cache.NodeSPI;
-import org.jboss.cache.commands.pessimistic.ReversibleCommand;
+import org.jboss.cache.commands.legacy.ReversibleCommand;
import org.jboss.cache.commands.write.RemoveKeyCommand;
import org.jboss.cache.invocation.InvocationContext;
import org.jboss.cache.transaction.GlobalTransaction;
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/PessRemoveNodeCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/pessimistic/write/PessRemoveNodeCommand.java 2008-07-03
12:04:30 UTC (rev 6157)
+++
core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/PessRemoveNodeCommand.java 2008-07-03
12:20:17 UTC (rev 6158)
@@ -1,8 +1,8 @@
-package org.jboss.cache.commands.pessimistic.write;
+package org.jboss.cache.commands.legacy.write;
import org.jboss.cache.Fqn;
import org.jboss.cache.NodeSPI;
-import org.jboss.cache.commands.pessimistic.ReversibleCommand;
+import org.jboss.cache.commands.legacy.ReversibleCommand;
import org.jboss.cache.commands.write.RemoveNodeCommand;
import org.jboss.cache.invocation.InvocationContext;
import org.jboss.cache.transaction.GlobalTransaction;
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-07-03
12:04:30 UTC (rev 6157)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/EvictCommand.java 2008-07-03
12:20:17 UTC (rev 6158)
@@ -30,7 +30,6 @@
protected Notifier notifier;
private static final Log log = LogFactory.getLog(EvictCommand.class);
private static final boolean trace = log.isTraceEnabled();
- private boolean isUsingMvcc;
private List<Fqn> nodesToEvict;
public EvictCommand(Fqn fqn)
@@ -42,11 +41,10 @@
{
}
- public void initialize(Notifier notifier, DataContainer dataContainer, boolean
isUsingMvcc)
+ public void initialize(Notifier notifier, DataContainer dataContainer)
{
super.initialize(dataContainer);
this.notifier = notifier;
- this.isUsingMvcc = isUsingMvcc;
}
public List<Fqn> getNodesToEvict()
@@ -69,7 +67,6 @@
*/
public Object perform(InvocationContext ctx)
{
- // TODO: remove this ugly hack
NodeSPI node = lookupForEviction(ctx, fqn);
if (node == null || node.isDeleted())
{
@@ -98,16 +95,11 @@
}
}
- private Collection<Fqn> getRecursiveEvictionNodes()
+ protected Collection<Fqn> getRecursiveEvictionNodes()
{
- if (isUsingMvcc)
- {
- Collections.sort(nodesToEvict);
- Collections.reverse(nodesToEvict);
- return nodesToEvict;
- }
- else
- return dataContainer.getNodesForEviction(fqn, true);
+ Collections.sort(nodesToEvict);
+ Collections.reverse(nodesToEvict);
+ return nodesToEvict;
}
boolean evictNode(Fqn fqn, InvocationContext ctx, NodeSPI node)
@@ -144,17 +136,9 @@
}
}
- private NodeSPI lookupForEviction(InvocationContext ctx, Fqn fqn)
+ protected NodeSPI lookupForEviction(InvocationContext ctx, Fqn fqn)
{
- // TODO: do something about this nasty hack
- if (isUsingMvcc)
- {
- return ctx.lookUpNode(fqn);
- }
- else
- {
- return dataContainer.peek(fqn, false, true);
- }
+ return ctx.lookUpNode(fqn);
}
public Object acceptVisitor(InvocationContext ctx, Visitor visitor) throws Throwable
Modified: core/trunk/src/main/java/org/jboss/cache/factories/CommandsFactoryImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/factories/CommandsFactoryImpl.java 2008-07-03
12:04:30 UTC (rev 6157)
+++ core/trunk/src/main/java/org/jboss/cache/factories/CommandsFactoryImpl.java 2008-07-03
12:20:17 UTC (rev 6158)
@@ -40,9 +40,7 @@
import org.jboss.cache.commands.write.RemoveNodeCommand;
import org.jboss.cache.commands.write.VersionedInvalidateCommand;
import org.jboss.cache.config.Configuration;
-import org.jboss.cache.config.Configuration.NodeLockingScheme;
import org.jboss.cache.factories.annotations.Inject;
-import org.jboss.cache.factories.annotations.Start;
import org.jboss.cache.interceptors.InterceptorChain;
import org.jboss.cache.notifications.Notifier;
import org.jboss.cache.transaction.GlobalTransaction;
@@ -69,7 +67,6 @@
protected Configuration configuration;
protected TransactionManager txManager;
protected BuddyFqnTransformer buddyFqnTransformer;
- private boolean usingMvcc;
public CommandsFactoryImpl()
{
@@ -92,12 +89,6 @@
this.buddyFqnTransformer = buddyFqnTransformer;
}
- @Start
- public void start()
- {
- usingMvcc = configuration.getNodeLockingScheme() == NodeLockingScheme.MVCC;
- }
-
public PutDataMapCommand buildPutDataMapCommand(GlobalTransaction gtx, Fqn fqn, Map
data)
{
PutDataMapCommand cmd = new PutDataMapCommand(gtx, fqn, data);
@@ -165,7 +156,7 @@
public EvictCommand buildEvictFqnCommand(Fqn fqn)
{
EvictCommand command = new EvictCommand(fqn);
- command.initialize(notifier, dataContainer, usingMvcc);
+ command.initialize(notifier, dataContainer);
return command;
}
Modified: core/trunk/src/main/java/org/jboss/cache/factories/CommandsMetaFactory.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/factories/CommandsMetaFactory.java 2008-07-03
12:04:30 UTC (rev 6157)
+++ core/trunk/src/main/java/org/jboss/cache/factories/CommandsMetaFactory.java 2008-07-03
12:20:17 UTC (rev 6158)
@@ -1,6 +1,6 @@
package org.jboss.cache.factories;
-import org.jboss.cache.config.Configuration.NodeLockingScheme;
+import org.jboss.cache.config.ConfigurationException;
import org.jboss.cache.factories.annotations.DefaultFactoryFor;
/**
@@ -15,9 +15,15 @@
@SuppressWarnings("unchecked")
protected <T> T construct(Class<T> componentType)
{
- if (configuration.getNodeLockingScheme() == NodeLockingScheme.PESSIMISTIC)
- return (T) new PessimisticCommandsFactoryImpl();
- else
- return (T) new CommandsFactoryImpl();
+ switch (configuration.getNodeLockingScheme())
+ {
+ case MVCC:
+ return (T) new CommandsFactoryImpl();
+ case OPTIMISTIC:
+ return (T) new OptimisticCommandsFactoryImpl();
+ case PESSIMISTIC:
+ return (T) new PessimisticCommandsFactoryImpl();
+ }
+ throw new ConfigurationException("Unknown locking scheme " +
configuration.getNodeLockingScheme());
}
}
Added:
core/trunk/src/main/java/org/jboss/cache/factories/OptimisticCommandsFactoryImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/factories/OptimisticCommandsFactoryImpl.java
(rev 0)
+++
core/trunk/src/main/java/org/jboss/cache/factories/OptimisticCommandsFactoryImpl.java 2008-07-03
12:20:17 UTC (rev 6158)
@@ -0,0 +1,22 @@
+package org.jboss.cache.factories;
+
+import org.jboss.cache.Fqn;
+import org.jboss.cache.commands.legacy.write.LegacyEvictCommand;
+import org.jboss.cache.commands.write.EvictCommand;
+
+/**
+ * Extends the default commands factory impl for optimistic locking.
+ *
+ * @author Manik Surtani (<a
href="mailto:manik@jboss.org">manik@jboss.org</a>)
+ * @since 3.0
+ */
+public class OptimisticCommandsFactoryImpl extends CommandsFactoryImpl
+{
+ @Override
+ public EvictCommand buildEvictFqnCommand(Fqn fqn)
+ {
+ EvictCommand command = new LegacyEvictCommand(fqn);
+ command.initialize(notifier, dataContainer);
+ return command;
+ }
+}
Modified:
core/trunk/src/main/java/org/jboss/cache/factories/PessimisticCommandsFactoryImpl.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/factories/PessimisticCommandsFactoryImpl.java 2008-07-03
12:04:30 UTC (rev 6157)
+++
core/trunk/src/main/java/org/jboss/cache/factories/PessimisticCommandsFactoryImpl.java 2008-07-03
12:20:17 UTC (rev 6158)
@@ -2,14 +2,14 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.commands.ReplicableCommand;
-import org.jboss.cache.commands.pessimistic.write.PessClearDataCommand;
-import org.jboss.cache.commands.pessimistic.write.PessCreateNodeCommand;
-import org.jboss.cache.commands.pessimistic.write.PessMoveCommand;
-import org.jboss.cache.commands.pessimistic.write.PessPutDataMapCommand;
-import org.jboss.cache.commands.pessimistic.write.PessPutForExternalReadCommand;
-import org.jboss.cache.commands.pessimistic.write.PessPutKeyValueCommand;
-import org.jboss.cache.commands.pessimistic.write.PessRemoveKeyCommand;
-import org.jboss.cache.commands.pessimistic.write.PessRemoveNodeCommand;
+import org.jboss.cache.commands.legacy.write.PessClearDataCommand;
+import org.jboss.cache.commands.legacy.write.PessCreateNodeCommand;
+import org.jboss.cache.commands.legacy.write.PessMoveCommand;
+import org.jboss.cache.commands.legacy.write.PessPutDataMapCommand;
+import org.jboss.cache.commands.legacy.write.PessPutForExternalReadCommand;
+import org.jboss.cache.commands.legacy.write.PessPutKeyValueCommand;
+import org.jboss.cache.commands.legacy.write.PessRemoveKeyCommand;
+import org.jboss.cache.commands.legacy.write.PessRemoveNodeCommand;
import org.jboss.cache.commands.write.ClearDataCommand;
import org.jboss.cache.commands.write.CreateNodeCommand;
import org.jboss.cache.commands.write.MoveCommand;
@@ -27,10 +27,10 @@
* pessimistic commands where appropriate, with the ability to roll back.
*
* @author Manik Surtani (<a
href="mailto:manik@jboss.org">manik@jboss.org</a>)
- * @see org.jboss.cache.commands.pessimistic.ReversibleCommand
+ * @see org.jboss.cache.commands.legacy.ReversibleCommand
* @since 3.0
*/
-public class PessimisticCommandsFactoryImpl extends CommandsFactoryImpl
+public class PessimisticCommandsFactoryImpl extends OptimisticCommandsFactoryImpl
{
@Override
public PutDataMapCommand buildPutDataMapCommand(GlobalTransaction gtx, Fqn fqn, Map
data)
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2008-07-03
12:04:30 UTC (rev 6157)
+++
core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2008-07-03
12:20:17 UTC (rev 6158)
@@ -12,7 +12,7 @@
import org.jboss.cache.commands.DataCommand;
import org.jboss.cache.commands.VisitableCommand;
import org.jboss.cache.commands.WriteCommand;
-import org.jboss.cache.commands.pessimistic.ReversibleCommand;
+import org.jboss.cache.commands.legacy.ReversibleCommand;
import org.jboss.cache.commands.read.GetChildrenNamesCommand;
import org.jboss.cache.commands.read.GetKeyValueCommand;
import org.jboss.cache.commands.read.GetKeysCommand;
Copied: core/trunk/src/test/java/org/jboss/cache/commands/legacy (from rev 6152,
core/trunk/src/test/java/org/jboss/cache/commands/pessimistic)
Copied: core/trunk/src/test/java/org/jboss/cache/commands/legacy/write (from rev 6157,
core/trunk/src/test/java/org/jboss/cache/commands/pessimistic/write)
Modified:
core/trunk/src/test/java/org/jboss/cache/commands/legacy/write/ClearDataCommandTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/commands/pessimistic/write/ClearDataCommandTest.java 2008-07-03
12:04:30 UTC (rev 6157)
+++
core/trunk/src/test/java/org/jboss/cache/commands/legacy/write/ClearDataCommandTest.java 2008-07-03
12:20:17 UTC (rev 6158)
@@ -1,4 +1,4 @@
-package org.jboss.cache.commands.pessimistic.write;
+package org.jboss.cache.commands.legacy.write;
import static org.easymock.EasyMock.expect;
import org.jboss.cache.commands.write.AbstractVersionedDataCommand;
Modified:
core/trunk/src/test/java/org/jboss/cache/commands/legacy/write/CreateNodeCommandTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/commands/pessimistic/write/CreateNodeCommandTest.java 2008-07-03
12:04:30 UTC (rev 6157)
+++
core/trunk/src/test/java/org/jboss/cache/commands/legacy/write/CreateNodeCommandTest.java 2008-07-03
12:20:17 UTC (rev 6158)
@@ -1,4 +1,4 @@
-package org.jboss.cache.commands.pessimistic.write;
+package org.jboss.cache.commands.legacy.write;
import static org.easymock.EasyMock.*;
import org.jboss.cache.commands.read.AbstractDataCommandTest;
Modified:
core/trunk/src/test/java/org/jboss/cache/commands/legacy/write/MoveCommandTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/commands/pessimistic/write/MoveCommandTest.java 2008-07-03
12:04:30 UTC (rev 6157)
+++
core/trunk/src/test/java/org/jboss/cache/commands/legacy/write/MoveCommandTest.java 2008-07-03
12:20:17 UTC (rev 6158)
@@ -1,4 +1,4 @@
-package org.jboss.cache.commands.pessimistic.write;
+package org.jboss.cache.commands.legacy.write;
import static org.easymock.EasyMock.createStrictControl;
import static org.easymock.EasyMock.expect;
Modified:
core/trunk/src/test/java/org/jboss/cache/commands/legacy/write/PutDataMapCommandTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/commands/pessimistic/write/PutDataMapCommandTest.java 2008-07-03
12:04:30 UTC (rev 6157)
+++
core/trunk/src/test/java/org/jboss/cache/commands/legacy/write/PutDataMapCommandTest.java 2008-07-03
12:20:17 UTC (rev 6158)
@@ -1,4 +1,4 @@
-package org.jboss.cache.commands.pessimistic.write;
+package org.jboss.cache.commands.legacy.write;
import static org.easymock.EasyMock.createStrictControl;
import static org.easymock.EasyMock.expect;
Modified:
core/trunk/src/test/java/org/jboss/cache/commands/legacy/write/PutKeyValueCommandTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/commands/pessimistic/write/PutKeyValueCommandTest.java 2008-07-03
12:04:30 UTC (rev 6157)
+++
core/trunk/src/test/java/org/jboss/cache/commands/legacy/write/PutKeyValueCommandTest.java 2008-07-03
12:20:17 UTC (rev 6158)
@@ -1,4 +1,4 @@
-package org.jboss.cache.commands.pessimistic.write;
+package org.jboss.cache.commands.legacy.write;
import static org.easymock.EasyMock.expect;
import org.jboss.cache.NodeNotExistsException;
Modified:
core/trunk/src/test/java/org/jboss/cache/commands/legacy/write/RemoveKeyCommandTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/commands/pessimistic/write/RemoveKeyCommandTest.java 2008-07-03
12:04:30 UTC (rev 6157)
+++
core/trunk/src/test/java/org/jboss/cache/commands/legacy/write/RemoveKeyCommandTest.java 2008-07-03
12:20:17 UTC (rev 6158)
@@ -1,4 +1,4 @@
-package org.jboss.cache.commands.pessimistic.write;
+package org.jboss.cache.commands.legacy.write;
import static org.easymock.EasyMock.expect;
import org.jboss.cache.commands.write.AbstractVersionedDataCommand;
Modified:
core/trunk/src/test/java/org/jboss/cache/commands/legacy/write/RemoveNodeCommandTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/commands/pessimistic/write/RemoveNodeCommandTest.java 2008-07-03
12:04:30 UTC (rev 6157)
+++
core/trunk/src/test/java/org/jboss/cache/commands/legacy/write/RemoveNodeCommandTest.java 2008-07-03
12:20:17 UTC (rev 6158)
@@ -1,4 +1,4 @@
-package org.jboss.cache.commands.pessimistic.write;
+package org.jboss.cache.commands.legacy.write;
import static org.easymock.EasyMock.expect;
import org.jboss.cache.commands.write.AbstractVersionedDataCommand;
Modified: core/trunk/src/test/java/org/jboss/cache/commands/write/EvictCommandTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/commands/write/EvictCommandTest.java 2008-07-03
12:04:30 UTC (rev 6157)
+++
core/trunk/src/test/java/org/jboss/cache/commands/write/EvictCommandTest.java 2008-07-03
12:20:17 UTC (rev 6158)
@@ -5,6 +5,7 @@
import org.easymock.IMocksControl;
import org.jboss.cache.DataContainer;
import org.jboss.cache.Fqn;
+import org.jboss.cache.commands.legacy.write.LegacyEvictCommand;
import org.jboss.cache.commands.read.AbstractDataCommandTest;
import org.jboss.cache.mock.MockNodesFixture;
import org.jboss.cache.notifications.Notifier;
@@ -32,8 +33,8 @@
control = createStrictControl();
notifier = control.createMock(Notifier.class);
container = control.createMock(DataContainer.class);
- command = new EvictCommand(testFqn);
- command.initialize(notifier, container, false);
+ command = new LegacyEvictCommand(testFqn);
+ command.initialize(notifier, container);
nodes = new MockNodesFixture();
}