[jbosscache-commits] JBoss Cache SVN: r6863 - in core/branches/flat/src/main/java/org/jboss/starobrno: commands and 2 other directories.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Wed Oct 8 07:13:45 EDT 2008


Author: manik.surtani at jboss.com
Date: 2008-10-08 07:13:44 -0400 (Wed, 08 Oct 2008)
New Revision: 6863

Added:
   core/branches/flat/src/main/java/org/jboss/starobrno/commands/TransactionBoundaryCommand.java
   core/branches/flat/src/main/java/org/jboss/starobrno/commands/read/GetKeyValueCommand.java
   core/branches/flat/src/main/java/org/jboss/starobrno/commands/read/SizeCommand.java
   core/branches/flat/src/main/java/org/jboss/starobrno/commands/tx/
   core/branches/flat/src/main/java/org/jboss/starobrno/commands/tx/AbstractTransactionBoundaryCommand.java
   core/branches/flat/src/main/java/org/jboss/starobrno/commands/tx/CommitCommand.java
   core/branches/flat/src/main/java/org/jboss/starobrno/commands/tx/PrepareCommand.java
   core/branches/flat/src/main/java/org/jboss/starobrno/commands/tx/RollbackCommand.java
Modified:
   core/branches/flat/src/main/java/org/jboss/starobrno/DataContainer.java
   core/branches/flat/src/main/java/org/jboss/starobrno/UnsortedDataContainer.java
Log:
New commands + data container

Modified: core/branches/flat/src/main/java/org/jboss/starobrno/DataContainer.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/starobrno/DataContainer.java	2008-10-08 10:46:56 UTC (rev 6862)
+++ core/branches/flat/src/main/java/org/jboss/starobrno/DataContainer.java	2008-10-08 11:13:44 UTC (rev 6863)
@@ -39,4 +39,6 @@
    void putEntry(Entry<K, V> entry);
 
    boolean exists(Entry<K, V> entry);
+
+   int size();
 }

Modified: core/branches/flat/src/main/java/org/jboss/starobrno/UnsortedDataContainer.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/starobrno/UnsortedDataContainer.java	2008-10-08 10:46:56 UTC (rev 6862)
+++ core/branches/flat/src/main/java/org/jboss/starobrno/UnsortedDataContainer.java	2008-10-08 11:13:44 UTC (rev 6863)
@@ -21,9 +21,10 @@
  */
 package org.jboss.starobrno;
 
-import java.util.LinkedHashSet;
 import java.util.Map.Entry;
 import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
 
 /**
  * // TODO: crappy and inefficient - but just a placeholder for now.
@@ -33,17 +34,17 @@
  */
 public class UnsortedDataContainer<K, V> implements DataContainer<K, V>
 {
-   Set<Entry<K, V>> entries = new LinkedHashSet<Entry<K, V>>();
+   private final ConcurrentMap<K, V> data = new ConcurrentHashMap<K, V>();
 
    public Set<Entry<K, V>> getEntries()
    {
-      return entries;
+      return data.entrySet();
    }
 
    public Entry<K, V> getEntry(K k)
    {
       if (k == null) throw new NullPointerException("I don't like nulls!");
-      for (Entry<K, V> e : entries)
+      for (Entry<K, V> e : data.entrySet())
       {
          if (k.equals(e.getKey())) return e;
       }
@@ -52,11 +53,16 @@
 
    public void putEntry(Entry<K, V> kvEntry)
    {
-      entries.add(kvEntry);
+      data.put(kvEntry.getKey(), kvEntry.getValue());
    }
 
    public boolean exists(Entry<K, V> kvEntry)
    {
-      return getEntry(kvEntry.getKey()) != null;
+      return data.containsKey(kvEntry.getKey());
    }
+
+   public int size()
+   {
+      return data.size();
+   }
 }

Added: core/branches/flat/src/main/java/org/jboss/starobrno/commands/TransactionBoundaryCommand.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/starobrno/commands/TransactionBoundaryCommand.java	                        (rev 0)
+++ core/branches/flat/src/main/java/org/jboss/starobrno/commands/TransactionBoundaryCommand.java	2008-10-08 11:13:44 UTC (rev 6863)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.starobrno.commands;
+
+import org.jboss.cache.transaction.GlobalTransaction;
+
+/**
+ * // TODO: MANIK: Document this
+ *
+ * @author Manik Surtani (<a href="mailto:manik at jboss.org">manik at jboss.org</a>)
+ * @since 3.0
+ */
+public interface TransactionBoundaryCommand extends ReplicableCommand
+{
+   GlobalTransaction getGlobalTransaction();
+
+   void setGlobalTransaction(GlobalTransaction gtx);
+}

Added: core/branches/flat/src/main/java/org/jboss/starobrno/commands/read/GetKeyValueCommand.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/starobrno/commands/read/GetKeyValueCommand.java	                        (rev 0)
+++ core/branches/flat/src/main/java/org/jboss/starobrno/commands/read/GetKeyValueCommand.java	2008-10-08 11:13:44 UTC (rev 6863)
@@ -0,0 +1,102 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.starobrno.commands.read;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.cache.notifications.Notifier;
+import org.jboss.starobrno.commands.DataCommand;
+import org.jboss.starobrno.commands.Visitor;
+import org.jboss.starobrno.context.InvocationContext;
+import org.jboss.starobrno.mvcc.MVCCEntry;
+
+/**
+ * // TODO: MANIK: Document this
+ *
+ * @author Manik Surtani (<a href="mailto:manik at jboss.org">manik at jboss.org</a>)
+ * @since 3.0
+ */
+public class GetKeyValueCommand implements DataCommand
+{
+   protected Object key;
+   public static final int METHOD_ID = 26;
+   private static final Log log = LogFactory.getLog(GetKeyValueCommand.class);
+   private static final boolean trace = log.isTraceEnabled();
+   private Notifier notifier;
+
+   public GetKeyValueCommand(Object key, Notifier notifier)
+   {
+      this.key = key;
+      this.notifier = notifier;
+   }
+
+   public Object getKey()
+   {
+      return key;
+   }
+
+   public void setKey(Object key)
+   {
+      this.key = key;
+   }
+
+   public Object acceptVisitor(InvocationContext ctx, Visitor visitor) throws Throwable
+   {
+      return null;  //TODO: Autogenerated.  Implement me properly
+   }
+
+   public Object perform(InvocationContext ctx) throws Throwable
+   {
+      MVCCEntry entry = ctx.lookupEntry(key);
+      if (entry == null || entry.isNullEntry())
+      {
+         if (trace) log.trace("Node not found");
+         return null;
+      }
+      if (entry.isDeleted())
+      {
+         if (trace) log.trace("Entry has been deleted and is of type " + entry.getClass().getSimpleName());
+         return null;
+      }
+      // TODO - notifier stuff
+      // notifier.notifyNodeVisited(fqn, true, ctx);
+      Object result = entry.getValue();
+      if (trace) log.trace("Found value " + result);
+//      if (sendNodeEvent) notifier.notifyNodeVisited(fqn, false, ctx);
+      return result;
+   }
+
+   public int getCommandId()
+   {
+      return METHOD_ID;
+   }
+
+   public Object[] getParameters()
+   {
+      return new Object[]{key};
+   }
+
+   public void setParameters(int commandId, Object[] parameters)
+   {
+      this.key = parameters[0];
+   }
+}

Added: core/branches/flat/src/main/java/org/jboss/starobrno/commands/read/SizeCommand.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/starobrno/commands/read/SizeCommand.java	                        (rev 0)
+++ core/branches/flat/src/main/java/org/jboss/starobrno/commands/read/SizeCommand.java	2008-10-08 11:13:44 UTC (rev 6863)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.starobrno.commands.read;
+
+import org.jboss.starobrno.DataContainer;
+import org.jboss.starobrno.commands.VisitableCommand;
+import org.jboss.starobrno.commands.Visitor;
+import org.jboss.starobrno.context.InvocationContext;
+
+/**
+ * // TODO: MANIK: Document this
+ *
+ * @author Manik Surtani (<a href="mailto:manik at jboss.org">manik at jboss.org</a>)
+ * @since 3.0
+ */
+public class SizeCommand implements VisitableCommand
+{
+   private DataContainer container;
+
+   public SizeCommand(DataContainer container)
+   {
+      this.container = container;
+   }
+
+   public Object acceptVisitor(InvocationContext ctx, Visitor visitor) throws Throwable
+   {
+      return null;  //TODO: Autogenerated.  Implement me properly
+   }
+
+   public Object perform(InvocationContext ctx) throws Throwable
+   {
+      return container.size();
+   }
+
+   public int getCommandId()
+   {
+      return 0;  // no-op
+   }
+
+   public Object[] getParameters()
+   {
+      return new Object[0];  // no-op
+   }
+
+   public void setParameters(int commandId, Object[] parameters)
+   {
+      // no-op
+   }
+}

Added: core/branches/flat/src/main/java/org/jboss/starobrno/commands/tx/AbstractTransactionBoundaryCommand.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/starobrno/commands/tx/AbstractTransactionBoundaryCommand.java	                        (rev 0)
+++ core/branches/flat/src/main/java/org/jboss/starobrno/commands/tx/AbstractTransactionBoundaryCommand.java	2008-10-08 11:13:44 UTC (rev 6863)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.starobrno.commands.tx;
+
+import org.jboss.cache.transaction.GlobalTransaction;
+import org.jboss.starobrno.commands.TransactionBoundaryCommand;
+import org.jboss.starobrno.context.InvocationContext;
+
+/**
+ * // TODO: MANIK: Document this
+ *
+ * @author Manik Surtani (<a href="mailto:manik at jboss.org">manik at jboss.org</a>)
+ * @since 3.0
+ */
+public abstract class AbstractTransactionBoundaryCommand implements TransactionBoundaryCommand
+{
+   GlobalTransaction gtx;
+
+   public GlobalTransaction getGlobalTransaction()
+   {
+      return gtx;
+   }
+
+   public void setGlobalTransaction(GlobalTransaction gtx)
+   {
+      this.gtx = gtx;
+   }
+
+   /**
+    * This is a no-op.
+    *
+    * @param ctx
+    * @return
+    * @throws Throwable
+    */
+   public Object perform(InvocationContext ctx) throws Throwable
+   {
+      return null;
+   }
+
+   public Object[] getParameters()
+   {
+      return new Object[]{gtx};
+   }
+
+   public void setParameters(int commandId, Object[] args)
+   {
+      gtx = (GlobalTransaction) args[0];
+   }
+}

Added: core/branches/flat/src/main/java/org/jboss/starobrno/commands/tx/CommitCommand.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/starobrno/commands/tx/CommitCommand.java	                        (rev 0)
+++ core/branches/flat/src/main/java/org/jboss/starobrno/commands/tx/CommitCommand.java	2008-10-08 11:13:44 UTC (rev 6863)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.starobrno.commands.tx;
+
+import org.jboss.cache.transaction.GlobalTransaction;
+import org.jboss.starobrno.commands.Visitor;
+import org.jboss.starobrno.context.InvocationContext;
+
+/**
+ * // TODO: MANIK: Document this
+ *
+ * @author Manik Surtani (<a href="mailto:manik at jboss.org">manik at jboss.org</a>)
+ * @since 3.0
+ */
+public class CommitCommand extends AbstractTransactionBoundaryCommand
+{
+   public static final int METHOD_ID = 11;
+
+   public CommitCommand(GlobalTransaction gtx)
+   {
+      this.gtx = gtx;
+   }
+
+   public CommitCommand()
+   {
+   }
+
+   public Object acceptVisitor(InvocationContext ctx, Visitor visitor) throws Throwable
+   {
+      // TODO - implement me
+      return null;
+//      return visitor.visitCommitCommand(ctx, this);
+   }
+
+   public int getCommandId()
+   {
+      return METHOD_ID;
+   }
+
+}

Added: core/branches/flat/src/main/java/org/jboss/starobrno/commands/tx/PrepareCommand.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/starobrno/commands/tx/PrepareCommand.java	                        (rev 0)
+++ core/branches/flat/src/main/java/org/jboss/starobrno/commands/tx/PrepareCommand.java	2008-10-08 11:13:44 UTC (rev 6863)
@@ -0,0 +1,177 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.starobrno.commands.tx;
+
+import org.jboss.cache.commands.WriteCommand;
+import org.jboss.cache.transaction.GlobalTransaction;
+import org.jboss.starobrno.commands.ReplicableCommand;
+import org.jboss.starobrno.commands.Visitor;
+import org.jboss.starobrno.context.InvocationContext;
+import org.jgroups.Address;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * // TODO: MANIK: Document this
+ *
+ * @author Manik Surtani (<a href="mailto:manik at jboss.org">manik at jboss.org</a>)
+ * @since 3.0
+ */
+public class PrepareCommand extends AbstractTransactionBoundaryCommand
+{
+   public static final int METHOD_ID = 10;
+
+   protected List<ReplicableCommand> modifications;
+   protected Address localAddress;
+   protected boolean onePhaseCommit;
+
+   public PrepareCommand(GlobalTransaction gtx, List<ReplicableCommand> modifications, Address localAddress, boolean onePhaseCommit)
+   {
+      this.gtx = gtx;
+      this.modifications = modifications;
+      this.localAddress = localAddress;
+      this.onePhaseCommit = onePhaseCommit;
+   }
+
+   public void removeModifications(Collection<WriteCommand> modificationsToRemove)
+   {
+      if (modifications != null) modifications.removeAll(modificationsToRemove);
+   }
+
+   public PrepareCommand()
+   {
+   }
+
+   public Object acceptVisitor(InvocationContext ctx, Visitor visitor) throws Throwable
+   {
+      // TODO - implement me
+      return null;
+//      return visitor.visitPrepareCommand(ctx, this);
+   }
+
+   public List<ReplicableCommand> getModifications()
+   {
+      return modifications;
+   }
+
+   public Address getLocalAddress()
+   {
+      return localAddress;
+   }
+
+   public boolean isOnePhaseCommit()
+   {
+      return onePhaseCommit;
+   }
+
+   public boolean existModifications()
+   {
+      return modifications != null && modifications.size() > 0;
+   }
+
+   public int getModificationsCount()
+   {
+      return modifications != null ? modifications.size() : 0;
+   }
+
+   public int getCommandId()
+   {
+      return METHOD_ID;
+   }
+
+   @Override
+   public Object[] getParameters()
+   {
+      return new Object[]{gtx, modifications, localAddress, onePhaseCommit};
+   }
+
+   @Override
+   @SuppressWarnings("unchecked")
+   public void setParameters(int commandId, Object[] args)
+   {
+      gtx = (GlobalTransaction) args[0];
+      modifications = (List<ReplicableCommand>) args[1];
+      localAddress = (Address) args[2];
+      onePhaseCommit = (Boolean) args[3];
+   }
+
+   @Override
+   public boolean equals(Object o)
+   {
+      if (this == o) return true;
+      if (o == null || getClass() != o.getClass()) return false;
+      if (!super.equals(o)) return false;
+
+      PrepareCommand that = (PrepareCommand) o;
+
+      if (onePhaseCommit != that.onePhaseCommit) return false;
+      if (localAddress != null ? !localAddress.equals(that.localAddress) : that.localAddress != null) return false;
+      if (modifications != null ? !modifications.equals(that.modifications) : that.modifications != null) return false;
+
+      return true;
+   }
+
+   @Override
+   public int hashCode()
+   {
+      int result = super.hashCode();
+      result = 31 * result + (modifications != null ? modifications.hashCode() : 0);
+      result = 31 * result + (localAddress != null ? localAddress.hashCode() : 0);
+      result = 31 * result + (onePhaseCommit ? 1 : 0);
+      return result;
+   }
+
+   public PrepareCommand copy()
+   {
+      PrepareCommand copy = new PrepareCommand();
+      copy.gtx = gtx;
+      copy.localAddress = localAddress;
+      copy.modifications = modifications == null ? null : new ArrayList<ReplicableCommand>(modifications);
+      copy.onePhaseCommit = onePhaseCommit;
+      return copy;
+   }
+
+   @Override
+   public String toString()
+   {
+      return "PrepareCommand{" +
+            "globalTransaction=" + gtx +
+            ", modifications=" + modifications +
+            ", localAddress=" + localAddress +
+            ", onePhaseCommit=" + onePhaseCommit +
+            '}';
+   }
+
+   public boolean containsModificationType(Class<? extends ReplicableCommand> replicableCommandClass)
+   {
+      for (ReplicableCommand mod : getModifications())
+      {
+         if (mod.getClass().equals(replicableCommandClass))
+         {
+            return true;
+         }
+      }
+      return false;
+   }
+}

Added: core/branches/flat/src/main/java/org/jboss/starobrno/commands/tx/RollbackCommand.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/starobrno/commands/tx/RollbackCommand.java	                        (rev 0)
+++ core/branches/flat/src/main/java/org/jboss/starobrno/commands/tx/RollbackCommand.java	2008-10-08 11:13:44 UTC (rev 6863)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.starobrno.commands.tx;
+
+import org.jboss.cache.transaction.GlobalTransaction;
+import org.jboss.starobrno.commands.Visitor;
+import org.jboss.starobrno.context.InvocationContext;
+
+/**
+ * // TODO: MANIK: Document this
+ *
+ * @author Manik Surtani (<a href="mailto:manik at jboss.org">manik at jboss.org</a>)
+ * @since 3.0
+ */
+public class RollbackCommand extends AbstractTransactionBoundaryCommand
+{
+   public static final int METHOD_ID = 12;
+
+   public RollbackCommand(GlobalTransaction globalTransaction)
+   {
+      this.gtx = globalTransaction;
+   }
+
+   public RollbackCommand()
+   {
+   }
+
+   public Object acceptVisitor(InvocationContext ctx, Visitor visitor) throws Throwable
+   {
+      // TODO - implement me
+      return null;
+//      return visitor.visitRollbackCommand(ctx, this);
+   }
+
+   public int getCommandId()
+   {
+      return METHOD_ID;
+   }
+
+}




More information about the jbosscache-commits mailing list