[jbosscache-commits] JBoss Cache SVN: r6477 - core/trunk/src/main/java/org/jboss/cache/commands.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Fri Aug 1 04:39:16 EDT 2008


Author: manik.surtani at jboss.com
Date: 2008-08-01 04:39:15 -0400 (Fri, 01 Aug 2008)
New Revision: 6477

Modified:
   core/trunk/src/main/java/org/jboss/cache/commands/OptimisticCommandsFactoryImpl.java
   core/trunk/src/main/java/org/jboss/cache/commands/PessimisticCommandsFactoryImpl.java
Log:
added createNodeCommand for opt locking
deprecated opt commands factory

Modified: core/trunk/src/main/java/org/jboss/cache/commands/OptimisticCommandsFactoryImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/OptimisticCommandsFactoryImpl.java	2008-07-31 18:08:14 UTC (rev 6476)
+++ core/trunk/src/main/java/org/jboss/cache/commands/OptimisticCommandsFactoryImpl.java	2008-08-01 08:39:15 UTC (rev 6477)
@@ -2,6 +2,7 @@
 
 import org.jboss.cache.Fqn;
 import org.jboss.cache.commands.legacy.read.LegacyGravitateDataCommand;
+import org.jboss.cache.commands.legacy.write.CreateNodeCommand;
 import org.jboss.cache.commands.legacy.write.LegacyEvictCommand;
 import org.jboss.cache.commands.legacy.write.VersionedInvalidateCommand;
 import org.jboss.cache.commands.read.GravitateDataCommand;
@@ -13,7 +14,10 @@
  *
  * @author Manik Surtani (<a href="mailto:manik at jboss.org">manik at jboss.org</a>)
  * @since 3.0
+ * @deprecated will be removed with opt locking
  */
+ at Deprecated
+ at SuppressWarnings("deprecation")
 public class OptimisticCommandsFactoryImpl extends CommandsFactoryImpl
 {
    @Override
@@ -42,12 +46,28 @@
    }
 
    @Override
+   public CreateNodeCommand buildCreateNodeCommand(Fqn fqn)
+   {
+      CreateNodeCommand command = new CreateNodeCommand(fqn);
+      command.initialize(dataContainer);
+      return command;
+   }
+
+
+   @Override
    public ReplicableCommand fromStream(int id, Object[] parameters)
    {
       ReplicableCommand command;
       boolean skipSetParams = false;
       switch (id)
       {
+         case CreateNodeCommand.METHOD_ID:
+         {
+            CreateNodeCommand returnValue = new CreateNodeCommand(null);
+            returnValue.initialize(dataContainer);
+            command = returnValue;
+            break;
+         }
          case GravitateDataCommand.METHOD_ID:
          {
             LegacyGravitateDataCommand returnValue = new LegacyGravitateDataCommand(rpcManager.getLocalAddress());

Modified: core/trunk/src/main/java/org/jboss/cache/commands/PessimisticCommandsFactoryImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/PessimisticCommandsFactoryImpl.java	2008-07-31 18:08:14 UTC (rev 6476)
+++ core/trunk/src/main/java/org/jboss/cache/commands/PessimisticCommandsFactoryImpl.java	2008-08-01 08:39:15 UTC (rev 6477)
@@ -2,7 +2,6 @@
 
 import org.jboss.cache.Fqn;
 import org.jboss.cache.commands.legacy.read.PessGetChildrenNamesCommand;
-import org.jboss.cache.commands.legacy.write.CreateNodeCommand;
 import org.jboss.cache.commands.legacy.write.PessClearDataCommand;
 import org.jboss.cache.commands.legacy.write.PessMoveCommand;
 import org.jboss.cache.commands.legacy.write.PessPutDataMapCommand;
@@ -30,7 +29,10 @@
  * @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
+ * @deprecated will be removed with possimistic locking
  */
+ at Deprecated
+ at SuppressWarnings("deprecation")
 public class PessimisticCommandsFactoryImpl extends OptimisticCommandsFactoryImpl
 {
    @Override
@@ -98,14 +100,6 @@
    }
 
    @Override
-   public CreateNodeCommand buildCreateNodeCommand(Fqn fqn)
-   {
-      CreateNodeCommand command = new CreateNodeCommand(fqn);
-      command.initialize(dataContainer);
-      return command;
-   }
-
-   @Override
    public InvalidateCommand buildInvalidateCommand(Fqn fqn)
    {
       InvalidateCommand command = new InvalidateCommand(fqn);
@@ -185,13 +179,6 @@
             command = returnValue;
             break;
          }
-         case CreateNodeCommand.METHOD_ID:
-         {
-            CreateNodeCommand returnValue = new CreateNodeCommand(null);
-            returnValue.initialize(dataContainer);
-            command = returnValue;
-            break;
-         }
          case InvalidateCommand.METHOD_ID:
          {
             InvalidateCommand returnValue = new InvalidateCommand(null);




More information about the jbosscache-commits mailing list