[jbosscache-commits] JBoss Cache SVN: r6197 - in core/trunk/src: main/java/org/jboss/cache/buddyreplication and 13 other directories.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Mon Jul 7 16:19:19 EDT 2008


Author: manik.surtani at jboss.com
Date: 2008-07-07 16:19:19 -0400 (Mon, 07 Jul 2008)
New Revision: 6197

Added:
   core/trunk/src/main/java/org/jboss/cache/commands/CommandsFactory.java
   core/trunk/src/main/java/org/jboss/cache/commands/CommandsFactoryImpl.java
   core/trunk/src/main/java/org/jboss/cache/commands/OptimisticCommandsFactoryImpl.java
   core/trunk/src/main/java/org/jboss/cache/commands/PessimisticCommandsFactoryImpl.java
Modified:
   core/trunk/src/main/java/org/jboss/cache/NodeFactory.java
   core/trunk/src/main/java/org/jboss/cache/UnversionedNode.java
   core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java
   core/trunk/src/main/java/org/jboss/cache/buddyreplication/Fqn2BuddyFqnVisitor.java
   core/trunk/src/main/java/org/jboss/cache/cluster/ReplicationQueue.java
   core/trunk/src/main/java/org/jboss/cache/commands/ReplicableCommand.java
   core/trunk/src/main/java/org/jboss/cache/commands/remote/DataGravitationCleanupCommand.java
   core/trunk/src/main/java/org/jboss/cache/factories/CommandsMetaFactory.java
   core/trunk/src/main/java/org/jboss/cache/interceptors/BaseRpcInterceptor.java
   core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java
   core/trunk/src/main/java/org/jboss/cache/interceptors/InvalidationInterceptor.java
   core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticReplicationInterceptor.java
   core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
   core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.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/lock/LockUtil.java
   core/trunk/src/main/java/org/jboss/cache/lock/PessimisticNodeBasedLockManager.java
   core/trunk/src/main/java/org/jboss/cache/marshall/CacheMarshaller200.java
   core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyManagerTest.java
   core/trunk/src/test/java/org/jboss/cache/interceptors/EvictionInterceptorTest.java
   core/trunk/src/test/java/org/jboss/cache/marshall/MethodIdPreservationTest.java
   core/trunk/src/test/java/org/jboss/cache/marshall/ReturnValueMarshallingTest.java
   core/trunk/src/test/java/org/jboss/cache/util/TestingUtil.java
Log:
Moved commands factories to the o.j.c.commands package.  The factories package should just be for component factories such as the CommandsMetaFactory

Modified: core/trunk/src/main/java/org/jboss/cache/NodeFactory.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/NodeFactory.java	2008-07-07 19:52:12 UTC (rev 6196)
+++ core/trunk/src/main/java/org/jboss/cache/NodeFactory.java	2008-07-07 20:19:19 UTC (rev 6197)
@@ -6,9 +6,9 @@
  */
 package org.jboss.cache;
 
+import org.jboss.cache.commands.CommandsFactory;
 import org.jboss.cache.config.Configuration;
 import org.jboss.cache.config.Configuration.NodeLockingScheme;
-import org.jboss.cache.factories.CommandsFactory;
 import org.jboss.cache.factories.ComponentFactory;
 import org.jboss.cache.factories.annotations.Inject;
 import org.jboss.cache.factories.annotations.Start;

Modified: core/trunk/src/main/java/org/jboss/cache/UnversionedNode.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/UnversionedNode.java	2008-07-07 19:52:12 UTC (rev 6196)
+++ core/trunk/src/main/java/org/jboss/cache/UnversionedNode.java	2008-07-07 20:19:19 UTC (rev 6197)
@@ -9,8 +9,8 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import static org.jboss.cache.AbstractNode.NodeFlags.*;
+import org.jboss.cache.commands.CommandsFactory;
 import org.jboss.cache.commands.write.CreateNodeCommand;
-import org.jboss.cache.factories.CommandsFactory;
 import org.jboss.cache.invocation.InvocationContext;
 import org.jboss.cache.lock.IdentityLock;
 import org.jboss.cache.lock.LockStrategyFactory;

Modified: core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java	2008-07-07 19:52:12 UTC (rev 6196)
+++ core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java	2008-07-07 20:19:19 UTC (rev 6197)
@@ -18,6 +18,7 @@
 import org.jboss.cache.Region;
 import org.jboss.cache.RegionEmptyException;
 import org.jboss.cache.RegionManager;
+import org.jboss.cache.commands.CommandsFactory;
 import org.jboss.cache.commands.ReplicableCommand;
 import org.jboss.cache.commands.VisitableCommand;
 import org.jboss.cache.commands.remote.AnnounceBuddyPoolNameCommand;
@@ -28,7 +29,6 @@
 import org.jboss.cache.config.BuddyReplicationConfig.BuddyLocatorConfig;
 import org.jboss.cache.config.Configuration;
 import org.jboss.cache.config.Option;
-import org.jboss.cache.factories.CommandsFactory;
 import org.jboss.cache.factories.annotations.Inject;
 import org.jboss.cache.factories.annotations.Start;
 import org.jboss.cache.factories.annotations.Stop;

Modified: core/trunk/src/main/java/org/jboss/cache/buddyreplication/Fqn2BuddyFqnVisitor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/buddyreplication/Fqn2BuddyFqnVisitor.java	2008-07-07 19:52:12 UTC (rev 6196)
+++ core/trunk/src/main/java/org/jboss/cache/buddyreplication/Fqn2BuddyFqnVisitor.java	2008-07-07 20:19:19 UTC (rev 6197)
@@ -2,6 +2,7 @@
 
 import org.jboss.cache.Fqn;
 import org.jboss.cache.commands.AbstractVisitor;
+import org.jboss.cache.commands.CommandsFactory;
 import org.jboss.cache.commands.WriteCommand;
 import org.jboss.cache.commands.read.ExistsCommand;
 import org.jboss.cache.commands.read.GetChildrenNamesCommand;
@@ -14,8 +15,16 @@
 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.*;
-import org.jboss.cache.factories.CommandsFactory;
+import org.jboss.cache.commands.write.ClearDataCommand;
+import org.jboss.cache.commands.write.CreateNodeCommand;
+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;
+import org.jboss.cache.commands.write.PutForExternalReadCommand;
+import org.jboss.cache.commands.write.PutKeyValueCommand;
+import org.jboss.cache.commands.write.RemoveKeyCommand;
+import org.jboss.cache.commands.write.RemoveNodeCommand;
 import org.jboss.cache.invocation.InvocationContext;
 
 import java.util.ArrayList;

Modified: core/trunk/src/main/java/org/jboss/cache/cluster/ReplicationQueue.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/cluster/ReplicationQueue.java	2008-07-07 19:52:12 UTC (rev 6196)
+++ core/trunk/src/main/java/org/jboss/cache/cluster/ReplicationQueue.java	2008-07-07 20:19:19 UTC (rev 6197)
@@ -3,10 +3,10 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.cache.RPCManager;
+import org.jboss.cache.commands.CommandsFactory;
 import org.jboss.cache.commands.ReplicableCommand;
 import org.jboss.cache.commands.remote.ReplicateCommand;
 import org.jboss.cache.config.Configuration;
-import org.jboss.cache.factories.CommandsFactory;
 import org.jboss.cache.factories.annotations.Inject;
 import org.jboss.cache.factories.annotations.Start;
 import org.jboss.cache.factories.annotations.Stop;

Copied: core/trunk/src/main/java/org/jboss/cache/commands/CommandsFactory.java (from rev 6183, core/trunk/src/main/java/org/jboss/cache/factories/CommandsFactory.java)
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/CommandsFactory.java	                        (rev 0)
+++ core/trunk/src/main/java/org/jboss/cache/commands/CommandsFactory.java	2008-07-07 20:19:19 UTC (rev 6197)
@@ -0,0 +1,121 @@
+package org.jboss.cache.commands;
+
+import org.jboss.cache.Fqn;
+import org.jboss.cache.buddyreplication.BuddyGroup;
+import org.jboss.cache.commands.read.ExistsCommand;
+import org.jboss.cache.commands.read.GetChildrenNamesCommand;
+import org.jboss.cache.commands.read.GetDataMapCommand;
+import org.jboss.cache.commands.read.GetKeyValueCommand;
+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.remote.AnnounceBuddyPoolNameCommand;
+import org.jboss.cache.commands.remote.AssignToBuddyGroupCommand;
+import org.jboss.cache.commands.remote.ClusteredGetCommand;
+import org.jboss.cache.commands.remote.DataGravitationCleanupCommand;
+import org.jboss.cache.commands.remote.RemoveFromBuddyGroupCommand;
+import org.jboss.cache.commands.remote.ReplicateCommand;
+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.ClearDataCommand;
+import org.jboss.cache.commands.write.CreateNodeCommand;
+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;
+import org.jboss.cache.commands.write.PutForExternalReadCommand;
+import org.jboss.cache.commands.write.PutKeyValueCommand;
+import org.jboss.cache.commands.write.RemoveKeyCommand;
+import org.jboss.cache.commands.write.RemoveNodeCommand;
+import org.jboss.cache.transaction.GlobalTransaction;
+import org.jgroups.Address;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Factory for all types of cache commands.
+ * Here are some of the purposes of this class:
+ * <pre>
+ *   - not creating <code>CacheCommands</code> directly (i.e. through new usage) as this would reduce unit testability
+ *   - reduce the coupling between commands and other components. e.g. considering a commands that needs to knwo whether
+ *     locking type is optimistic, we will pass in a 'optimistic' boolean flag rather than entire Configuration object
+ * </pre>
+ * <p/>
+ * <b>Note:</b> As of 3.0, this is now an interface.
+ * <p/>
+ *
+ * @author Mircea.Markus at jboss.com
+ * @since 2.2
+ */
+public interface CommandsFactory
+{
+   PutDataMapCommand buildPutDataMapCommand(GlobalTransaction gtx, Fqn fqn, Map data);
+
+   PutKeyValueCommand buildPutKeyValueCommand(GlobalTransaction gtx, Fqn fqn, Object key, Object value);
+
+   PutForExternalReadCommand buildPutForExternalReadCommand(GlobalTransaction gtx, Fqn fqn, Object key, Object value);
+
+   ReplicateCommand buildReplicateCommand(ReplicableCommand command);
+
+   ReplicateCommand buildReplicateCommand(List<ReplicableCommand> modifications);
+
+   PrepareCommand buildPrepareCommand(GlobalTransaction gtx, WriteCommand command, boolean onePhaseCommit);
+
+   PrepareCommand buildPrepareCommand(GlobalTransaction gtx, List<WriteCommand> modifications, Address address, boolean onePhaseCommit);
+
+   CommitCommand buildCommitCommand(GlobalTransaction gtx);
+
+   DataGravitationCleanupCommand buildDataGravitationCleanupCommand(Fqn primaryFqn, Fqn backupFqn);
+
+   GravitateDataCommand buildGravitateDataCommand(Fqn fqn, Boolean searchSubtrees);
+
+   RemoveNodeCommand buildRemoveNodeCommand(GlobalTransaction gtx, Fqn fqn);
+
+   ClearDataCommand buildClearDataCommand(GlobalTransaction gtx, Fqn fqn);
+
+   EvictCommand buildEvictFqnCommand(Fqn fqn);
+
+   InvalidateCommand buildInvalidateCommand(Fqn fqn);
+
+   RemoveKeyCommand buildRemoveKeyCommand(GlobalTransaction tx, Fqn<?> fqn, Object key);
+
+   GetDataMapCommand buildGetDataMapCommand(Fqn fqn);
+
+   ExistsCommand buildExistsNodeCommand(Fqn fqn);
+
+   GetKeyValueCommand buildGetKeyValueCommand(Fqn<?> fqn, Object key, boolean sendNodeEvent);
+
+   GetNodeCommand buildGetNodeCommand(Fqn fqn);
+
+   GetKeysCommand buildGetKeysCommand(Fqn fqn);
+
+   GetChildrenNamesCommand buildGetChildrenNamesCommand(Fqn fqn);
+
+   MoveCommand buildMoveCommand(Fqn from, Fqn to);
+
+   RollbackCommand buildRollbackCommand(GlobalTransaction gtx);
+
+   OptimisticPrepareCommand buildOptimisticPrepareCommand(GlobalTransaction gtx, List<WriteCommand> modifications, Address address, boolean onePhaseCommit);
+
+   AnnounceBuddyPoolNameCommand buildAnnounceBuddyPoolNameCommand(Address address, String buddyPoolName);
+
+   RemoveFromBuddyGroupCommand buildRemoveFromBuddyGroupCommand(String groupName);
+
+   AssignToBuddyGroupCommand buildAssignToBuddyGroupCommand(BuddyGroup group, Map<Fqn, byte[]> state);
+
+   ClusteredGetCommand buildClusteredGetCommand(Boolean searchBackupSubtrees, DataCommand dataCommand);
+
+   CreateNodeCommand buildCreateNodeCommand(Fqn fqn);
+
+   /**
+    * Builds a cache command based on the ID passed in and an object array of parameters
+    *
+    * @param id         id of the command to build
+    * @param parameters parameters attached to the command
+    * @return a newly constructed cache command
+    */
+   ReplicableCommand fromStream(int id, Object[] parameters);
+}

Copied: core/trunk/src/main/java/org/jboss/cache/commands/CommandsFactoryImpl.java (from rev 6183, core/trunk/src/main/java/org/jboss/cache/factories/CommandsFactoryImpl.java)
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/CommandsFactoryImpl.java	                        (rev 0)
+++ core/trunk/src/main/java/org/jboss/cache/commands/CommandsFactoryImpl.java	2008-07-07 20:19:19 UTC (rev 6197)
@@ -0,0 +1,508 @@
+package org.jboss.cache.commands;
+
+import org.jboss.cache.CacheException;
+import org.jboss.cache.CacheSPI;
+import org.jboss.cache.DataContainer;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.RPCManager;
+import org.jboss.cache.buddyreplication.BuddyFqnTransformer;
+import org.jboss.cache.buddyreplication.BuddyGroup;
+import org.jboss.cache.buddyreplication.BuddyManager;
+import org.jboss.cache.commands.read.ExistsCommand;
+import org.jboss.cache.commands.read.GetChildrenNamesCommand;
+import org.jboss.cache.commands.read.GetDataMapCommand;
+import org.jboss.cache.commands.read.GetKeyValueCommand;
+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.remote.AnnounceBuddyPoolNameCommand;
+import org.jboss.cache.commands.remote.AssignToBuddyGroupCommand;
+import org.jboss.cache.commands.remote.ClusteredGetCommand;
+import org.jboss.cache.commands.remote.DataGravitationCleanupCommand;
+import org.jboss.cache.commands.remote.RemoveFromBuddyGroupCommand;
+import org.jboss.cache.commands.remote.ReplicateCommand;
+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.ClearDataCommand;
+import org.jboss.cache.commands.write.CreateNodeCommand;
+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;
+import org.jboss.cache.commands.write.PutForExternalReadCommand;
+import org.jboss.cache.commands.write.PutKeyValueCommand;
+import org.jboss.cache.commands.write.RemoveKeyCommand;
+import org.jboss.cache.commands.write.RemoveNodeCommand;
+import org.jboss.cache.commands.write.VersionedInvalidateCommand;
+import org.jboss.cache.config.Configuration;
+import org.jboss.cache.factories.annotations.Inject;
+import org.jboss.cache.interceptors.InterceptorChain;
+import org.jboss.cache.notifications.Notifier;
+import org.jboss.cache.transaction.GlobalTransaction;
+import org.jboss.cache.transaction.TransactionTable;
+import org.jgroups.Address;
+
+import javax.transaction.TransactionManager;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * This is the implementation to use for most commands and most locking schemes.
+ */
+public class CommandsFactoryImpl implements CommandsFactory
+{
+   protected RPCManager rpcManager;
+   protected DataContainer dataContainer;
+   protected Notifier notifier;
+   protected InterceptorChain invoker;
+   protected BuddyManager buddyManager;
+   protected TransactionTable transactionTable;
+   protected CacheSPI cacheSpi;
+   protected Configuration configuration;
+   protected TransactionManager txManager;
+   protected BuddyFqnTransformer buddyFqnTransformer;
+
+   public CommandsFactoryImpl()
+   {
+   }
+
+   @Inject
+   public void initialize(RPCManager rpc, DataContainer dataContainer, Notifier notifier, BuddyManager buddyManager,
+                          InterceptorChain invoker, TransactionTable transactionTable, CacheSPI cacheSpi,
+                          Configuration configuration, TransactionManager txManager, BuddyFqnTransformer buddyFqnTransformer)
+   {
+      this.rpcManager = rpc;
+      this.dataContainer = dataContainer;
+      this.notifier = notifier;
+      this.buddyManager = buddyManager;
+      this.invoker = invoker;
+      this.transactionTable = transactionTable;
+      this.cacheSpi = cacheSpi;
+      this.configuration = configuration;
+      this.txManager = txManager;
+      this.buddyFqnTransformer = buddyFqnTransformer;
+   }
+
+   public PutDataMapCommand buildPutDataMapCommand(GlobalTransaction gtx, Fqn fqn, Map data)
+   {
+      PutDataMapCommand cmd = new PutDataMapCommand(gtx, fqn, data);
+      cmd.initialize(notifier, dataContainer);
+      return cmd;
+   }
+
+   public PutKeyValueCommand buildPutKeyValueCommand(GlobalTransaction gtx, Fqn fqn, Object key, Object value)
+   {
+      PutKeyValueCommand cmd = new PutKeyValueCommand(gtx, fqn, key, value);
+      cmd.initialize(notifier, dataContainer);
+      return cmd;
+   }
+
+   public PutForExternalReadCommand buildPutForExternalReadCommand(GlobalTransaction gtx, Fqn fqn, Object key, Object value)
+   {
+      PutForExternalReadCommand cmd = new PutForExternalReadCommand(gtx, fqn, key, value);
+      cmd.initialize(notifier, dataContainer);
+      return cmd;
+   }
+
+   public ReplicateCommand buildReplicateCommand(ReplicableCommand command)
+   {
+      ReplicateCommand cmd = new ReplicateCommand(command);
+      cmd.initialize(invoker);
+      return cmd;
+   }
+
+   public ReplicateCommand buildReplicateCommand(List<ReplicableCommand> modifications)
+   {
+      ReplicateCommand cmd = new ReplicateCommand(modifications);
+      cmd.initialize(invoker);
+      return cmd;
+   }
+
+   public PrepareCommand buildPrepareCommand(GlobalTransaction gtx, WriteCommand command, boolean onePhaseCommit)
+   {
+      return buildPrepareCommand(gtx, Collections.singletonList(command), rpcManager.getLocalAddress(), onePhaseCommit);
+   }
+
+   public PrepareCommand buildPrepareCommand(GlobalTransaction gtx, List<WriteCommand> modifications, Address address, boolean onePhaseCommit)
+   {
+      return new PrepareCommand(gtx, modifications, address, onePhaseCommit);
+   }
+
+   public CommitCommand buildCommitCommand(GlobalTransaction gtx)
+   {
+      return new CommitCommand(gtx);
+   }
+
+   public DataGravitationCleanupCommand buildDataGravitationCleanupCommand(Fqn primaryFqn, Fqn backupFqn)
+   {
+      DataGravitationCleanupCommand command = new DataGravitationCleanupCommand(primaryFqn, backupFqn);
+      command.initialize(buddyManager, invoker, transactionTable, this, dataContainer, buddyFqnTransformer);
+      return command;
+   }
+
+   public GravitateDataCommand buildGravitateDataCommand(Fqn fqn, Boolean searchSubtrees)
+   {
+      GravitateDataCommand command = new GravitateDataCommand(fqn, searchSubtrees, rpcManager.getLocalAddress());
+      command.initialize(dataContainer, cacheSpi, buddyFqnTransformer);
+      return command;
+   }
+
+   public EvictCommand buildEvictFqnCommand(Fqn fqn)
+   {
+      EvictCommand command = new EvictCommand(fqn);
+      command.initialize(notifier, dataContainer);
+      return command;
+   }
+
+   public InvalidateCommand buildInvalidateCommand(Fqn fqn)
+   {
+      if (configuration.getNodeLockingScheme().isVersionedScheme())
+      {
+         VersionedInvalidateCommand command = new VersionedInvalidateCommand(fqn);
+         command.initialize(txManager);
+         command.initialize(cacheSpi, dataContainer, notifier);
+         return command;
+      }
+      else
+      {
+         InvalidateCommand command = new InvalidateCommand(fqn);
+         command.initialize(cacheSpi, dataContainer, notifier);
+         return command;
+      }
+   }
+
+   public GetDataMapCommand buildGetDataMapCommand(Fqn fqn)
+   {
+      GetDataMapCommand command = new GetDataMapCommand(fqn);
+      command.initialize(dataContainer);
+      return command;
+   }
+
+   public ExistsCommand buildExistsNodeCommand(Fqn fqn)
+   {
+      ExistsCommand command = new ExistsCommand(fqn);
+      command.initialize(dataContainer);
+      return command;
+   }
+
+   public GetKeyValueCommand buildGetKeyValueCommand(Fqn<?> fqn, Object key, boolean sendNodeEvent)
+   {
+      GetKeyValueCommand command = new GetKeyValueCommand(fqn, key, sendNodeEvent);
+      command.initialize(dataContainer, notifier);
+      return command;
+   }
+
+   public GetNodeCommand buildGetNodeCommand(Fqn fqn)
+   {
+      GetNodeCommand command = new GetNodeCommand(fqn);
+      command.initialize(dataContainer);
+      return command;
+   }
+
+   public GetKeysCommand buildGetKeysCommand(Fqn fqn)
+   {
+      GetKeysCommand command = new GetKeysCommand(fqn);
+      command.initialize(dataContainer);
+      return command;
+   }
+
+   public GetChildrenNamesCommand buildGetChildrenNamesCommand(Fqn fqn)
+   {
+      GetChildrenNamesCommand command = new GetChildrenNamesCommand(fqn);
+      command.initialize(dataContainer);
+      return command;
+   }
+
+   public RollbackCommand buildRollbackCommand(GlobalTransaction gtx)
+   {
+      return new RollbackCommand(gtx);
+   }
+
+   public OptimisticPrepareCommand buildOptimisticPrepareCommand(GlobalTransaction gtx, List<WriteCommand> modifications, Address address, boolean onePhaseCommit)
+   {
+      return new OptimisticPrepareCommand(gtx, modifications, address, onePhaseCommit);
+   }
+
+   public AnnounceBuddyPoolNameCommand buildAnnounceBuddyPoolNameCommand(Address address, String buddyPoolName)
+   {
+      AnnounceBuddyPoolNameCommand command = new AnnounceBuddyPoolNameCommand(address, buddyPoolName);
+      command.initialize(buddyManager);
+      return command;
+   }
+
+   public RemoveFromBuddyGroupCommand buildRemoveFromBuddyGroupCommand(String groupName)
+   {
+      RemoveFromBuddyGroupCommand command = new RemoveFromBuddyGroupCommand(groupName);
+      command.initialize(buddyManager);
+      return command;
+   }
+
+   public AssignToBuddyGroupCommand buildAssignToBuddyGroupCommand(BuddyGroup group, Map<Fqn, byte[]> state)
+   {
+      AssignToBuddyGroupCommand command = new AssignToBuddyGroupCommand(group, state);
+      command.initialize(buddyManager);
+      return command;
+   }
+
+   public ClusteredGetCommand buildClusteredGetCommand(Boolean searchBackupSubtrees, DataCommand dataCommand)
+   {
+      ClusteredGetCommand command = new ClusteredGetCommand(searchBackupSubtrees, dataCommand);
+      command.initialize(dataContainer, invoker);
+      return command;
+   }
+
+   public RemoveNodeCommand buildRemoveNodeCommand(GlobalTransaction gtx, Fqn fqn)
+   {
+      RemoveNodeCommand cmd = new RemoveNodeCommand(gtx, fqn);
+      cmd.initialize(notifier, dataContainer);
+      return cmd;
+   }
+
+   public ClearDataCommand buildClearDataCommand(GlobalTransaction gtx, Fqn fqn)
+   {
+      ClearDataCommand cmd = new ClearDataCommand(gtx, fqn);
+      cmd.initialize(notifier, dataContainer);
+      return cmd;
+   }
+
+   public RemoveKeyCommand buildRemoveKeyCommand(GlobalTransaction tx, Fqn<?> fqn, Object key)
+   {
+      RemoveKeyCommand cmd = new RemoveKeyCommand(tx, fqn, key);
+      cmd.initialize(notifier, dataContainer);
+      return cmd;
+   }
+
+   public MoveCommand buildMoveCommand(Fqn from, Fqn to)
+   {
+      MoveCommand cmd = new MoveCommand(from, to);
+      cmd.initialize(notifier, dataContainer);
+      return cmd;
+   }
+
+   public CreateNodeCommand buildCreateNodeCommand(Fqn fqn)
+   {
+      CreateNodeCommand command = new CreateNodeCommand(fqn);
+      command.initialize(dataContainer);
+      return command;
+   }
+
+   public ReplicableCommand fromStream(int id, Object[] parameters)
+   {
+      ReplicableCommand command;
+      switch (id)
+      {
+         case ExistsCommand.METHOD_ID:
+         {
+            ExistsCommand result = new ExistsCommand();
+            result.initialize(dataContainer);
+            command = result;
+            break;
+         }
+         case GetChildrenNamesCommand.METHOD_ID:
+         {
+            GetChildrenNamesCommand returnValue = new GetChildrenNamesCommand();
+            returnValue.initialize(dataContainer);
+            command = returnValue;
+            break;
+         }
+         case GetDataMapCommand.METHOD_ID:
+         {
+            GetDataMapCommand returnValue = new GetDataMapCommand();
+            returnValue.initialize(dataContainer);
+            command = returnValue;
+            break;
+         }
+         case GetKeysCommand.METHOD_ID:
+         {
+            GetKeysCommand returnValue = new GetKeysCommand();
+            returnValue.initialize(dataContainer);
+            command = returnValue;
+            break;
+         }
+         case GetKeyValueCommand.METHOD_ID:
+         {
+            GetKeyValueCommand returnValue = new GetKeyValueCommand();
+            returnValue.initialize(dataContainer, notifier);
+            command = returnValue;
+            break;
+         }
+         case GetNodeCommand.METHOD_ID:
+         {
+            GetNodeCommand returnValue = new GetNodeCommand();
+            returnValue.initialize(dataContainer);
+            command = returnValue;
+            break;
+         }
+         case MoveCommand.METHOD_ID:
+         {
+            MoveCommand returnValue = new MoveCommand();
+            returnValue.initialize(notifier, dataContainer);
+            command = returnValue;
+            break;
+         }
+         case PutDataMapCommand.METHOD_ID:
+         case PutDataMapCommand.ERASE_METHOD_ID:
+         case PutDataMapCommand.ERASE_VERSIONED_METHOD_ID:
+         case PutDataMapCommand.VERSIONED_METHOD_ID:
+         {
+            PutDataMapCommand returnValue = new PutDataMapCommand();
+            returnValue.initialize(notifier, dataContainer);
+            command = returnValue;
+            break;
+         }
+         case PutKeyValueCommand.METHOD_ID:
+         case PutKeyValueCommand.VERSIONED_METHOD_ID:
+         {
+            PutKeyValueCommand returnValue = new PutKeyValueCommand();
+            returnValue.initialize(notifier, dataContainer);
+            command = returnValue;
+            break;
+         }
+         case PutForExternalReadCommand.METHOD_ID:
+         case PutForExternalReadCommand.VERSIONED_METHOD_ID:
+         {
+            PutForExternalReadCommand returnValue = new PutForExternalReadCommand();
+            returnValue.initialize(notifier, dataContainer);
+            command = returnValue;
+            break;
+         }
+         case ClearDataCommand.METHOD_ID:
+         case ClearDataCommand.VERSIONED_METHOD_ID:
+         {
+            ClearDataCommand returnValue = new ClearDataCommand();
+            returnValue.initialize(notifier, dataContainer);
+            command = returnValue;
+            break;
+         }
+         case RemoveKeyCommand.METHOD_ID:
+         case RemoveKeyCommand.VERSIONED_METHOD_ID:
+         {
+            RemoveKeyCommand returnValue = new RemoveKeyCommand();
+            returnValue.initialize(notifier, dataContainer);
+            command = returnValue;
+            break;
+         }
+
+         case RemoveNodeCommand.METHOD_ID:
+         case RemoveNodeCommand.VERSIONED_METHOD_ID:
+         {
+            RemoveNodeCommand returnValue = new RemoveNodeCommand();
+            returnValue.initialize(notifier, dataContainer);
+            command = returnValue;
+            break;
+         }
+         case CreateNodeCommand.METHOD_ID:
+         {
+            CreateNodeCommand returnValue = new CreateNodeCommand(null);
+            returnValue.initialize(dataContainer);
+            command = returnValue;
+            break;
+         }
+         // --- transactional method calls
+
+         case PrepareCommand.METHOD_ID:
+         {
+            command = new PrepareCommand();
+            break;
+         }
+
+         case OptimisticPrepareCommand.METHOD_ID:
+         {
+            command = new OptimisticPrepareCommand();
+            break;
+         }
+
+         case CommitCommand.METHOD_ID:
+         {
+            command = new CommitCommand();
+            break;
+         }
+
+         case RollbackCommand.METHOD_ID:
+         {
+            command = new RollbackCommand();
+            break;
+         }
+
+         // --- replicate methods
+         case ReplicateCommand.MULTIPLE_METHOD_ID:
+         case ReplicateCommand.SINGLE_METHOD_ID:
+         {
+            ReplicateCommand returnValue = new ReplicateCommand();
+            returnValue.initialize(invoker);
+            command = returnValue;
+            break;
+         }
+
+         case InvalidateCommand.METHOD_ID:
+         {
+            if (configuration.getNodeLockingScheme().isVersionedScheme())
+            {
+               VersionedInvalidateCommand returnValue = new VersionedInvalidateCommand();
+               returnValue.initialize(txManager);
+               returnValue.initialize(cacheSpi, dataContainer, notifier);
+               command = returnValue;
+            }
+            else
+            {
+               InvalidateCommand returnValue = new InvalidateCommand();
+               returnValue.initialize(cacheSpi, dataContainer, notifier);
+               command = returnValue;
+            }
+            break;
+         }
+
+         case ClusteredGetCommand.METHOD_ID:
+         {
+            ClusteredGetCommand returnValue = new ClusteredGetCommand();
+            returnValue.initialize(dataContainer, invoker);
+            command = returnValue;
+            break;
+         }
+         // ---- Buddy replication - group organisation commands
+         case AnnounceBuddyPoolNameCommand.METHOD_ID:
+         {
+            AnnounceBuddyPoolNameCommand returnValue = new AnnounceBuddyPoolNameCommand();
+            returnValue.initialize(buddyManager);
+            command = returnValue;
+            break;
+         }
+         case AssignToBuddyGroupCommand.METHOD_ID:
+         {
+            AssignToBuddyGroupCommand returnValue = new AssignToBuddyGroupCommand();
+            returnValue.initialize(buddyManager);
+            command = returnValue;
+            break;
+         }
+         case RemoveFromBuddyGroupCommand.METHOD_ID:
+         {
+            RemoveFromBuddyGroupCommand returnValue = new RemoveFromBuddyGroupCommand();
+            returnValue.initialize(buddyManager);
+            command = returnValue;
+            break;
+         }
+         case DataGravitationCleanupCommand.METHOD_ID:
+         {
+            DataGravitationCleanupCommand returnValue = new DataGravitationCleanupCommand();
+            returnValue.initialize(buddyManager, invoker, transactionTable, this, dataContainer, buddyFqnTransformer);
+            command = returnValue;
+            break;
+         }
+         case GravitateDataCommand.METHOD_ID:
+         {
+            GravitateDataCommand returnValue = new GravitateDataCommand(rpcManager.getLocalAddress());
+            returnValue.initialize(dataContainer, cacheSpi, buddyFqnTransformer);
+            command = returnValue;
+            break;
+         }
+         default:
+            throw new CacheException("Unknown command id " + id + "!");
+      }
+
+      command.setParameters(id, parameters);
+      return command;
+   }
+}

Copied: core/trunk/src/main/java/org/jboss/cache/commands/OptimisticCommandsFactoryImpl.java (from rev 6183, core/trunk/src/main/java/org/jboss/cache/factories/OptimisticCommandsFactoryImpl.java)
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/OptimisticCommandsFactoryImpl.java	                        (rev 0)
+++ core/trunk/src/main/java/org/jboss/cache/commands/OptimisticCommandsFactoryImpl.java	2008-07-07 20:19:19 UTC (rev 6197)
@@ -0,0 +1,22 @@
+package org.jboss.cache.commands;
+
+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 at jboss.org">manik at 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;
+   }
+}

Copied: core/trunk/src/main/java/org/jboss/cache/commands/PessimisticCommandsFactoryImpl.java (from rev 6183, core/trunk/src/main/java/org/jboss/cache/factories/PessimisticCommandsFactoryImpl.java)
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/PessimisticCommandsFactoryImpl.java	                        (rev 0)
+++ core/trunk/src/main/java/org/jboss/cache/commands/PessimisticCommandsFactoryImpl.java	2008-07-07 20:19:19 UTC (rev 6197)
@@ -0,0 +1,198 @@
+package org.jboss.cache.commands;
+
+import org.jboss.cache.Fqn;
+import org.jboss.cache.commands.legacy.read.PessGetChildrenNamesCommand;
+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.read.GetChildrenNamesCommand;
+import org.jboss.cache.commands.write.ClearDataCommand;
+import org.jboss.cache.commands.write.CreateNodeCommand;
+import org.jboss.cache.commands.write.MoveCommand;
+import org.jboss.cache.commands.write.PutDataMapCommand;
+import org.jboss.cache.commands.write.PutForExternalReadCommand;
+import org.jboss.cache.commands.write.PutKeyValueCommand;
+import org.jboss.cache.commands.write.RemoveKeyCommand;
+import org.jboss.cache.commands.write.RemoveNodeCommand;
+import org.jboss.cache.transaction.GlobalTransaction;
+
+import java.util.Map;
+
+/**
+ * This specific implementation of {@link CommandsFactory} specifically creates
+ * pessimistic commands where appropriate, with the ability to roll back.
+ *
+ * @author Manik Surtani (<a href="mailto:manik at jboss.org">manik at jboss.org</a>)
+ * @see org.jboss.cache.commands.legacy.ReversibleCommand
+ * @since 3.0
+ */
+public class PessimisticCommandsFactoryImpl extends OptimisticCommandsFactoryImpl
+{
+   @Override
+   public GetChildrenNamesCommand buildGetChildrenNamesCommand(Fqn fqn)
+   {
+      GetChildrenNamesCommand command = new PessGetChildrenNamesCommand(fqn);
+      command.initialize(dataContainer);
+      return command;
+   }
+
+   @Override
+   public PutDataMapCommand buildPutDataMapCommand(GlobalTransaction gtx, Fqn fqn, Map data)
+   {
+      PutDataMapCommand cmd = new PessPutDataMapCommand(gtx, fqn, data);
+      cmd.initialize(notifier, dataContainer);
+      return cmd;
+   }
+
+   @Override
+   public PutKeyValueCommand buildPutKeyValueCommand(GlobalTransaction gtx, Fqn fqn, Object key, Object value)
+   {
+      PutKeyValueCommand cmd = new PessPutKeyValueCommand(gtx, fqn, key, value);
+      cmd.initialize(notifier, dataContainer);
+      return cmd;
+   }
+
+   @Override
+   public PutForExternalReadCommand buildPutForExternalReadCommand(GlobalTransaction gtx, Fqn fqn, Object key, Object value)
+   {
+      PutForExternalReadCommand cmd = new PessPutForExternalReadCommand(gtx, fqn, key, value);
+      cmd.initialize(notifier, dataContainer);
+      return cmd;
+   }
+
+   @Override
+   public RemoveNodeCommand buildRemoveNodeCommand(GlobalTransaction gtx, Fqn fqn)
+   {
+      RemoveNodeCommand cmd = new PessRemoveNodeCommand(gtx, fqn);
+      cmd.initialize(notifier, dataContainer);
+      return cmd;
+   }
+
+   @Override
+   public ClearDataCommand buildClearDataCommand(GlobalTransaction gtx, Fqn fqn)
+   {
+      ClearDataCommand cmd = new PessClearDataCommand(gtx, fqn);
+      cmd.initialize(notifier, dataContainer);
+      return cmd;
+   }
+
+   @Override
+   public RemoveKeyCommand buildRemoveKeyCommand(GlobalTransaction tx, Fqn<?> fqn, Object key)
+   {
+      RemoveKeyCommand cmd = new PessRemoveKeyCommand(tx, fqn, key);
+      cmd.initialize(notifier, dataContainer);
+      return cmd;
+   }
+
+   @Override
+   public MoveCommand buildMoveCommand(Fqn from, Fqn to)
+   {
+      MoveCommand cmd = new PessMoveCommand(from, to);
+      cmd.initialize(notifier, dataContainer);
+      return cmd;
+   }
+
+   @Override
+   public CreateNodeCommand buildCreateNodeCommand(Fqn fqn)
+   {
+      CreateNodeCommand command = new PessCreateNodeCommand(fqn);
+      command.initialize(dataContainer);
+      return command;
+   }
+
+   @Override
+   public ReplicableCommand fromStream(int id, Object[] parameters)
+   {
+      ReplicableCommand command;
+      boolean skipSetParams = false;
+      switch (id)
+      {
+         case GetChildrenNamesCommand.METHOD_ID:
+         {
+            GetChildrenNamesCommand returnValue = new PessGetChildrenNamesCommand();
+            returnValue.initialize(dataContainer);
+            command = returnValue;
+            break;
+         }
+         case MoveCommand.METHOD_ID:
+         {
+            MoveCommand returnValue = new PessMoveCommand();
+            returnValue.initialize(notifier, dataContainer);
+            command = returnValue;
+            break;
+         }
+         case PutDataMapCommand.METHOD_ID:
+         case PutDataMapCommand.ERASE_METHOD_ID:
+         case PutDataMapCommand.ERASE_VERSIONED_METHOD_ID:
+         case PutDataMapCommand.VERSIONED_METHOD_ID:
+         {
+            PutDataMapCommand returnValue = new PessPutDataMapCommand();
+            returnValue.initialize(notifier, dataContainer);
+            command = returnValue;
+            break;
+         }
+         case PutKeyValueCommand.METHOD_ID:
+         case PutKeyValueCommand.VERSIONED_METHOD_ID:
+         {
+            PutKeyValueCommand returnValue = new PessPutKeyValueCommand();
+            returnValue.initialize(notifier, dataContainer);
+            command = returnValue;
+            break;
+         }
+         case PutForExternalReadCommand.METHOD_ID:
+         case PutForExternalReadCommand.VERSIONED_METHOD_ID:
+         {
+            PutForExternalReadCommand returnValue = new PessPutForExternalReadCommand();
+            returnValue.initialize(notifier, dataContainer);
+            command = returnValue;
+            break;
+         }
+         case ClearDataCommand.METHOD_ID:
+         case ClearDataCommand.VERSIONED_METHOD_ID:
+         {
+            ClearDataCommand returnValue = new PessClearDataCommand();
+            returnValue.initialize(notifier, dataContainer);
+            command = returnValue;
+            break;
+         }
+         case RemoveKeyCommand.METHOD_ID:
+         case RemoveKeyCommand.VERSIONED_METHOD_ID:
+         {
+            RemoveKeyCommand returnValue = new PessRemoveKeyCommand();
+            returnValue.initialize(notifier, dataContainer);
+            command = returnValue;
+            break;
+         }
+
+         case RemoveNodeCommand.METHOD_ID:
+         case RemoveNodeCommand.VERSIONED_METHOD_ID:
+         {
+            RemoveNodeCommand returnValue = new PessRemoveNodeCommand();
+            returnValue.initialize(notifier, dataContainer);
+            command = returnValue;
+            break;
+         }
+         case CreateNodeCommand.METHOD_ID:
+         {
+            CreateNodeCommand returnValue = new PessCreateNodeCommand(null);
+            returnValue.initialize(dataContainer);
+            command = returnValue;
+            break;
+         }
+         default:
+            // pass up to superclass
+            command = super.fromStream(id, parameters);
+            skipSetParams = true;
+      }
+      if (!skipSetParams)
+      {
+         command.setParameters(id, parameters);
+      }
+      return command;
+   }
+}

Modified: core/trunk/src/main/java/org/jboss/cache/commands/ReplicableCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/ReplicableCommand.java	2008-07-07 19:52:12 UTC (rev 6196)
+++ core/trunk/src/main/java/org/jboss/cache/commands/ReplicableCommand.java	2008-07-07 20:19:19 UTC (rev 6197)
@@ -39,7 +39,7 @@
    Object[] getParameters();
 
    /**
-    * Used by the {@link org.jboss.cache.factories.CommandsFactory} to create a command from raw data read off a stream.
+    * Used by the {@link CommandsFactory} to create a command from raw data read off a stream.
     *
     * @param commandId  command id to set.  This is usually unused but *could* be used in the event of a command having multiple IDs, such as {@link org.jboss.cache.commands.write.PutKeyValueCommand}.
     * @param parameters object array of args

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-07-07 19:52:12 UTC (rev 6196)
+++ core/trunk/src/main/java/org/jboss/cache/commands/remote/DataGravitationCleanupCommand.java	2008-07-07 20:19:19 UTC (rev 6197)
@@ -7,10 +7,10 @@
 import org.jboss.cache.NodeSPI;
 import org.jboss.cache.buddyreplication.BuddyFqnTransformer;
 import org.jboss.cache.buddyreplication.BuddyManager;
+import org.jboss.cache.commands.CommandsFactory;
 import org.jboss.cache.commands.ReplicableCommand;
 import org.jboss.cache.commands.write.EvictCommand;
 import org.jboss.cache.commands.write.RemoveNodeCommand;
-import org.jboss.cache.factories.CommandsFactory;
 import org.jboss.cache.interceptors.InterceptorChain;
 import org.jboss.cache.invocation.InvocationContext;
 import org.jboss.cache.transaction.GlobalTransaction;

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-07 19:52:12 UTC (rev 6196)
+++ core/trunk/src/main/java/org/jboss/cache/factories/CommandsMetaFactory.java	2008-07-07 20:19:19 UTC (rev 6197)
@@ -1,5 +1,9 @@
 package org.jboss.cache.factories;
 
+import org.jboss.cache.commands.CommandsFactory;
+import org.jboss.cache.commands.CommandsFactoryImpl;
+import org.jboss.cache.commands.OptimisticCommandsFactoryImpl;
+import org.jboss.cache.commands.PessimisticCommandsFactoryImpl;
 import org.jboss.cache.config.ConfigurationException;
 import org.jboss.cache.factories.annotations.DefaultFactoryFor;
 

Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/BaseRpcInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/BaseRpcInterceptor.java	2008-07-07 19:52:12 UTC (rev 6196)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/BaseRpcInterceptor.java	2008-07-07 20:19:19 UTC (rev 6197)
@@ -6,10 +6,10 @@
 import org.jboss.cache.RPCManager;
 import org.jboss.cache.buddyreplication.BuddyManager;
 import org.jboss.cache.cluster.ReplicationQueue;
+import org.jboss.cache.commands.CommandsFactory;
 import org.jboss.cache.commands.ReplicableCommand;
 import org.jboss.cache.commands.VisitableCommand;
 import org.jboss.cache.config.Option;
-import org.jboss.cache.factories.CommandsFactory;
 import org.jboss.cache.factories.annotations.Inject;
 import org.jboss.cache.factories.annotations.Start;
 import org.jboss.cache.interceptors.base.CommandInterceptor;

Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java	2008-07-07 19:52:12 UTC (rev 6196)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java	2008-07-07 20:19:19 UTC (rev 6197)
@@ -13,6 +13,7 @@
 import org.jboss.cache.buddyreplication.BuddyFqnTransformer;
 import org.jboss.cache.buddyreplication.BuddyManager;
 import org.jboss.cache.buddyreplication.GravitateResult;
+import org.jboss.cache.commands.CommandsFactory;
 import org.jboss.cache.commands.DataCommand;
 import org.jboss.cache.commands.ReplicableCommand;
 import org.jboss.cache.commands.read.ExistsCommand;
@@ -25,7 +26,6 @@
 import org.jboss.cache.commands.remote.DataGravitationCleanupCommand;
 import org.jboss.cache.commands.tx.CommitCommand;
 import org.jboss.cache.commands.tx.RollbackCommand;
-import org.jboss.cache.factories.CommandsFactory;
 import org.jboss.cache.factories.annotations.Inject;
 import org.jboss.cache.invocation.InvocationContext;
 import org.jboss.cache.marshall.NodeData;

Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/InvalidationInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/InvalidationInterceptor.java	2008-07-07 19:52:12 UTC (rev 6196)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/InvalidationInterceptor.java	2008-07-07 20:19:19 UTC (rev 6197)
@@ -8,6 +8,7 @@
 
 import org.jboss.cache.Fqn;
 import org.jboss.cache.commands.AbstractVisitor;
+import org.jboss.cache.commands.CommandsFactory;
 import org.jboss.cache.commands.VisitableCommand;
 import org.jboss.cache.commands.WriteCommand;
 import org.jboss.cache.commands.tx.CommitCommand;
@@ -25,7 +26,6 @@
 import org.jboss.cache.commands.write.VersionedInvalidateCommand;
 import org.jboss.cache.config.Configuration.NodeLockingScheme;
 import org.jboss.cache.config.Option;
-import org.jboss.cache.factories.CommandsFactory;
 import org.jboss.cache.factories.annotations.Inject;
 import org.jboss.cache.factories.annotations.Start;
 import org.jboss.cache.invocation.InvocationContext;

Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticReplicationInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticReplicationInterceptor.java	2008-07-07 19:52:12 UTC (rev 6196)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticReplicationInterceptor.java	2008-07-07 20:19:19 UTC (rev 6197)
@@ -9,6 +9,7 @@
 import org.jboss.cache.CacheException;
 import org.jboss.cache.Fqn;
 import org.jboss.cache.commands.AbstractVisitor;
+import org.jboss.cache.commands.CommandsFactory;
 import org.jboss.cache.commands.ReplicableCommand;
 import org.jboss.cache.commands.VersionedDataCommand;
 import org.jboss.cache.commands.VisitableCommand;
@@ -25,7 +26,6 @@
 import org.jboss.cache.commands.write.PutKeyValueCommand;
 import org.jboss.cache.commands.write.RemoveKeyCommand;
 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.InvocationContext;
 import org.jboss.cache.optimistic.DataVersion;

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-07 19:52:12 UTC (rev 6196)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java	2008-07-07 20:19:19 UTC (rev 6197)
@@ -9,6 +9,7 @@
 import org.jboss.cache.DataContainer;
 import org.jboss.cache.Fqn;
 import org.jboss.cache.NodeSPI;
+import org.jboss.cache.commands.CommandsFactory;
 import org.jboss.cache.commands.DataCommand;
 import org.jboss.cache.commands.VisitableCommand;
 import org.jboss.cache.commands.WriteCommand;
@@ -28,7 +29,6 @@
 import org.jboss.cache.commands.write.PutKeyValueCommand;
 import org.jboss.cache.commands.write.RemoveKeyCommand;
 import org.jboss.cache.commands.write.RemoveNodeCommand;
-import org.jboss.cache.factories.CommandsFactory;
 import org.jboss.cache.factories.annotations.Inject;
 import org.jboss.cache.interceptors.base.PrePostProcessingCommandInterceptor;
 import org.jboss.cache.invocation.InvocationContext;

Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java	2008-07-07 19:52:12 UTC (rev 6196)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java	2008-07-07 20:19:19 UTC (rev 6197)
@@ -10,6 +10,7 @@
 import org.jboss.cache.RPCManager;
 import org.jboss.cache.ReplicationException;
 import org.jboss.cache.commands.AbstractVisitor;
+import org.jboss.cache.commands.CommandsFactory;
 import org.jboss.cache.commands.ReplicableCommand;
 import org.jboss.cache.commands.VisitableCommand;
 import org.jboss.cache.commands.WriteCommand;
@@ -25,7 +26,6 @@
 import org.jboss.cache.commands.write.RemoveKeyCommand;
 import org.jboss.cache.commands.write.RemoveNodeCommand;
 import org.jboss.cache.config.Option;
-import org.jboss.cache.factories.CommandsFactory;
 import org.jboss.cache.factories.ComponentRegistry;
 import org.jboss.cache.factories.annotations.Inject;
 import org.jboss.cache.factories.context.ContextFactory;

Modified: core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java	2008-07-07 19:52:12 UTC (rev 6196)
+++ core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java	2008-07-07 20:19:19 UTC (rev 6197)
@@ -13,6 +13,7 @@
 import org.jboss.cache.Version;
 import org.jboss.cache.buddyreplication.BuddyManager;
 import org.jboss.cache.buddyreplication.GravitateResult;
+import org.jboss.cache.commands.CommandsFactory;
 import org.jboss.cache.commands.read.GetChildrenNamesCommand;
 import org.jboss.cache.commands.read.GetDataMapCommand;
 import org.jboss.cache.commands.read.GetKeyValueCommand;
@@ -28,7 +29,6 @@
 import org.jboss.cache.commands.write.RemoveNodeCommand;
 import org.jboss.cache.config.Configuration;
 import org.jboss.cache.config.Option;
-import org.jboss.cache.factories.CommandsFactory;
 import org.jboss.cache.factories.annotations.Inject;
 import org.jboss.cache.factories.annotations.NonVolatile;
 import org.jboss.cache.interceptors.base.CommandInterceptor;

Modified: core/trunk/src/main/java/org/jboss/cache/loader/ClusteredCacheLoader.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/ClusteredCacheLoader.java	2008-07-07 19:52:12 UTC (rev 6196)
+++ core/trunk/src/main/java/org/jboss/cache/loader/ClusteredCacheLoader.java	2008-07-07 20:19:19 UTC (rev 6197)
@@ -15,6 +15,7 @@
 import org.jboss.cache.NodeSPI;
 import org.jboss.cache.RegionManager;
 import org.jboss.cache.ReplicationException;
+import org.jboss.cache.commands.CommandsFactory;
 import org.jboss.cache.commands.DataCommand;
 import org.jboss.cache.commands.read.ExistsCommand;
 import org.jboss.cache.commands.read.GetChildrenNamesCommand;
@@ -22,7 +23,6 @@
 import org.jboss.cache.commands.read.GetKeyValueCommand;
 import org.jboss.cache.commands.remote.ClusteredGetCommand;
 import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
-import org.jboss.cache.factories.CommandsFactory;
 import org.jboss.cache.factories.annotations.Inject;
 import org.jboss.cache.lock.StripedLock;
 import org.jgroups.Address;

Modified: core/trunk/src/main/java/org/jboss/cache/lock/LockUtil.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/lock/LockUtil.java	2008-07-07 19:52:12 UTC (rev 6196)
+++ core/trunk/src/main/java/org/jboss/cache/lock/LockUtil.java	2008-07-07 20:19:19 UTC (rev 6197)
@@ -4,10 +4,9 @@
 import org.apache.commons.logging.LogFactory;
 import org.jboss.cache.Fqn;
 import org.jboss.cache.NodeSPI;
+import org.jboss.cache.commands.CommandsFactory;
 import org.jboss.cache.commands.write.PutDataMapCommand;
-import org.jboss.cache.factories.CommandsFactory;
 import org.jboss.cache.invocation.InvocationContext;
-import org.jboss.cache.statetransfer.StateTransferManager;
 import org.jboss.cache.transaction.GlobalTransaction;
 import org.jboss.cache.transaction.TransactionContext;
 import org.jboss.cache.transaction.TransactionTable;
@@ -21,7 +20,7 @@
 
 public abstract class LockUtil
 {
-   private final static Log log = LogFactory.getLog(StateTransferManager.class);
+   private final static Log log = LogFactory.getLog(LockUtil.class);
    private static final boolean trace = log.isTraceEnabled();
 
    private static interface TransactionLockStatus extends Status

Modified: core/trunk/src/main/java/org/jboss/cache/lock/PessimisticNodeBasedLockManager.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/lock/PessimisticNodeBasedLockManager.java	2008-07-07 19:52:12 UTC (rev 6196)
+++ core/trunk/src/main/java/org/jboss/cache/lock/PessimisticNodeBasedLockManager.java	2008-07-07 20:19:19 UTC (rev 6197)
@@ -4,7 +4,7 @@
 import org.apache.commons.logging.LogFactory;
 import org.jboss.cache.Fqn;
 import org.jboss.cache.NodeSPI;
-import org.jboss.cache.factories.CommandsFactory;
+import org.jboss.cache.commands.CommandsFactory;
 import org.jboss.cache.factories.annotations.Inject;
 import org.jboss.cache.invocation.InvocationContext;
 import static org.jboss.cache.lock.LockType.WRITE;

Modified: core/trunk/src/main/java/org/jboss/cache/marshall/CacheMarshaller200.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/marshall/CacheMarshaller200.java	2008-07-07 19:52:12 UTC (rev 6196)
+++ core/trunk/src/main/java/org/jboss/cache/marshall/CacheMarshaller200.java	2008-07-07 20:19:19 UTC (rev 6197)
@@ -10,8 +10,8 @@
 import org.jboss.cache.Region;
 import static org.jboss.cache.Region.Status;
 import org.jboss.cache.buddyreplication.GravitateResult;
+import org.jboss.cache.commands.CommandsFactory;
 import org.jboss.cache.commands.ReplicableCommand;
-import org.jboss.cache.factories.CommandsFactory;
 import org.jboss.cache.factories.annotations.Inject;
 import org.jboss.cache.optimistic.DefaultDataVersion;
 import org.jboss.cache.transaction.GlobalTransaction;

Modified: core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyManagerTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyManagerTest.java	2008-07-07 19:52:12 UTC (rev 6196)
+++ core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyManagerTest.java	2008-07-07 20:19:19 UTC (rev 6197)
@@ -7,6 +7,7 @@
 package org.jboss.cache.buddyreplication;
 
 import org.jboss.cache.Fqn;
+import org.jboss.cache.commands.CommandsFactoryImpl;
 import org.jboss.cache.commands.ReplicableCommand;
 import org.jboss.cache.commands.remote.ReplicateCommand;
 import org.jboss.cache.commands.write.PutKeyValueCommand;
@@ -14,7 +15,6 @@
 import org.jboss.cache.config.Configuration;
 import org.jboss.cache.config.parsing.XmlConfigHelper;
 import org.jboss.cache.config.parsing.element.BuddyElementParser;
-import org.jboss.cache.factories.CommandsFactoryImpl;
 import static org.testng.AssertJUnit.*;
 import org.testng.annotations.Test;
 import org.w3c.dom.Element;

Modified: core/trunk/src/test/java/org/jboss/cache/interceptors/EvictionInterceptorTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/interceptors/EvictionInterceptorTest.java	2008-07-07 19:52:12 UTC (rev 6196)
+++ core/trunk/src/test/java/org/jboss/cache/interceptors/EvictionInterceptorTest.java	2008-07-07 20:19:19 UTC (rev 6197)
@@ -13,13 +13,13 @@
 import org.jboss.cache.NodeSPI;
 import org.jboss.cache.Region;
 import org.jboss.cache.RegionManager;
-import org.jboss.cache.util.TestingUtil;
+import org.jboss.cache.commands.CommandsFactory;
 import org.jboss.cache.commands.VisitableCommand;
 import org.jboss.cache.commands.read.GetKeyValueCommand;
 import org.jboss.cache.commands.read.GetNodeCommand;
+import org.jboss.cache.commands.write.ClearDataCommand;
 import org.jboss.cache.commands.write.PutDataMapCommand;
 import org.jboss.cache.commands.write.PutKeyValueCommand;
-import org.jboss.cache.commands.write.ClearDataCommand;
 import org.jboss.cache.commands.write.RemoveKeyCommand;
 import org.jboss.cache.commands.write.RemoveNodeCommand;
 import org.jboss.cache.config.EvictionConfig;
@@ -27,8 +27,8 @@
 import org.jboss.cache.eviction.DummyEvictionConfiguration;
 import org.jboss.cache.eviction.EvictedEventNode;
 import org.jboss.cache.eviction.NodeEventType;
-import org.jboss.cache.factories.CommandsFactory;
 import org.jboss.cache.lock.IsolationLevel;
+import org.jboss.cache.util.TestingUtil;
 import static org.testng.AssertJUnit.*;
 import org.testng.annotations.AfterMethod;
 import org.testng.annotations.BeforeMethod;

Modified: core/trunk/src/test/java/org/jboss/cache/marshall/MethodIdPreservationTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/marshall/MethodIdPreservationTest.java	2008-07-07 19:52:12 UTC (rev 6196)
+++ core/trunk/src/test/java/org/jboss/cache/marshall/MethodIdPreservationTest.java	2008-07-07 20:19:19 UTC (rev 6197)
@@ -1,11 +1,11 @@
 package org.jboss.cache.marshall;
 
 import org.jboss.cache.Fqn;
+import org.jboss.cache.commands.CommandsFactory;
+import org.jboss.cache.commands.CommandsFactoryImpl;
 import org.jboss.cache.commands.WriteCommand;
 import org.jboss.cache.commands.tx.PrepareCommand;
 import org.jboss.cache.commands.write.PutDataMapCommand;
-import org.jboss.cache.factories.CommandsFactory;
-import org.jboss.cache.factories.CommandsFactoryImpl;
 import static org.testng.AssertJUnit.assertEquals;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;

Modified: core/trunk/src/test/java/org/jboss/cache/marshall/ReturnValueMarshallingTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/marshall/ReturnValueMarshallingTest.java	2008-07-07 19:52:12 UTC (rev 6196)
+++ core/trunk/src/test/java/org/jboss/cache/marshall/ReturnValueMarshallingTest.java	2008-07-07 20:19:19 UTC (rev 6197)
@@ -5,13 +5,13 @@
 import org.jboss.cache.Fqn;
 import org.jboss.cache.Region;
 import org.jboss.cache.buddyreplication.GravitateResult;
+import org.jboss.cache.commands.CommandsFactory;
+import org.jboss.cache.commands.CommandsFactoryImpl;
 import org.jboss.cache.commands.DataCommand;
 import org.jboss.cache.commands.read.GetKeyValueCommand;
 import org.jboss.cache.commands.read.GravitateDataCommand;
 import org.jboss.cache.commands.remote.ClusteredGetCommand;
 import org.jboss.cache.config.Configuration;
-import org.jboss.cache.factories.CommandsFactory;
-import org.jboss.cache.factories.CommandsFactoryImpl;
 import org.jboss.cache.util.TestingUtil;
 import static org.testng.AssertJUnit.*;
 import org.testng.annotations.AfterMethod;

Modified: core/trunk/src/test/java/org/jboss/cache/util/TestingUtil.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/util/TestingUtil.java	2008-07-07 19:52:12 UTC (rev 6196)
+++ core/trunk/src/test/java/org/jboss/cache/util/TestingUtil.java	2008-07-07 20:19:19 UTC (rev 6197)
@@ -11,8 +11,8 @@
 import org.jboss.cache.CacheSPI;
 import org.jboss.cache.CacheStatus;
 import org.jboss.cache.Fqn;
+import org.jboss.cache.commands.CommandsFactory;
 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.CommandInterceptor;




More information about the jbosscache-commits mailing list