[jbosscache-commits] JBoss Cache SVN: r6867 - core/branches/flat/src/main/java/org/jboss/starobrno/commands/read.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Wed Oct 8 07:30:17 EDT 2008


Author: mircea.markus
Date: 2008-10-08 07:30:17 -0400 (Wed, 08 Oct 2008)
New Revision: 6867

Added:
   core/branches/flat/src/main/java/org/jboss/starobrno/commands/read/AbstractDataCommand.java
Log:
  _____  ____     ____
 \/__/\ \ \ \L\ \\ \ \/\_\
    _\ \ \ \  _ <'\ \ \/_/_
   /\ \_\ \ \ \L\ \\ \ \L\ \
   \ \____/\ \____/ \ \____/
    \/___/  \/___/   \/___/

Added: core/branches/flat/src/main/java/org/jboss/starobrno/commands/read/AbstractDataCommand.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/starobrno/commands/read/AbstractDataCommand.java	                        (rev 0)
+++ core/branches/flat/src/main/java/org/jboss/starobrno/commands/read/AbstractDataCommand.java	2008-10-08 11:30:17 UTC (rev 6867)
@@ -0,0 +1,62 @@
+/*
+ * 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.commands.DataCommand;
+
+/**
+ * @author Mircea.Markus at jboss.com
+ */
+public abstract class AbstractDataCommand implements DataCommand
+{
+   protected Object key;
+
+   public Object getKey()
+   {
+      return key;
+   }
+
+   public void setKey(Object key)
+   {
+      this.key = key;
+   }
+
+   protected AbstractDataCommand(Object key)
+   {
+      this.key = key;
+   }
+
+   protected AbstractDataCommand()
+   {
+   }
+
+   public void setParameters(int commandId, Object[] parameters)
+   {
+      if (commandId != getCommandId()) throw new IllegalStateException("Invalid method id");
+      key = parameters[0];
+   }
+
+   public Object[] getParameters()
+   {
+      return new Object[]{key};
+   }
+}




More information about the jbosscache-commits mailing list