[infinispan-commits] Infinispan SVN: r1558 - in trunk/server: hotrod/src/main/scala/org/infinispan/server/hotrod and 3 other directories.

infinispan-commits at lists.jboss.org infinispan-commits at lists.jboss.org
Fri Feb 26 13:24:38 EST 2010


Author: galder.zamarreno at jboss.com
Date: 2010-02-26 13:24:37 -0500 (Fri, 26 Feb 2010)
New Revision: 1558

Added:
   trunk/server/core/src/main/java/org/infinispan/server/core/UnknownCommandException.java
Removed:
   trunk/server/memcached/src/main/java/org/infinispan/server/memcached/UnknownCommandException.java
Modified:
   trunk/server/hotrod/src/main/scala/org/infinispan/server/hotrod/Decoder410.scala
   trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/CommandType.java
   trunk/server/memcached/src/main/java/org/infinispan/server/memcached/transport/TextDecoder.java
Log:
[ISPN-171] (Build a server module based on the HotRod protocol) Move exception class to server core so that it can be used by both hotrod and memcached.

Copied: trunk/server/core/src/main/java/org/infinispan/server/core/UnknownCommandException.java (from rev 1545, trunk/server/memcached/src/main/java/org/infinispan/server/memcached/UnknownCommandException.java)
===================================================================
--- trunk/server/core/src/main/java/org/infinispan/server/core/UnknownCommandException.java	                        (rev 0)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/UnknownCommandException.java	2010-02-26 18:24:37 UTC (rev 1558)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and
+ * individual contributors as indicated by the @author tags. See the
+ * copyright.txt file 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.infinispan.server.core;
+
+import java.io.StreamCorruptedException;
+
+/**
+ * UnknownCommandException.
+ * 
+ * @author Galder Zamarreño
+ * @since 4.1
+ */
+public class UnknownCommandException extends StreamCorruptedException {
+
+   /** The serialVersionUID */
+   private static final long serialVersionUID = 7677317727970191637L;
+
+   public UnknownCommandException() {
+      super();
+   }
+
+   public UnknownCommandException(String reason) {
+      super(reason);
+   }
+
+}

Modified: trunk/server/hotrod/src/main/scala/org/infinispan/server/hotrod/Decoder410.scala
===================================================================
--- trunk/server/hotrod/src/main/scala/org/infinispan/server/hotrod/Decoder410.scala	2010-02-26 18:20:47 UTC (rev 1557)
+++ trunk/server/hotrod/src/main/scala/org/infinispan/server/hotrod/Decoder410.scala	2010-02-26 18:24:37 UTC (rev 1558)
@@ -1,6 +1,7 @@
 package org.infinispan.server.hotrod
 
 import org.infinispan.server.core.transport.{ExceptionEvent, ChannelHandlerContext, ChannelBuffer, Decoder}
+import org.infinispan.server.core.UnknownCommandException
 
 /**
  * // TODO: Document this
@@ -30,7 +31,7 @@
                   (cache: Cache, command: StorageCommand) => cache.put(command)
                })
             }
-            case _ => throw new RuntimeException("Unknown command")// TODO: Changed to unknown command exception
+            case _ => throw new UnknownCommandException("Command " + op + " not known")
          }
       command
    }

Deleted: trunk/server/memcached/src/main/java/org/infinispan/server/memcached/UnknownCommandException.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/memcached/UnknownCommandException.java	2010-02-26 18:20:47 UTC (rev 1557)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/UnknownCommandException.java	2010-02-26 18:24:37 UTC (rev 1558)
@@ -1,46 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat, Inc. and/or its affiliates, and
- * individual contributors as indicated by the @author tags. See the
- * copyright.txt file 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.infinispan.server.memcached;
-
-import java.io.StreamCorruptedException;
-
-/**
- * UnknownCommandException.
- * 
- * @author Galder Zamarreño
- * @since 4.1
- */
-public class UnknownCommandException extends StreamCorruptedException {
-
-   /** The serialVersionUID */
-   private static final long serialVersionUID = 7677317727970191637L;
-
-   public UnknownCommandException() {
-      super();
-   }
-
-   public UnknownCommandException(String reason) {
-      super(reason);
-   }
-
-}

Modified: trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/CommandType.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/CommandType.java	2010-02-26 18:20:47 UTC (rev 1557)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/CommandType.java	2010-02-26 18:24:37 UTC (rev 1558)
@@ -24,7 +24,7 @@
 
 import java.io.IOException;
 
-import org.infinispan.server.memcached.UnknownCommandException;
+import org.infinispan.server.core.UnknownCommandException;
 
 /**
  * Command.

Modified: trunk/server/memcached/src/main/java/org/infinispan/server/memcached/transport/TextDecoder.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/memcached/transport/TextDecoder.java	2010-02-26 18:20:47 UTC (rev 1557)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/transport/TextDecoder.java	2010-02-26 18:24:37 UTC (rev 1558)
@@ -33,7 +33,7 @@
 import org.infinispan.server.core.transport.Decoder;
 import org.infinispan.server.core.transport.ExceptionEvent;
 import org.infinispan.server.memcached.Reply;
-import org.infinispan.server.memcached.UnknownCommandException;
+import org.infinispan.server.core.UnknownCommandException;
 import org.infinispan.server.memcached.commands.CommandFactory;
 import org.infinispan.server.memcached.commands.StorageCommand;
 import org.infinispan.server.memcached.commands.TextCommand;



More information about the infinispan-commits mailing list