[infinispan-commits] Infinispan SVN: r1586 - in trunk: server/core/src/main/java/org/infinispan/server/core/transport and 8 other directories.
infinispan-commits at lists.jboss.org
infinispan-commits at lists.jboss.org
Wed Mar 10 09:01:26 EST 2010
Author: galder.zamarreno at jboss.com
Date: 2010-03-10 09:01:23 -0500 (Wed, 10 Mar 2010)
New Revision: 1586
Added:
trunk/server/core/src/main/java/org/infinispan/server/core/transport/ChannelEvent.java
trunk/server/core/src/main/java/org/infinispan/server/core/transport/CommandHandler.java
trunk/server/core/src/main/java/org/infinispan/server/core/transport/MessageEvent.java
trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyChannelEvent.java
trunk/server/memcached/src/main/java/org/infinispan/server/memcached/Command.java
trunk/server/memcached/src/main/java/org/infinispan/server/memcached/CommandFactory.java
trunk/server/memcached/src/main/java/org/infinispan/server/memcached/CommandInterceptor.java
trunk/server/memcached/src/main/java/org/infinispan/server/memcached/InterceptorChain.java
trunk/server/memcached/src/main/java/org/infinispan/server/memcached/InterceptorChainFactory.java
Removed:
trunk/server/core/src/main/java/org/infinispan/server/core/Command.java
trunk/server/core/src/main/java/org/infinispan/server/core/CommandFactory.java
trunk/server/core/src/main/java/org/infinispan/server/core/CommandHandler.java
trunk/server/core/src/main/java/org/infinispan/server/core/CommandInterceptor.java
trunk/server/core/src/main/java/org/infinispan/server/core/InterceptorChain.java
trunk/server/core/src/main/java/org/infinispan/server/core/InterceptorChainFactory.java
trunk/server/core/src/main/java/org/infinispan/server/core/MessageEvent.java
trunk/server/memcached/src/main/resources/memcached.bat
trunk/server/memcached/src/main/resources/memcached.sh
Modified:
trunk/server/core/src/main/java/org/infinispan/server/core/Main.java
trunk/server/core/src/main/java/org/infinispan/server/core/transport/ChannelHandlerContext.java
trunk/server/core/src/main/java/org/infinispan/server/core/transport/ExceptionEvent.java
trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyChannel.java
trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyChannelFuture.java
trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyChannelHandlerContext.java
trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyChannelUpstreamHandler.java
trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyExceptionEvent.java
trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyMessageEvent.java
trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyServer.java
trunk/server/core/src/main/resources/startServer.bat
trunk/server/core/src/main/resources/startServer.sh
trunk/server/memcached/src/main/java/org/infinispan/server/memcached/TextServer.java
trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/CasCommand.java
trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/CommandFactory.java
trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/MemcachedStatsImpl.java
trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/StatsCommand.java
trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/StorageCommand.java
trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/TextCommand.java
trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/TextCommandHandler.java
trunk/server/memcached/src/main/java/org/infinispan/server/memcached/interceptors/TextCommandInterceptor.java
trunk/server/memcached/src/main/java/org/infinispan/server/memcached/interceptors/TextCommandInterceptorImpl.java
trunk/server/memcached/src/main/java/org/infinispan/server/memcached/interceptors/TextProtocolInterceptorChain.java
trunk/server/memcached/src/main/java/org/infinispan/server/memcached/interceptors/TextProtocolInterceptorChainFactory.java
trunk/server/memcached/src/main/java/org/infinispan/server/memcached/transport/TextDecoder.java
trunk/src/main/resources/assemblies/all.xml
Log:
[ISPN-353] (Add a single shell script to handle cache server startup) Fixed startServer.sh/bat scripts and removed old memcached.* scripts.
- Sorted out server/core module assembly.
- Refactored classes only used by memcached into this module.
Deleted: trunk/server/core/src/main/java/org/infinispan/server/core/Command.java
===================================================================
--- trunk/server/core/src/main/java/org/infinispan/server/core/Command.java 2010-03-10 14:00:25 UTC (rev 1585)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/Command.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -1,37 +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.core;
-
-import org.infinispan.server.core.transport.ChannelHandlerContext;
-
-/**
- * Command.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
-public interface Command {
-
- Object perform(ChannelHandlerContext ctx) throws Throwable;
-
-}
Deleted: trunk/server/core/src/main/java/org/infinispan/server/core/CommandFactory.java
===================================================================
--- trunk/server/core/src/main/java/org/infinispan/server/core/CommandFactory.java 2010-03-10 14:00:25 UTC (rev 1585)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/CommandFactory.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -1,35 +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.core;
-
-import java.io.IOException;
-
-/**
- * TODO: This only deals with text based protocols, needs further thought. Will be looked into when implementing Hot Rod
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
-public interface CommandFactory {
- Command createCommand(String line) throws IOException;
-}
Deleted: trunk/server/core/src/main/java/org/infinispan/server/core/CommandHandler.java
===================================================================
--- trunk/server/core/src/main/java/org/infinispan/server/core/CommandHandler.java 2010-03-10 14:00:25 UTC (rev 1585)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/CommandHandler.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -1,35 +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.core;
-
-import org.infinispan.server.core.transport.ChannelHandlerContext;
-
-/**
- * CommandHandler.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
-public interface CommandHandler {
- void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Throwable;
-}
Deleted: trunk/server/core/src/main/java/org/infinispan/server/core/CommandInterceptor.java
===================================================================
--- trunk/server/core/src/main/java/org/infinispan/server/core/CommandInterceptor.java 2010-03-10 14:00:25 UTC (rev 1585)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/CommandInterceptor.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -1,33 +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.core;
-
-/**
- * CommandInterceptor.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
-public interface CommandInterceptor {
- CommandInterceptor getNext();
-}
Deleted: trunk/server/core/src/main/java/org/infinispan/server/core/InterceptorChain.java
===================================================================
--- trunk/server/core/src/main/java/org/infinispan/server/core/InterceptorChain.java 2010-03-10 14:00:25 UTC (rev 1585)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/InterceptorChain.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -1,38 +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.core;
-
-import org.infinispan.server.core.transport.ChannelHandlerContext;
-
-import java.util.List;
-
-/**
- * InterceptorChain.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
-public interface InterceptorChain {
- Object invoke(ChannelHandlerContext ctx, Command command) throws Throwable;
- List<CommandInterceptor> getInterceptorsWhichExtend(Class<? extends CommandInterceptor> interceptorClass);
-}
Deleted: trunk/server/core/src/main/java/org/infinispan/server/core/InterceptorChainFactory.java
===================================================================
--- trunk/server/core/src/main/java/org/infinispan/server/core/InterceptorChainFactory.java 2010-03-10 14:00:25 UTC (rev 1585)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/InterceptorChainFactory.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -1,33 +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.core;
-
-/**
- * InterceptorChainFactory.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
-public interface InterceptorChainFactory {
- InterceptorChain buildInterceptorChain();
-}
Modified: trunk/server/core/src/main/java/org/infinispan/server/core/Main.java
===================================================================
--- trunk/server/core/src/main/java/org/infinispan/server/core/Main.java 2010-03-10 14:00:25 UTC (rev 1585)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/Main.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -62,6 +62,8 @@
public static final int MASTER_THREADS_DEFAULT = 0;
public static final int WORKER_THREADS_DEFAULT = 0;
+ private static String programName;
+
/**
* Server properties. This object holds all of the required
* information to get the server up and running. Use System
@@ -101,7 +103,11 @@
String configFile = props.get(PROP_KEY_CACHE_CONFIG);
String protocol = props.get(PROP_KEY_PROTOCOL);
- Protocol p = protocol == null ? Protocol.HOTROD : Protocol.valueOf(protocol.toUpperCase());
+ if (protocol == null) {
+ System.err.println("ERROR: Please indicate protocol to run with -r parameter");
+ showAndExit();
+ }
+ Protocol p = Protocol.valueOf(protocol.toUpperCase());
server = (ProtocolServer) Util.getInstance(p.clazz);
addShutdownHook(new ShutdownHook(server)); // Make a shutdown hook
server.start(host, port, configFile, masterThreads, workerThreads);
@@ -109,7 +115,7 @@
private void processCommandLine(String[] args) throws Exception {
// set this from a system property or default to jboss
- String programName = System.getProperty("program.name", "InfinispanServer");
+ programName = System.getProperty("program.name", "startServer");
// TODO: Since this memcached/hotrod implementation stores stuff as byte[], these could be implemented in the future:
// -m <num> max memory to use for items in megabytes (default: 64 MB)
// -M return error on memory exhausted (rather than removing items)
@@ -142,21 +148,7 @@
break; // for completeness
case 'h' :
// show command line help
- System.out.println("usage: " + programName + " [options]");
- System.out.println();
- System.out.println("options:");
- System.out.println(" -h, --help Show this help message");
- System.out.println(" -V, --version Show version information");
- System.out.println(" -- Stop processing options");
- System.out.println(" -p, --port=<num> TCP port number to listen on (default: 11211)");
- System.out.println(" -l, --host=<host or ip> Interface to listen on (default: 127.0.0.1, localhost)");
- System.out.println(" -m, --master_threads=<num> Number of threads accepting incoming connections (default: unlimited while resources are available)");
- System.out.println(" -t, --work_threads=<num> Number of threads processing incoming requests and sending responses (default: unlimited while resources are available)");
- System.out.println(" -c, --cache_config=<filename> Cache configuration file (default: creates cache with default values)");
- System.out.println(" -r, --protocol=[memcached|hotrod] Protocol to understand by the server. Choose one of the two options");
- System.out.println(" -D<name>[=<value>] Set a system property");
- System.out.println();
- System.exit(0);
+ showAndExit();
break; // for completeness
case 'V' :
Version.printFullVersionInformation();
@@ -222,7 +214,7 @@
Future<Void> f = Executors.newSingleThreadScheduledExecutor(new ThreadFactory() {
@Override
public Thread newThread(Runnable r) {
- return new Thread(r, System.getProperty("program.name") + "-main");
+ return new Thread(r, "InfinispanServer-Main");
}
}).submit(worker);
@@ -234,7 +226,7 @@
*
* @param shutdownHook
*/
- static void addShutdownHook(final Thread shutdownHook) {
+ private static void addShutdownHook(final Thread shutdownHook) {
AccessController.doPrivileged(new PrivilegedAction<Void>() {
public Void run() {
Runtime.getRuntime().addShutdownHook(shutdownHook);
@@ -243,6 +235,24 @@
});
}
+ private static void showAndExit() {
+ System.out.println("usage: " + programName + " [options]");
+ System.out.println();
+ System.out.println("options:");
+ System.out.println(" -h, --help Show this help message");
+ System.out.println(" -V, --version Show version information");
+ System.out.println(" -- Stop processing options");
+ System.out.println(" -p, --port=<num> TCP port number to listen on (default: 11211)");
+ System.out.println(" -l, --host=<host or ip> Interface to listen on (default: 127.0.0.1, localhost)");
+ System.out.println(" -m, --master_threads=<num> Number of threads accepting incoming connections (default: unlimited while resources are available)");
+ System.out.println(" -t, --work_threads=<num> Number of threads processing incoming requests and sending responses (default: unlimited while resources are available)");
+ System.out.println(" -c, --cache_config=<filename> Cache configuration file (default: creates cache with default values)");
+ System.out.println(" -r, --protocol=[memcached|hotrod] Protocol to understand by the server. This is a mandatory option and you should choose one of the two options");
+ System.out.println(" -D<name>[=<value>] Set a system property");
+ System.out.println();
+ System.exit(0);
+ }
+
/**
* ShutdownHook
*/
Deleted: trunk/server/core/src/main/java/org/infinispan/server/core/MessageEvent.java
===================================================================
--- trunk/server/core/src/main/java/org/infinispan/server/core/MessageEvent.java 2010-03-10 14:00:25 UTC (rev 1585)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/MessageEvent.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -1,39 +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.core;
-
-import org.infinispan.server.core.transport.Channel;
-
-import java.net.SocketAddress;
-
-/**
- * MessageEvent.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
-public interface MessageEvent {
- Object getMessage();
- SocketAddress getRemoteAddress();
- Channel getChannel();
-}
Added: trunk/server/core/src/main/java/org/infinispan/server/core/transport/ChannelEvent.java
===================================================================
--- trunk/server/core/src/main/java/org/infinispan/server/core/transport/ChannelEvent.java (rev 0)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/transport/ChannelEvent.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.transport;
+
+
+/**
+ * // TODO: Document this
+ *
+ * @author Galder Zamarreño
+ */
+public interface ChannelEvent {
+ Channel getChannel();
+ ChannelFuture getFuture();
+}
Modified: trunk/server/core/src/main/java/org/infinispan/server/core/transport/ChannelHandlerContext.java
===================================================================
--- trunk/server/core/src/main/java/org/infinispan/server/core/transport/ChannelHandlerContext.java 2010-03-10 14:00:25 UTC (rev 1585)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/transport/ChannelHandlerContext.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -31,4 +31,6 @@
public interface ChannelHandlerContext {
Channel getChannel();
ChannelBuffers getChannelBuffers();
+// void sendDownstream(ChannelEvent e);
+// MessageEvent createMessageEvent(Object message);
}
Copied: trunk/server/core/src/main/java/org/infinispan/server/core/transport/CommandHandler.java (from rev 1582, trunk/server/core/src/main/java/org/infinispan/server/core/CommandHandler.java)
===================================================================
--- trunk/server/core/src/main/java/org/infinispan/server/core/transport/CommandHandler.java (rev 0)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/transport/CommandHandler.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.transport;
+
+import org.infinispan.server.core.transport.ChannelHandlerContext;
+import org.infinispan.server.core.transport.MessageEvent;
+
+/**
+ * CommandHandler.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+public interface CommandHandler {
+ void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Throwable;
+}
Modified: trunk/server/core/src/main/java/org/infinispan/server/core/transport/ExceptionEvent.java
===================================================================
--- trunk/server/core/src/main/java/org/infinispan/server/core/transport/ExceptionEvent.java 2010-03-10 14:00:25 UTC (rev 1585)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/transport/ExceptionEvent.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -29,6 +29,6 @@
* @author Galder Zamarreño
* @since 4.0
*/
-public interface ExceptionEvent {
+public interface ExceptionEvent extends ChannelEvent {
Throwable getCause();
}
Copied: trunk/server/core/src/main/java/org/infinispan/server/core/transport/MessageEvent.java (from rev 1581, trunk/server/core/src/main/java/org/infinispan/server/core/MessageEvent.java)
===================================================================
--- trunk/server/core/src/main/java/org/infinispan/server/core/transport/MessageEvent.java (rev 0)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/transport/MessageEvent.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -0,0 +1,39 @@
+/*
+ * 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.transport;
+
+import org.infinispan.server.core.transport.Channel;
+import org.infinispan.server.core.transport.ChannelEvent;
+
+import java.net.SocketAddress;
+
+/**
+ * MessageEvent.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+public interface MessageEvent extends ChannelEvent {
+ Object getMessage();
+ SocketAddress getRemoteAddress();
+}
Modified: trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyChannel.java
===================================================================
--- trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyChannel.java 2010-03-10 14:00:25 UTC (rev 1585)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyChannel.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -41,18 +41,16 @@
@Override
public ChannelFuture disconnect() {
- return new NettyChannelFuture(ch.disconnect(), this);
+ return new NettyChannelFuture(ch.disconnect());
}
@Override
public ChannelFuture write(Object message) {
if (message instanceof ChannelBuffer) {
// If we get an Infinispan channel buffer abstraction, convert it to something netty can understand
-// message = new NettyChannelBufferAdapter((NettyChannelBuffer) message);
message = ((ChannelBuffer) message).getUnderlyingChannelBuffer();
-// message = ((NettyChannelBuffer) message).nettyBuffer;
}
- return new NettyChannelFuture(ch.write(message), this);
+ return new NettyChannelFuture(ch.write(message));
}
@Override
Added: trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyChannelEvent.java
===================================================================
--- trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyChannelEvent.java (rev 0)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyChannelEvent.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.transport.netty;
+
+import org.infinispan.server.core.transport.Channel;
+import org.infinispan.server.core.transport.ChannelEvent;
+import org.infinispan.server.core.transport.ChannelFuture;
+
+/**
+ * // TODO: Document this
+ *
+ * @author Galder Zamarreño
+ */
+public class NettyChannelEvent implements ChannelEvent {
+
+ final org.jboss.netty.channel.ChannelEvent event;
+
+ NettyChannelEvent(org.jboss.netty.channel.ChannelEvent event) {
+ this.event = event;
+ }
+
+ @Override
+ public Channel getChannel() {
+ return new NettyChannel(event.getChannel());
+ }
+
+ @Override
+ public ChannelFuture getFuture() {
+ return new NettyChannelFuture(event.getFuture());
+ }
+
+}
Modified: trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyChannelFuture.java
===================================================================
--- trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyChannelFuture.java 2010-03-10 14:00:25 UTC (rev 1585)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyChannelFuture.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -35,11 +35,9 @@
*/
public class NettyChannelFuture implements ChannelFuture {
final org.jboss.netty.channel.ChannelFuture future;
- final Channel ch;
- public NettyChannelFuture(org.jboss.netty.channel.ChannelFuture future, Channel ch) {
+ public NettyChannelFuture(org.jboss.netty.channel.ChannelFuture future) {
this.future = future;
- this.ch = ch;
}
@Override
@@ -76,7 +74,7 @@
@Override
public Channel getChannel() {
- return ch;
+ return new NettyChannel(future.getChannel());
}
@Override
Modified: trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyChannelHandlerContext.java
===================================================================
--- trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyChannelHandlerContext.java 2010-03-10 14:00:25 UTC (rev 1585)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyChannelHandlerContext.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -46,7 +46,22 @@
return ch;
}
+ @Override
public ChannelBuffers getChannelBuffers() {
return NettyChannelBuffers.getInstance();
}
+
+// @Override
+// public void sendDownstream(ChannelEvent e) {
+// ctx.sendDownstream(((NettyChannelEvent)e).event);
+// }
+//
+// @Override
+// public MessageEvent createMessageEvent(Object message) {
+// org.jboss.netty.channel.Channel ch = ctx.getChannel();
+// DownstreamMessageEvent event = new DownstreamMessageEvent(ch, Channels.future(ch), message, ch.getLocalAddress());
+// return new NettyMessageEvent(event);
+// }
+
+
}
Modified: trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyChannelUpstreamHandler.java
===================================================================
--- trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyChannelUpstreamHandler.java 2010-03-10 14:00:25 UTC (rev 1585)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyChannelUpstreamHandler.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -23,7 +23,7 @@
package org.infinispan.server.core.transport.netty;
import org.infinispan.CacheException;
-import org.infinispan.server.core.CommandHandler;
+import org.infinispan.server.core.transport.CommandHandler;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.ChannelStateEvent;
import org.jboss.netty.channel.MessageEvent;
Modified: trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyExceptionEvent.java
===================================================================
--- trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyExceptionEvent.java 2010-03-10 14:00:25 UTC (rev 1585)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyExceptionEvent.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -23,6 +23,8 @@
package org.infinispan.server.core.transport.netty;
+import org.infinispan.server.core.transport.Channel;
+import org.infinispan.server.core.transport.ChannelFuture;
import org.infinispan.server.core.transport.ExceptionEvent;
/**
@@ -31,15 +33,24 @@
* @author Galder Zamarreño
* @since 4.0
*/
-public class NettyExceptionEvent implements ExceptionEvent {
- final org.jboss.netty.channel.ExceptionEvent event;
+public class NettyExceptionEvent extends NettyChannelEvent implements ExceptionEvent {
NettyExceptionEvent(org.jboss.netty.channel.ExceptionEvent event) {
- this.event = event;
+ super(event);
}
@Override
public Throwable getCause() {
- return event.getCause();
+ return ((org.jboss.netty.channel.ExceptionEvent) event).getCause();
}
+
+ @Override
+ public Channel getChannel() {
+ return new NettyChannel(event.getChannel());
+ }
+
+ @Override
+ public ChannelFuture getFuture() {
+ return new NettyChannelFuture(event.getFuture());
+ }
}
Modified: trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyMessageEvent.java
===================================================================
--- trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyMessageEvent.java 2010-03-10 14:00:25 UTC (rev 1585)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyMessageEvent.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -24,8 +24,7 @@
import java.net.SocketAddress;
-import org.infinispan.server.core.MessageEvent;
-import org.infinispan.server.core.transport.Channel;
+import org.infinispan.server.core.transport.MessageEvent;
/**
* NettyMessageEvent.
@@ -33,25 +32,20 @@
* @author Galder Zamarreño
* @since 4.0
*/
-public class NettyMessageEvent implements MessageEvent {
- final org.jboss.netty.channel.MessageEvent event;
+public class NettyMessageEvent extends NettyChannelEvent implements MessageEvent {
public NettyMessageEvent(org.jboss.netty.channel.MessageEvent event) {
- this.event = event;
+ super(event);
}
@Override
- public Object getMessage() {
- return event.getMessage();
+ public Object getMessage() {
+ return ((org.jboss.netty.channel.MessageEvent) event).getMessage();
}
@Override
public SocketAddress getRemoteAddress() {
- return event.getRemoteAddress();
+ return ((org.jboss.netty.channel.MessageEvent) event).getRemoteAddress();
}
- @Override
- public Channel getChannel() {
- return new NettyChannel(event.getChannel());
- }
}
Modified: trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyServer.java
===================================================================
--- trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyServer.java 2010-03-10 14:00:25 UTC (rev 1585)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyServer.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -29,7 +29,7 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
-import org.infinispan.server.core.CommandHandler;
+import org.infinispan.server.core.transport.CommandHandler;
import org.infinispan.server.core.transport.Server;
import org.infinispan.util.logging.Log;
import org.infinispan.util.logging.LogFactory;
@@ -62,7 +62,7 @@
final ExecutorService masterExecutor;
final ExecutorService workerExecutor;
- public NettyServer(CommandHandler commandHandler, ChannelUpstreamHandler decoder, ChannelDownstreamHandler encoder,
+ public NettyServer(CommandHandler commandHandler, ChannelUpstreamHandler decoder, ChannelDownstreamHandler encoder,
SocketAddress address, int masterThreads, int workerThreads, String cacheName) {
ThreadFactory tf = new MemcachedThreadFactory(cacheName, ExecutorType.MASTER);
if (masterThreads == 0) {
Modified: trunk/server/core/src/main/resources/startServer.bat
===================================================================
--- trunk/server/core/src/main/resources/startServer.bat 2010-03-10 14:00:25 UTC (rev 1585)
+++ trunk/server/core/src/main/resources/startServer.bat 2010-03-10 14:01:23 UTC (rev 1586)
@@ -5,6 +5,7 @@
set LIB=
for %%f in (..\lib\*.jar) do set LIB=!LIB!;%%f
for %%f in (..\modules\memcached\lib\*.jar) do set LIB=!LIB!;%%f
+for %%f in (..\modules\hotrod\lib\*.jar) do set LIB=!LIB!;%%f
rem echo libs: %LIB%
set CP=%LIB%;..\infinispan-core.jar;..\modules\core\infinispan-server-memcached.jar;%CP%
Modified: trunk/server/core/src/main/resources/startServer.sh
===================================================================
--- trunk/server/core/src/main/resources/startServer.sh 2010-03-10 14:00:25 UTC (rev 1585)
+++ trunk/server/core/src/main/resources/startServer.sh 2010-03-10 14:01:23 UTC (rev 1586)
@@ -19,16 +19,6 @@
done
fi
-CP=${CP}:${ISPN_HOME}/modules/core/infinispan-server-core.jar
-
-if [ -e ${ISPN_HOME}/modules/core/lib ]
-then
- for JAR in ${ISPN_HOME}/modules/core/lib/*
- do
- CP=$CP:$JAR
- done
-fi
-
CP=${CP}:${ISPN_HOME}/modules/memcached/infinispan-server-memcached.jar
if [ -e ${ISPN_HOME}/modules/memcached/lib ]
Copied: trunk/server/memcached/src/main/java/org/infinispan/server/memcached/Command.java (from rev 1582, trunk/server/core/src/main/java/org/infinispan/server/core/Command.java)
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/memcached/Command.java (rev 0)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/Command.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -0,0 +1,37 @@
+/*
+ * 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 org.infinispan.server.core.transport.ChannelHandlerContext;
+
+/**
+ * Command.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+public interface Command {
+
+ Object perform(ChannelHandlerContext ctx) throws Throwable;
+
+}
Copied: trunk/server/memcached/src/main/java/org/infinispan/server/memcached/CommandFactory.java (from rev 1582, trunk/server/core/src/main/java/org/infinispan/server/core/CommandFactory.java)
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/memcached/CommandFactory.java (rev 0)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/CommandFactory.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -0,0 +1,35 @@
+/*
+ * 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.IOException;
+
+/**
+ * TODO: This only deals with text based protocols, needs further thought. Will be looked into when implementing Hot Rod
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+public interface CommandFactory {
+ Command createCommand(String line) throws IOException;
+}
Copied: trunk/server/memcached/src/main/java/org/infinispan/server/memcached/CommandInterceptor.java (from rev 1582, trunk/server/core/src/main/java/org/infinispan/server/core/CommandInterceptor.java)
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/memcached/CommandInterceptor.java (rev 0)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/CommandInterceptor.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -0,0 +1,33 @@
+/*
+ * 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;
+
+/**
+ * CommandInterceptor.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+public interface CommandInterceptor {
+ CommandInterceptor getNext();
+}
Copied: trunk/server/memcached/src/main/java/org/infinispan/server/memcached/InterceptorChain.java (from rev 1582, trunk/server/core/src/main/java/org/infinispan/server/core/InterceptorChain.java)
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/memcached/InterceptorChain.java (rev 0)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/InterceptorChain.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -0,0 +1,38 @@
+/*
+ * 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 org.infinispan.server.core.transport.ChannelHandlerContext;
+
+import java.util.List;
+
+/**
+ * InterceptorChain.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+public interface InterceptorChain {
+ Object invoke(ChannelHandlerContext ctx, Command command) throws Throwable;
+ List<CommandInterceptor> getInterceptorsWhichExtend(Class<? extends CommandInterceptor> interceptorClass);
+}
Copied: trunk/server/memcached/src/main/java/org/infinispan/server/memcached/InterceptorChainFactory.java (from rev 1582, trunk/server/core/src/main/java/org/infinispan/server/core/InterceptorChainFactory.java)
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/memcached/InterceptorChainFactory.java (rev 0)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/InterceptorChainFactory.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -0,0 +1,33 @@
+/*
+ * 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;
+
+/**
+ * InterceptorChainFactory.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+public interface InterceptorChainFactory {
+ InterceptorChain buildInterceptorChain();
+}
Modified: trunk/server/memcached/src/main/java/org/infinispan/server/memcached/TextServer.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/memcached/TextServer.java 2010-03-10 14:00:25 UTC (rev 1585)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/TextServer.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -33,7 +33,7 @@
import org.infinispan.server.core.transport.netty.NettyDecoder;
import org.infinispan.server.core.transport.netty.NettyServer;
import org.infinispan.server.memcached.transport.TextDecoder;
-import org.infinispan.server.core.InterceptorChain;
+import org.infinispan.server.memcached.InterceptorChain;
import org.infinispan.server.memcached.commands.TextCommandHandler;
import org.infinispan.server.memcached.commands.Value;
import org.infinispan.server.memcached.interceptors.TextProtocolInterceptorChainFactory;
Modified: trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/CasCommand.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/CasCommand.java 2010-03-10 14:00:25 UTC (rev 1585)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/CasCommand.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -26,7 +26,7 @@
import org.infinispan.Cache;
import org.infinispan.server.core.transport.ChannelHandlerContext;
-import org.infinispan.server.core.Command;
+import org.infinispan.server.memcached.Command;
import org.infinispan.server.memcached.Reply;
import org.infinispan.server.memcached.interceptors.TextProtocolVisitor;
Modified: trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/CommandFactory.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/CommandFactory.java 2010-03-10 14:00:25 UTC (rev 1585)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/CommandFactory.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -31,12 +31,11 @@
import java.util.concurrent.ScheduledExecutorService;
import org.infinispan.Cache;
+import org.infinispan.server.memcached.InterceptorChain;
import org.infinispan.util.logging.Log;
import org.infinispan.util.logging.LogFactory;
import org.jboss.util.NotImplementedException;
-import org.infinispan.server.core.InterceptorChain;
-
/**
* CommandFactory.
*
Modified: trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/MemcachedStatsImpl.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/MemcachedStatsImpl.java 2010-03-10 14:00:25 UTC (rev 1585)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/MemcachedStatsImpl.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -24,9 +24,9 @@
import java.util.List;
+import org.infinispan.server.memcached.InterceptorChain;
import org.infinispan.stats.Stats;
-import org.infinispan.server.core.CommandInterceptor;
-import org.infinispan.server.core.InterceptorChain;
+import org.infinispan.server.memcached.CommandInterceptor;
import org.infinispan.server.memcached.interceptors.StatsInterceptor;
/**
Modified: trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/StatsCommand.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/StatsCommand.java 2010-03-10 14:00:25 UTC (rev 1585)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/StatsCommand.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -32,7 +32,7 @@
import org.infinispan.server.core.transport.Channel;
import org.infinispan.server.core.transport.ChannelBuffers;
import org.infinispan.server.core.transport.ChannelHandlerContext;
-import org.infinispan.server.core.InterceptorChain;
+import org.infinispan.server.memcached.InterceptorChain;
import org.infinispan.server.memcached.interceptors.TextProtocolVisitor;
/**
Modified: trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/StorageCommand.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/StorageCommand.java 2010-03-10 14:00:25 UTC (rev 1585)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/StorageCommand.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -26,7 +26,7 @@
import java.io.StreamCorruptedException;
import org.infinispan.Cache;
-import org.infinispan.server.core.Command;
+import org.infinispan.server.memcached.Command;
/**
* StorageCommand.
Modified: trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/TextCommand.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/TextCommand.java 2010-03-10 14:00:25 UTC (rev 1585)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/TextCommand.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -23,7 +23,7 @@
package org.infinispan.server.memcached.commands;
import org.infinispan.server.core.transport.ChannelHandlerContext;
-import org.infinispan.server.core.Command;
+import org.infinispan.server.memcached.Command;
import org.infinispan.server.memcached.interceptors.TextProtocolVisitor;
/**
Modified: trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/TextCommandHandler.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/TextCommandHandler.java 2010-03-10 14:00:25 UTC (rev 1585)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/TextCommandHandler.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -24,9 +24,9 @@
import org.infinispan.Cache;
import org.infinispan.server.core.transport.ChannelHandlerContext;
-import org.infinispan.server.core.CommandHandler;
-import org.infinispan.server.core.MessageEvent;
-import org.infinispan.server.core.InterceptorChain;
+import org.infinispan.server.core.transport.CommandHandler;
+import org.infinispan.server.core.transport.MessageEvent;
+import org.infinispan.server.memcached.InterceptorChain;
/**
* TextProtocolServerHandler.
Modified: trunk/server/memcached/src/main/java/org/infinispan/server/memcached/interceptors/TextCommandInterceptor.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/memcached/interceptors/TextCommandInterceptor.java 2010-03-10 14:00:25 UTC (rev 1585)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/interceptors/TextCommandInterceptor.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -23,7 +23,7 @@
package org.infinispan.server.memcached.interceptors;
import org.infinispan.server.core.transport.ChannelHandlerContext;
-import org.infinispan.server.core.CommandInterceptor;
+import org.infinispan.server.memcached.CommandInterceptor;
import org.infinispan.server.memcached.commands.TextCommand;
/**
Modified: trunk/server/memcached/src/main/java/org/infinispan/server/memcached/interceptors/TextCommandInterceptorImpl.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/memcached/interceptors/TextCommandInterceptorImpl.java 2010-03-10 14:00:25 UTC (rev 1585)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/interceptors/TextCommandInterceptorImpl.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -23,7 +23,7 @@
package org.infinispan.server.memcached.interceptors;
import org.infinispan.server.core.transport.ChannelHandlerContext;
-import org.infinispan.server.core.CommandInterceptor;
+import org.infinispan.server.memcached.CommandInterceptor;
import org.infinispan.server.memcached.commands.TextCommand;
/**
Modified: trunk/server/memcached/src/main/java/org/infinispan/server/memcached/interceptors/TextProtocolInterceptorChain.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/memcached/interceptors/TextProtocolInterceptorChain.java 2010-03-10 14:00:25 UTC (rev 1585)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/interceptors/TextProtocolInterceptorChain.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -28,9 +28,9 @@
import java.util.List;
import org.infinispan.server.core.transport.ChannelHandlerContext;
-import org.infinispan.server.core.Command;
-import org.infinispan.server.core.CommandInterceptor;
-import org.infinispan.server.core.InterceptorChain;
+import org.infinispan.server.memcached.Command;
+import org.infinispan.server.memcached.CommandInterceptor;
+import org.infinispan.server.memcached.InterceptorChain;
import org.infinispan.server.memcached.commands.TextCommand;
/**
Modified: trunk/server/memcached/src/main/java/org/infinispan/server/memcached/interceptors/TextProtocolInterceptorChainFactory.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/memcached/interceptors/TextProtocolInterceptorChainFactory.java 2010-03-10 14:00:25 UTC (rev 1585)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/interceptors/TextProtocolInterceptorChainFactory.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -23,8 +23,8 @@
package org.infinispan.server.memcached.interceptors;
import org.infinispan.Cache;
-import org.infinispan.server.core.InterceptorChainFactory;
-import org.infinispan.server.core.InterceptorChain;
+import org.infinispan.server.memcached.InterceptorChain;
+import org.infinispan.server.memcached.InterceptorChainFactory;
/**
* InterceptorChainFactory.
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-03-10 14:00:25 UTC (rev 1585)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/transport/TextDecoder.java 2010-03-10 14:01:23 UTC (rev 1586)
@@ -24,8 +24,8 @@
package org.infinispan.server.memcached.transport;
import org.infinispan.Cache;
-import org.infinispan.server.core.Command;
-import org.infinispan.server.core.InterceptorChain;
+import org.infinispan.server.memcached.Command;
+import org.infinispan.server.memcached.InterceptorChain;
import org.infinispan.server.core.transport.Channel;
import org.infinispan.server.core.transport.ChannelBuffer;
import org.infinispan.server.core.transport.ChannelBuffers;
Deleted: trunk/server/memcached/src/main/resources/memcached.bat
===================================================================
--- trunk/server/memcached/src/main/resources/memcached.bat 2010-03-10 14:00:25 UTC (rev 1585)
+++ trunk/server/memcached/src/main/resources/memcached.bat 2010-03-10 14:01:23 UTC (rev 1586)
@@ -1,14 +0,0 @@
- at echo off
-
-setlocal enabledelayedexpansion
-
-set LIB=
-for %%f in (..\lib\*.jar) do set LIB=!LIB!;%%f
-for %%f in (..\modules\memcached\lib\*.jar) do set LIB=!LIB!;%%f
-rem echo libs: %LIB%
-
-set CP=%LIB%;..\infinispan-core.jar;..\modules\memcached\infinispan-server-memcached.jar;%CP%
-
-java -classpath "%CP%" -Dbind.address=127.0.0.1 -Djava.net.preferIPv4Stack=true -Dlog4j.configuration=..\etc\log4j.xml org.infinispan.server.memcached.Main %*
-
-:fileEnd
\ No newline at end of file
Deleted: trunk/server/memcached/src/main/resources/memcached.sh
===================================================================
--- trunk/server/memcached/src/main/resources/memcached.sh 2010-03-10 14:00:25 UTC (rev 1585)
+++ trunk/server/memcached/src/main/resources/memcached.sh 2010-03-10 14:01:23 UTC (rev 1586)
@@ -1,37 +0,0 @@
-#!/bin/bash
-
-DIRNAME=`dirname $0`
-
-# Setup ISPN_HOME
-if [ "x$ISPN_HOME" = "x" ]; then
- # get the full path (without any relative bits)
- ISPN_HOME=`cd $DIRNAME/..; pwd`
-fi
-export ISPN_HOME
-
-CP=${CP}:${ISPN_HOME}/infinispan-core.jar
-
-if [ -e ${ISPN_HOME}/lib ]
-then
- for JAR in ${ISPN_HOME}/lib/*
- do
- CP=$CP:$JAR
- done
-fi
-
-CP=${CP}:${ISPN_HOME}/modules/memcached/infinispan-server-memcached.jar
-
-if [ -e ${ISPN_HOME}/modules/memcached/lib ]
-then
- for JAR in ${ISPN_HOME}/modules/memcached/lib/*
- do
- CP=$CP:$JAR
- done
-fi
-
-JVM_PARAMS="${JVM_PARAMS} -Dbind.address=127.0.0.1 -Djava.net.preferIPv4Stack=true -Dlog4j.configuration=file:${ISPN_HOME}/etc/log4j.xml"
-
-# Sample JPDA settings for remote socket debuging
-#JVM_PARAMS="$JVM_PARAMS -Xrunjdwp:transport=dt_socket,address=8686,server=y,suspend=n"
-
-java -cp $CP ${JVM_PARAMS} org.infinispan.server.memcached.Main ${*}
\ No newline at end of file
Modified: trunk/src/main/resources/assemblies/all.xml
===================================================================
--- trunk/src/main/resources/assemblies/all.xml 2010-03-10 14:00:25 UTC (rev 1585)
+++ trunk/src/main/resources/assemblies/all.xml 2010-03-10 14:01:23 UTC (rev 1586)
@@ -146,9 +146,8 @@
<include>org.infinispan:infinispan-tree</include>
<include>org.infinispan:infinispan-query</include>
<include>org.infinispan:infinispan-server-rest</include>
- <include>org.infinispan:infinispan-server-core</include>
<include>org.infinispan:infinispan-server-memcached</include>
- <include>org.infinispan:infinispan-server-hotrod</include>
+ <!-- include>org.infinispan:infinispan-server-hotrod</include -->
<include>org.infinispan:infinispan-lucene-directory</include>
<include>org.infinispan:infinispan-lucene-demo</include>
</includes>
@@ -262,6 +261,83 @@
</dependencySets>
</binaries>
</moduleSet>
+
+ <!-- For server-core module, only add scripts -->
+ <moduleSet>
+ <includeSubModules>false</includeSubModules>
+ <includes>
+ <include>org.infinispan:infinispan-server-core</include>
+ </includes>
+ <sources>
+ <includeModuleDirectory>false</includeModuleDirectory>
+
+ <fileSets>
+
+ <!-- Executable resources -->
+ <fileSet>
+ <directory>src/main/resources</directory>
+ <outputDirectory>bin</outputDirectory>
+ <lineEnding>unix</lineEnding>
+ <includes>
+ <include>**/*.sh</include>
+ <include>**/*.py</include>
+ <include>**/*.rb</include>
+ </includes>
+ <fileMode>0777</fileMode>
+ </fileSet>
+
+ <fileSet>
+ <directory>src/main/resources</directory>
+ <outputDirectory>bin</outputDirectory>
+ <lineEnding>dos</lineEnding>
+ <includes>
+ <include>**/*.cmd</include>
+ <include>**/*.bat</include>
+ </includes>
+ <fileMode>0777</fileMode>
+ </fileSet>
+
+ <!-- EULAs and license files -->
+ <fileSet>
+ <directory>src/main/release</directory>
+ <outputDirectory></outputDirectory>
+ <lineEnding>dos</lineEnding>
+ <includes>
+ <include>**/*.txt</include>
+ </includes>
+ </fileSet>
+
+ </fileSets>
+
+ </sources>
+
+ </moduleSet>
+
+ <!-- REST server and ec2-demo module which are webapps -->
+ <moduleSet>
+ <includeSubModules>false</includeSubModules>
+ <includes>
+ <include>org.infinispan:infinispan-server-rest</include>
+ <include>org.infinispan:infinispan-ec2-demo</include>
+ </includes>
+
+ <binaries>
+ <outputDirectory>modules/${module.basedir.name}</outputDirectory>
+ <outputFileNameMapping>
+ ${module.artifactId}.${module.extension}
+ </outputFileNameMapping>
+ <unpack>false</unpack>
+ <dependencySets>
+ <dependencySet>
+ <includes>
+ <include>NONEXISTENT_DEPENDENCY*</include>
+ </includes>
+ <outputDirectory>modules/${module.basedir.name}</outputDirectory>
+ </dependencySet>
+ </dependencySets>
+ </binaries>
+ </moduleSet>
+
</moduleSets>
<fileSets>
More information about the infinispan-commits
mailing list