[infinispan-commits] Infinispan SVN: r1496 - in trunk/server: core and 21 other directories.
infinispan-commits at lists.jboss.org
infinispan-commits at lists.jboss.org
Thu Feb 11 07:29:18 EST 2010
Author: galder.zamarreno at jboss.com
Date: 2010-02-11 07:29:16 -0500 (Thu, 11 Feb 2010)
New Revision: 1496
Added:
trunk/server/core/
trunk/server/core/pom.xml
trunk/server/core/src/
trunk/server/core/src/main/
trunk/server/core/src/main/java/
trunk/server/core/src/main/java/org/
trunk/server/core/src/main/java/org/infinispan/
trunk/server/core/src/main/java/org/infinispan/server/
trunk/server/core/src/main/java/org/infinispan/server/core/
trunk/server/core/src/main/java/org/infinispan/server/core/Command.java
trunk/server/core/src/main/java/org/infinispan/server/core/CommandDecoder.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/core/src/main/java/org/infinispan/server/core/Server.java
trunk/server/core/src/main/java/org/infinispan/server/core/transport/
trunk/server/core/src/main/java/org/infinispan/server/core/transport/Channel.java
trunk/server/core/src/main/java/org/infinispan/server/core/transport/ChannelBuffer.java
trunk/server/core/src/main/java/org/infinispan/server/core/transport/ChannelBuffers.java
trunk/server/core/src/main/java/org/infinispan/server/core/transport/ChannelFuture.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/netty/
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/NettyChannelBuffer.java
trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyChannelBuffers.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/NettyChannelPipelineFactory.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/NettyMessageEvent.java
trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyServer.java
trunk/server/core/src/main/resources/
trunk/server/core/src/test/
trunk/server/core/src/test/java/
trunk/server/hotrod/
trunk/server/hotrod/pom.xml
trunk/server/hotrod/src/
trunk/server/hotrod/src/main/
trunk/server/hotrod/src/main/java/
trunk/server/hotrod/src/main/resources/
trunk/server/hotrod/src/test/
trunk/server/hotrod/src/test/java/
Removed:
trunk/server/memcached/src/main/java/org/infinispan/server/core/Channel.java
trunk/server/memcached/src/main/java/org/infinispan/server/core/ChannelBuffer.java
trunk/server/memcached/src/main/java/org/infinispan/server/core/ChannelBuffers.java
trunk/server/memcached/src/main/java/org/infinispan/server/core/ChannelFuture.java
trunk/server/memcached/src/main/java/org/infinispan/server/core/ChannelHandlerContext.java
trunk/server/memcached/src/main/java/org/infinispan/server/core/Command.java
trunk/server/memcached/src/main/java/org/infinispan/server/core/CommandDecoder.java
trunk/server/memcached/src/main/java/org/infinispan/server/core/CommandFactory.java
trunk/server/memcached/src/main/java/org/infinispan/server/core/CommandHandler.java
trunk/server/memcached/src/main/java/org/infinispan/server/core/CommandInterceptor.java
trunk/server/memcached/src/main/java/org/infinispan/server/core/InterceptorChain.java
trunk/server/memcached/src/main/java/org/infinispan/server/core/InterceptorChainFactory.java
trunk/server/memcached/src/main/java/org/infinispan/server/core/MessageEvent.java
trunk/server/memcached/src/main/java/org/infinispan/server/core/ServerBootstrap.java
trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/NettyChannel.java
trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/NettyChannelBuffer.java
trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/NettyChannelBuffers.java
trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/NettyChannelFuture.java
trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/NettyChannelHandlerContext.java
trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/NettyChannelPipelineFactory.java
trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/NettyChannelUpstreamHandler.java
trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/NettyMessageEvent.java
trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/NettyServerBootstrap.java
trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/memcached/NettyMemcachedDecoder.java
Modified:
trunk/server/memcached/pom.xml
trunk/server/memcached/src/main/java/org/infinispan/server/memcached/TextServer.java
trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/AddCommand.java
trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/AppendCommand.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/DecrementCommand.java
trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/DeleteCommand.java
trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/FlushAllCommand.java
trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/GetCommand.java
trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/IncrementCommand.java
trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/NumericCommand.java
trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/PrependCommand.java
trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/QuitCommand.java
trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/ReplaceCommand.java
trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/SetCommand.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/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/commands/VersionCommand.java
trunk/server/memcached/src/main/java/org/infinispan/server/memcached/interceptors/AbstractVisitor.java
trunk/server/memcached/src/main/java/org/infinispan/server/memcached/interceptors/CallInterceptor.java
trunk/server/memcached/src/main/java/org/infinispan/server/memcached/interceptors/StatsInterceptor.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/TextProtocolVisitor.java
Log:
- Created server-core module that includes common classes for memcached/hotrod
- Refactored memcached module to depend on server-core
- Created base skeleton project for hotrod
Added: trunk/server/core/pom.xml
===================================================================
--- trunk/server/core/pom.xml (rev 0)
+++ trunk/server/core/pom.xml 2010-02-11 12:29:16 UTC (rev 1496)
@@ -0,0 +1,44 @@
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.infinispan</groupId>
+ <artifactId>infinispan-server-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>infinispan-server-core</artifactId>
+ <name>Infinispan Server Core Module</name>
+ <description>Infinispan server core module</description>
+
+ <properties>
+ <version.netty>3.1.5.GA</version.netty>
+ <version.gnu.getopt>1.0.13</version.gnu.getopt>
+ <version.apache.log4j>1.2.15</version.apache.log4j>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.netty</groupId>
+ <artifactId>netty</artifactId>
+ <version>${version.netty}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>gnu-getopt</groupId>
+ <artifactId>getopt</artifactId>
+ <version>${version.gnu.getopt}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>apache-log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>${version.apache.log4j}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+</project>
Added: trunk/server/core/src/main/java/org/infinispan/server/core/Command.java
===================================================================
--- trunk/server/core/src/main/java/org/infinispan/server/core/Command.java (rev 0)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/Command.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -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.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;
+
+}
Added: trunk/server/core/src/main/java/org/infinispan/server/core/CommandDecoder.java
===================================================================
--- trunk/server/core/src/main/java/org/infinispan/server/core/CommandDecoder.java (rev 0)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/CommandDecoder.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -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.core;
+
+/**
+ * CommandDecoder.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+public interface CommandDecoder {
+
+}
Added: trunk/server/core/src/main/java/org/infinispan/server/core/CommandFactory.java
===================================================================
--- trunk/server/core/src/main/java/org/infinispan/server/core/CommandFactory.java (rev 0)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/CommandFactory.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -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.core;
+
+import java.io.IOException;
+
+/**
+ * CommandFactory.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+public interface CommandFactory {
+ Command createCommand(String line) throws IOException;
+}
Added: trunk/server/core/src/main/java/org/infinispan/server/core/CommandHandler.java
===================================================================
--- trunk/server/core/src/main/java/org/infinispan/server/core/CommandHandler.java (rev 0)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/CommandHandler.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -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.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;
+}
Added: trunk/server/core/src/main/java/org/infinispan/server/core/CommandInterceptor.java
===================================================================
--- trunk/server/core/src/main/java/org/infinispan/server/core/CommandInterceptor.java (rev 0)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/CommandInterceptor.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -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.core;
+
+/**
+ * CommandInterceptor.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+public interface CommandInterceptor {
+ CommandInterceptor getNext();
+}
Added: trunk/server/core/src/main/java/org/infinispan/server/core/InterceptorChain.java
===================================================================
--- trunk/server/core/src/main/java/org/infinispan/server/core/InterceptorChain.java (rev 0)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/InterceptorChain.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -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.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);
+}
Added: trunk/server/core/src/main/java/org/infinispan/server/core/InterceptorChainFactory.java
===================================================================
--- trunk/server/core/src/main/java/org/infinispan/server/core/InterceptorChainFactory.java (rev 0)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/InterceptorChainFactory.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -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.core;
+
+/**
+ * InterceptorChainFactory.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+public interface InterceptorChainFactory {
+ InterceptorChain buildInterceptorChain();
+}
Added: trunk/server/core/src/main/java/org/infinispan/server/core/MessageEvent.java
===================================================================
--- trunk/server/core/src/main/java/org/infinispan/server/core/MessageEvent.java (rev 0)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/MessageEvent.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -0,0 +1,36 @@
+/*
+ * 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.net.SocketAddress;
+
+/**
+ * MessageEvent.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+public interface MessageEvent {
+ Object getMessage();
+ SocketAddress getRemoteAddress();
+}
Added: trunk/server/core/src/main/java/org/infinispan/server/core/Server.java
===================================================================
--- trunk/server/core/src/main/java/org/infinispan/server/core/Server.java (rev 0)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/Server.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -0,0 +1,34 @@
+/*
+ * 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;
+
+/**
+ * ChannelFactory.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+public interface Server {
+ void start();
+ void stop();
+}
Added: trunk/server/core/src/main/java/org/infinispan/server/core/transport/Channel.java
===================================================================
--- trunk/server/core/src/main/java/org/infinispan/server/core/transport/Channel.java (rev 0)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/transport/Channel.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -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.core.transport;
+
+
+/**
+ * Channel.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+public interface Channel extends Comparable<Channel> {
+ ChannelFuture write(Object message);
+ ChannelFuture disconnect();
+}
Added: trunk/server/core/src/main/java/org/infinispan/server/core/transport/ChannelBuffer.java
===================================================================
--- trunk/server/core/src/main/java/org/infinispan/server/core/transport/ChannelBuffer.java (rev 0)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/transport/ChannelBuffer.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -0,0 +1,34 @@
+/*
+ * 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;
+
+/**
+ * ChannelBuffer.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+public interface ChannelBuffer {
+ byte readByte();
+ void readBytes(byte[] dst, int dstIndex, int length);
+}
Added: trunk/server/core/src/main/java/org/infinispan/server/core/transport/ChannelBuffers.java
===================================================================
--- trunk/server/core/src/main/java/org/infinispan/server/core/transport/ChannelBuffers.java (rev 0)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/transport/ChannelBuffers.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -0,0 +1,34 @@
+/*
+ * 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;
+
+/**
+ * ChannelBuffers.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+public interface ChannelBuffers {
+ ChannelBuffer wrappedBuffer(ChannelBuffer... buffers);
+ ChannelBuffer wrappedBuffer(byte[] array);
+}
Added: trunk/server/core/src/main/java/org/infinispan/server/core/transport/ChannelFuture.java
===================================================================
--- trunk/server/core/src/main/java/org/infinispan/server/core/transport/ChannelFuture.java (rev 0)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/transport/ChannelFuture.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -0,0 +1,45 @@
+/*
+ * 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 java.util.concurrent.TimeUnit;
+
+/**
+ * ChannelFuture.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+public interface ChannelFuture {
+ Channel getChannel();
+ boolean isDone();
+ boolean isCancelled();
+ boolean setSuccess();
+ boolean setFailure(Throwable cause);
+ ChannelFuture await() throws InterruptedException;
+ ChannelFuture awaitUninterruptibly();
+ boolean await(long timeout, TimeUnit unit) throws InterruptedException;
+ boolean await(long timeoutMillis) throws InterruptedException;
+ boolean awaitUninterruptibly(long timeout, TimeUnit unit);
+ boolean awaitUninterruptibly(long timeoutMillis);
+}
Added: 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 (rev 0)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/transport/ChannelHandlerContext.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -0,0 +1,34 @@
+/*
+ * 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;
+
+/**
+ * ChannelHandlerContext.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+public interface ChannelHandlerContext {
+ Channel getChannel();
+ ChannelBuffers getChannelBuffers();
+}
Added: 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 (rev 0)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyChannel.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -0,0 +1,56 @@
+/*
+ * 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.netty;
+
+import org.infinispan.server.core.transport.Channel;
+import org.infinispan.server.core.transport.ChannelFuture;
+
+/**
+ * NettyChannel.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+public class NettyChannel implements Channel {
+ final org.jboss.netty.channel.Channel ch;
+
+ public NettyChannel(org.jboss.netty.channel.Channel ch) {
+ this.ch = ch;
+ }
+
+ @Override
+ public ChannelFuture disconnect() {
+ return new NettyChannelFuture(ch.disconnect(), this);
+ }
+
+ @Override
+ public ChannelFuture write(Object message) {
+ return new NettyChannelFuture(ch.write(message), this);
+ }
+
+ @Override
+ public int compareTo(Channel o) {
+ return ch.compareTo(((NettyChannel) o).ch);
+ }
+
+}
Added: trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyChannelBuffer.java
===================================================================
--- trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyChannelBuffer.java (rev 0)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyChannelBuffer.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -0,0 +1,560 @@
+/*
+ * 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.netty;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.channels.GatheringByteChannel;
+import java.nio.channels.ScatteringByteChannel;
+
+import org.infinispan.server.core.transport.ChannelBuffer;
+import org.jboss.netty.buffer.ChannelBufferFactory;
+import org.jboss.netty.buffer.ChannelBufferIndexFinder;
+
+/**
+ * NettyChannelBuffer.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+public class NettyChannelBuffer implements ChannelBuffer, org.jboss.netty.buffer.ChannelBuffer {
+ final org.jboss.netty.buffer.ChannelBuffer buffer;
+
+ public NettyChannelBuffer(org.jboss.netty.buffer.ChannelBuffer buffer) {
+ this.buffer = buffer;
+ }
+
+ @Override
+ public byte readByte() {
+ return buffer.readByte();
+ }
+
+ @Override
+ public void readBytes(byte[] dst, int dstIndex, int length) {
+ buffer.readBytes(dst, dstIndex, length);
+ }
+
+ @Override
+ public int compareTo(org.jboss.netty.buffer.ChannelBuffer o) {
+ return buffer.compareTo(o);
+ }
+
+ @Override
+ public int capacity() {
+ return buffer.capacity();
+ }
+
+ @Override
+ public void clear() {
+ buffer.clear();
+ }
+
+ @Override
+ public org.jboss.netty.buffer.ChannelBuffer copy() {
+ return buffer.copy();
+ }
+
+ @Override
+ public org.jboss.netty.buffer.ChannelBuffer copy(int index, int length) {
+ return buffer.copy(index, length);
+ }
+
+ @Override
+ public void discardReadBytes() {
+ buffer.discardReadBytes();
+ }
+
+ @Override
+ public org.jboss.netty.buffer.ChannelBuffer duplicate() {
+ return buffer.duplicate();
+ }
+
+ @Override
+ public ChannelBufferFactory factory() {
+ return buffer.factory();
+ }
+
+ @Override
+ public byte getByte(int index) {
+ return buffer.getByte(index);
+ }
+
+ @Override
+ public void getBytes(int index, org.jboss.netty.buffer.ChannelBuffer dst) {
+ buffer.getBytes(index, dst);
+ }
+
+ @Override
+ public void getBytes(int index, byte[] dst) {
+ buffer.getBytes(index, dst);
+ }
+
+ @Override
+ public void getBytes(int index, ByteBuffer dst) {
+ buffer.getBytes(index, dst);
+ }
+
+ @Override
+ public void getBytes(int index, org.jboss.netty.buffer.ChannelBuffer dst, int length) {
+ buffer.getBytes(index, dst, length);
+ }
+
+ @Override
+ public void getBytes(int index, OutputStream out, int length) throws IOException {
+ buffer.getBytes(index, out, length);
+ }
+
+ @Override
+ public int getBytes(int index, GatheringByteChannel out, int length) throws IOException {
+ return buffer.getBytes(index, out, length);
+ }
+
+ @Override
+ public void getBytes(int index, org.jboss.netty.buffer.ChannelBuffer dst, int dstIndex, int length) {
+ buffer.getBytes(index, dst, dstIndex, length);
+ }
+
+ @Override
+ public void getBytes(int index, byte[] dst, int dstIndex, int length) {
+ buffer.getBytes(index, dst, dstIndex, length);
+ }
+
+ @Override
+ public int getInt(int index) {
+ return buffer.getInt(index);
+ }
+
+ @Override
+ public long getLong(int index) {
+ return buffer.getLong(index);
+ }
+
+ @Override
+ public int getMedium(int index) {
+ return buffer.getMedium(index);
+ }
+
+ @Override
+ public short getShort(int index) {
+ return buffer.getShort(index);
+ }
+
+ @Override
+ public short getUnsignedByte(int index) {
+ return buffer.getUnsignedByte(index);
+ }
+
+ @Override
+ public long getUnsignedInt(int index) {
+ return buffer.getUnsignedInt(index);
+ }
+
+ @Override
+ public int getUnsignedMedium(int index) {
+ return buffer.getUnsignedMedium(index);
+ }
+
+ @Override
+ public int getUnsignedShort(int index) {
+ return buffer.getUnsignedShort(index);
+ }
+
+ @Override
+ public int indexOf(int fromIndex, int toIndex, byte value) {
+ return buffer.indexOf(fromIndex, toIndex, value);
+ }
+
+ @Override
+ public int indexOf(int fromIndex, int toIndex, ChannelBufferIndexFinder indexFinder) {
+ return buffer.indexOf(fromIndex, toIndex, indexFinder);
+ }
+
+ @Override
+ public void markReaderIndex() {
+ buffer.markReaderIndex();
+ }
+
+ @Override
+ public void markWriterIndex() {
+ buffer.markWriterIndex();
+ }
+
+ @Override
+ public ByteOrder order() {
+ return buffer.order();
+ }
+
+ @Override
+ public org.jboss.netty.buffer.ChannelBuffer readBytes(int length) {
+ return buffer.readBytes(length);
+ }
+
+ @Override
+ public org.jboss.netty.buffer.ChannelBuffer readBytes(ChannelBufferIndexFinder indexFinder) {
+ return buffer.readBytes(indexFinder);
+ }
+
+ @Override
+ public void readBytes(org.jboss.netty.buffer.ChannelBuffer dst) {
+ buffer.readBytes(dst);
+ }
+
+ @Override
+ public void readBytes(byte[] dst) {
+ buffer.readBytes(dst);
+ }
+
+ @Override
+ public void readBytes(ByteBuffer dst) {
+ buffer.readBytes(dst);
+ }
+
+ @Override
+ public void readBytes(org.jboss.netty.buffer.ChannelBuffer dst, int length) {
+ buffer.readBytes(dst, length);
+ }
+
+ @Override
+ public void readBytes(OutputStream out, int length) throws IOException {
+ buffer.readBytes(out, length);
+ }
+
+ @Override
+ public int readBytes(GatheringByteChannel out, int length) throws IOException {
+ return buffer.readBytes(out, length);
+ }
+
+ @Override
+ public void readBytes(org.jboss.netty.buffer.ChannelBuffer dst, int dstIndex, int length) {
+ buffer.readBytes(dst, dstIndex, length);
+ }
+
+ @Override
+ public int readInt() {
+ return buffer.readInt();
+ }
+
+ @Override
+ public long readLong() {
+ return buffer.readLong();
+ }
+
+ @Override
+ public int readMedium() {
+ return buffer.readMedium();
+ }
+
+ @Override
+ public short readShort() {
+ return buffer.readShort();
+ }
+
+ @Override
+ public org.jboss.netty.buffer.ChannelBuffer readSlice(int length) {
+ return buffer.readSlice(length);
+ }
+
+ @Override
+ public org.jboss.netty.buffer.ChannelBuffer readSlice(ChannelBufferIndexFinder indexFinder) {
+ return buffer.readSlice(indexFinder);
+ }
+
+ @Override
+ public short readUnsignedByte() {
+ return buffer.readUnsignedByte();
+ }
+
+ @Override
+ public long readUnsignedInt() {
+ return buffer.readUnsignedInt();
+ }
+
+ @Override
+ public int readUnsignedMedium() {
+ return buffer.readUnsignedMedium();
+ }
+
+ @Override
+ public int readUnsignedShort() {
+ return buffer.readUnsignedShort();
+ }
+
+ @Override
+ public boolean readable() {
+ return buffer.readable();
+ }
+
+ @Override
+ public int readableBytes() {
+ return buffer.readableBytes();
+ }
+
+ @Override
+ public int readerIndex() {
+ return buffer.readerIndex();
+ }
+
+ @Override
+ public void readerIndex(int readerIndex) {
+ buffer.readerIndex(readerIndex);
+ }
+
+ @Override
+ public void resetReaderIndex() {
+ buffer.resetReaderIndex();
+ }
+
+ @Override
+ public void resetWriterIndex() {
+ buffer.resetWriterIndex();
+ }
+
+ @Override
+ public void setByte(int index, byte value) {
+ buffer.setByte(index, value);
+ }
+
+ @Override
+ public void setBytes(int index, org.jboss.netty.buffer.ChannelBuffer src) {
+ buffer.setBytes(index, src);
+ }
+
+ @Override
+ public void setBytes(int index, byte[] src) {
+ buffer.setBytes(index, src);
+ }
+
+ @Override
+ public void setBytes(int index, ByteBuffer src) {
+ buffer.setBytes(index, src);
+ }
+
+ @Override
+ public void setBytes(int index, org.jboss.netty.buffer.ChannelBuffer src, int length) {
+ buffer.setBytes(index, src, length);
+ }
+
+ @Override
+ public int setBytes(int index, InputStream in, int length) throws IOException {
+ return buffer.setBytes(index, in, length);
+ }
+
+ @Override
+ public int setBytes(int index, ScatteringByteChannel in, int length) throws IOException {
+ return buffer.setBytes(index, in, length);
+ }
+
+ @Override
+ public void setBytes(int index, org.jboss.netty.buffer.ChannelBuffer src, int srcIndex, int length) {
+ buffer.setBytes(index, src, srcIndex, length);
+ }
+
+ @Override
+ public void setBytes(int index, byte[] src, int srcIndex, int length) {
+ buffer.setBytes(index, src, srcIndex, length);
+ }
+
+ @Override
+ public void setIndex(int readerIndex, int writerIndex) {
+ buffer.setIndex(readerIndex, writerIndex);
+ }
+
+ @Override
+ public void setInt(int index, int value) {
+ buffer.setInt(index, value);
+ }
+
+ @Override
+ public void setLong(int index, long value) {
+ buffer.setLong(index, value);
+ }
+
+ @Override
+ public void setMedium(int index, int value) {
+ buffer.setMedium(index, value);
+ }
+
+ @Override
+ public void setShort(int index, short value) {
+ buffer.setShort(index, value);
+ }
+
+ @Override
+ public void setZero(int index, int length) {
+ buffer.setZero(index, length);
+ }
+
+ @Override
+ public void skipBytes(int length) {
+ buffer.skipBytes(length);
+ }
+
+ @Override
+ public int skipBytes(ChannelBufferIndexFinder indexFinder) {
+ return buffer.skipBytes(indexFinder);
+ }
+
+ @Override
+ public org.jboss.netty.buffer.ChannelBuffer slice() {
+ return buffer.slice();
+ }
+
+ @Override
+ public org.jboss.netty.buffer.ChannelBuffer slice(int index, int length) {
+ return buffer.slice(index, length);
+ }
+
+ @Override
+ public ByteBuffer toByteBuffer() {
+ return buffer.toByteBuffer();
+ }
+
+ @Override
+ public ByteBuffer toByteBuffer(int index, int length) {
+ return buffer.toByteBuffer(index, length);
+ }
+
+ @Override
+ public ByteBuffer[] toByteBuffers() {
+ return buffer.toByteBuffers();
+ }
+
+ @Override
+ public ByteBuffer[] toByteBuffers(int index, int length) {
+ return buffer.toByteBuffers(index, length);
+ }
+
+ @Override
+ public String toString(String charsetName) {
+ return buffer.toString(charsetName);
+ }
+
+ @Override
+ public String toString(String charsetName, ChannelBufferIndexFinder terminatorFinder) {
+ return buffer.toString(charsetName, terminatorFinder);
+ }
+
+ @Override
+ public String toString(int index, int length, String charsetName) {
+ return buffer.toString(index, length, charsetName);
+ }
+
+ @Override
+ public String toString(int index, int length, String charsetName, ChannelBufferIndexFinder terminatorFinder) {
+ return buffer.toString(charsetName, terminatorFinder);
+ }
+
+ @Override
+ public boolean writable() {
+ return buffer.writable();
+ }
+
+ @Override
+ public int writableBytes() {
+ return buffer.writableBytes();
+ }
+
+ @Override
+ public void writeByte(byte value) {
+ buffer.writeByte(value);
+ }
+
+ @Override
+ public void writeBytes(org.jboss.netty.buffer.ChannelBuffer src) {
+ buffer.writeBytes(src);
+ }
+
+ @Override
+ public void writeBytes(byte[] src) {
+ buffer.writeBytes(src);
+ }
+
+ @Override
+ public void writeBytes(ByteBuffer src) {
+ buffer.writeBytes(src);
+ }
+
+ @Override
+ public void writeBytes(org.jboss.netty.buffer.ChannelBuffer src, int length) {
+ buffer.writeBytes(src, length);
+ }
+
+ @Override
+ public int writeBytes(InputStream in, int length) throws IOException {
+ return buffer.writeBytes(in, length);
+ }
+
+ @Override
+ public int writeBytes(ScatteringByteChannel in, int length) throws IOException {
+ return buffer.writeBytes(in, length);
+ }
+
+ @Override
+ public void writeBytes(org.jboss.netty.buffer.ChannelBuffer src, int srcIndex, int length) {
+ buffer.writeBytes(src, srcIndex, length);
+ }
+
+ @Override
+ public void writeBytes(byte[] src, int srcIndex, int length) {
+ buffer.writeBytes(src, srcIndex, length);
+ }
+
+ @Override
+ public void writeInt(int value) {
+ buffer.writeInt(value);
+ }
+
+ @Override
+ public void writeLong(long value) {
+ buffer.writeLong(value);
+ }
+
+ @Override
+ public void writeMedium(int value) {
+ buffer.writeMedium(value);
+ }
+
+ @Override
+ public void writeShort(short value) {
+ buffer.writeShort(value);
+ }
+
+ @Override
+ public void writeZero(int length) {
+ buffer.writeZero(length);
+ }
+
+ @Override
+ public int writerIndex() {
+ return buffer.writerIndex();
+ }
+
+ @Override
+ public void writerIndex(int writerIndex) {
+ buffer.writerIndex(writerIndex);
+ }
+
+}
Added: trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyChannelBuffers.java
===================================================================
--- trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyChannelBuffers.java (rev 0)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyChannelBuffers.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -0,0 +1,54 @@
+/*
+ * 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.netty;
+
+import org.infinispan.server.core.transport.ChannelBuffer;
+import org.infinispan.server.core.transport.ChannelBuffers;
+
+/**
+ * NettyChannelBuffers.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+public enum NettyChannelBuffers implements ChannelBuffers {
+ INSTANCE;
+
+ @Override
+ public ChannelBuffer wrappedBuffer(byte[] array) {
+ return new NettyChannelBuffer(org.jboss.netty.buffer.ChannelBuffers.wrappedBuffer(array));
+ }
+
+ @Override
+ public ChannelBuffer wrappedBuffer(ChannelBuffer... buffers) {
+ org.jboss.netty.buffer.ChannelBuffer[] nettyBuffers = new org.jboss.netty.buffer.ChannelBuffer[buffers.length];
+ for (int i =0; i < buffers.length; i++) {
+ nettyBuffers[i] = ((NettyChannelBuffer) buffers[i]).buffer;
+ }
+ return new NettyChannelBuffer(org.jboss.netty.buffer.ChannelBuffers.wrappedBuffer(nettyBuffers));
+ }
+
+ public static NettyChannelBuffers getInstance() {
+ return INSTANCE;
+ }
+}
Added: 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 (rev 0)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyChannelFuture.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -0,0 +1,102 @@
+/*
+ * 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.netty;
+
+import java.util.concurrent.TimeUnit;
+
+import org.infinispan.server.core.transport.Channel;
+import org.infinispan.server.core.transport.ChannelFuture;
+
+/**
+ * NettyChannelFuture.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+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) {
+ this.future = future;
+ this.ch = ch;
+ }
+
+ @Override
+ public ChannelFuture await() throws InterruptedException {
+ future.await();
+ return this;
+ }
+
+ @Override
+ public boolean await(long timeout, TimeUnit unit) throws InterruptedException {
+ return future.await(timeout, unit);
+ }
+
+ @Override
+ public boolean await(long timeoutMillis) throws InterruptedException {
+ return future.await(timeoutMillis);
+ }
+
+ @Override
+ public ChannelFuture awaitUninterruptibly() {
+ future.awaitUninterruptibly();
+ return this;
+ }
+
+ @Override
+ public boolean awaitUninterruptibly(long timeout, TimeUnit unit) {
+ return future.awaitUninterruptibly(timeout, unit);
+ }
+
+ @Override
+ public boolean awaitUninterruptibly(long timeoutMillis) {
+ return future.awaitUninterruptibly(timeoutMillis);
+ }
+
+ @Override
+ public Channel getChannel() {
+ return ch;
+ }
+
+ @Override
+ public boolean isCancelled() {
+ return future.isCancelled();
+ }
+
+ @Override
+ public boolean isDone() {
+ return future.isDone();
+ }
+
+ @Override
+ public boolean setFailure(Throwable cause) {
+ return future.setFailure(cause);
+ }
+
+ @Override
+ public boolean setSuccess() {
+ return future.setSuccess();
+ }
+
+}
Added: 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 (rev 0)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyChannelHandlerContext.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -0,0 +1,52 @@
+/*
+ * 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.netty;
+
+import org.infinispan.server.core.transport.Channel;
+import org.infinispan.server.core.transport.ChannelBuffers;
+import org.infinispan.server.core.transport.ChannelHandlerContext;
+
+/**
+ * NettyChannelHandlerContext.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+public class NettyChannelHandlerContext implements ChannelHandlerContext {
+ final org.jboss.netty.channel.ChannelHandlerContext ctx;
+ final Channel ch;
+
+ public NettyChannelHandlerContext(org.jboss.netty.channel.ChannelHandlerContext ctx) {
+ this.ctx = ctx;
+ this.ch = new NettyChannel(ctx.getChannel());
+ }
+
+ @Override
+ public Channel getChannel() {
+ return ch;
+ }
+
+ public ChannelBuffers getChannelBuffers() {
+ return NettyChannelBuffers.INSTANCE;
+ }
+}
Added: trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyChannelPipelineFactory.java
===================================================================
--- trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyChannelPipelineFactory.java (rev 0)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyChannelPipelineFactory.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -0,0 +1,55 @@
+/*
+ * 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.netty;
+
+import static org.jboss.netty.channel.Channels.pipeline;
+
+import org.jboss.netty.channel.ChannelHandler;
+import org.jboss.netty.channel.ChannelPipeline;
+import org.jboss.netty.channel.ChannelPipelineFactory;
+
+/**
+ * NettyChannelPipelineFactory.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+public class NettyChannelPipelineFactory implements ChannelPipelineFactory {
+ private final ChannelHandler decoder;
+ private final ChannelHandler handler;
+
+ public NettyChannelPipelineFactory(ChannelHandler decoder, ChannelHandler handler) {
+ this.decoder = decoder;
+ this.handler = handler;
+ }
+
+ @Override
+ public ChannelPipeline getPipeline() throws Exception {
+ // Create a default pipeline implementation.
+ ChannelPipeline pipeline = pipeline();
+ pipeline.addLast("decoder", decoder);
+ pipeline.addLast("handler", handler);
+ return pipeline;
+ }
+
+}
Added: 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 (rev 0)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyChannelUpstreamHandler.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -0,0 +1,69 @@
+/*
+ * 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.netty;
+
+import org.infinispan.CacheException;
+import org.infinispan.server.core.CommandHandler;
+import org.jboss.netty.channel.ChannelHandlerContext;
+import org.jboss.netty.channel.ChannelPipelineCoverage;
+import org.jboss.netty.channel.ChannelStateEvent;
+import org.jboss.netty.channel.MessageEvent;
+import org.jboss.netty.channel.SimpleChannelUpstreamHandler;
+import org.jboss.netty.channel.group.ChannelGroup;
+
+/**
+ * NettyUpstreamHandler.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+ at ChannelPipelineCoverage("one")
+public class NettyChannelUpstreamHandler extends SimpleChannelUpstreamHandler {
+ final CommandHandler handler;
+ final ChannelGroup group;
+
+ public NettyChannelUpstreamHandler(CommandHandler handler, ChannelGroup group) {
+ this.handler = handler;
+ this.group = group;
+ }
+
+ @Override
+ public void channelOpen(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
+ group.add(e.getChannel());
+ super.channelOpen(ctx, e);
+ }
+
+ @Override
+ public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception {
+ try {
+ handler.messageReceived(new NettyChannelHandlerContext(ctx), new NettyMessageEvent(e));
+ } catch (Exception ee) {
+ throw ee;
+ } catch (Throwable t) {
+ throw new CacheException(t);
+ }
+ }
+
+
+
+}
Added: 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 (rev 0)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyMessageEvent.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -0,0 +1,52 @@
+/*
+ * 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.netty;
+
+import java.net.SocketAddress;
+
+import org.infinispan.server.core.MessageEvent;
+
+/**
+ * NettyMessageEvent.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+public class NettyMessageEvent implements MessageEvent {
+ final org.jboss.netty.channel.MessageEvent event;
+
+ public NettyMessageEvent(org.jboss.netty.channel.MessageEvent event) {
+ this.event = event;
+ }
+
+ @Override
+ public Object getMessage() {
+ return event.getMessage();
+ }
+
+ @Override
+ public SocketAddress getRemoteAddress() {
+ return event.getRemoteAddress();
+ }
+
+}
Added: 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 (rev 0)
+++ trunk/server/core/src/main/java/org/infinispan/server/core/transport/netty/NettyServer.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -0,0 +1,166 @@
+/*
+ * 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.netty;
+
+import java.net.SocketAddress;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.infinispan.server.core.CommandHandler;
+import org.infinispan.server.core.Server;
+import org.infinispan.util.logging.Log;
+import org.infinispan.util.logging.LogFactory;
+import org.jboss.netty.bootstrap.ServerBootstrap;
+import org.jboss.netty.channel.Channel;
+import org.jboss.netty.channel.ChannelFactory;
+import org.jboss.netty.channel.ChannelHandler;
+import org.jboss.netty.channel.ChannelPipelineFactory;
+import org.jboss.netty.channel.group.ChannelGroup;
+import org.jboss.netty.channel.group.ChannelGroupFuture;
+import org.jboss.netty.channel.group.DefaultChannelGroup;
+import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory;
+
+/**
+ * NettyChannelFactory.
+ *
+ * @author Galder Zamarreño
+ * @since 4.0
+ */
+public class NettyServer implements Server {
+ private static final Log log = LogFactory.getLog(NettyServer.class);
+ final ChannelPipelineFactory pipeline;
+ final SocketAddress address;
+ final ChannelFactory factory;
+ final ChannelGroup serverChannels = new DefaultChannelGroup("memcached-channels");
+ final ChannelGroup acceptedChannels = new DefaultChannelGroup("memcached-accepted");
+ final ExecutorService masterExecutor;
+ final ExecutorService workerExecutor;
+
+ public NettyServer(CommandHandler commandHandler, ChannelHandler decoder, SocketAddress address,
+ int masterThreads, int workerThreads, String cacheName) {
+ ThreadFactory tf = new MemcachedThreadFactory(cacheName, ExecutorType.MASTER);
+ if (masterThreads == 0) {
+ log.debug("Configured unlimited threads for master thread pool");
+ masterExecutor = Executors.newCachedThreadPool(tf);
+ } else {
+ log.debug("Configured {0} threads for master thread pool", masterThreads);
+ masterExecutor = Executors.newFixedThreadPool(masterThreads, tf);
+ }
+
+ tf = new MemcachedThreadFactory(cacheName, ExecutorType.WORKER);
+ if (workerThreads == 0) {
+ log.debug("Configured unlimited threads for worker thread pool");
+ workerExecutor = Executors.newCachedThreadPool(tf);
+ } else {
+ log.debug("Configured {0} threads for worker thread pool", workerThreads);
+ workerExecutor = Executors.newFixedThreadPool(workerThreads, tf);
+ }
+
+ NettyChannelUpstreamHandler handler = new NettyChannelUpstreamHandler(commandHandler, acceptedChannels);
+ this.pipeline = new NettyChannelPipelineFactory(decoder, handler);
+ this.address = address;
+ if (workerThreads == 0) {
+ factory = new NioServerSocketChannelFactory(masterExecutor, workerExecutor);
+ } else {
+ factory = new NioServerSocketChannelFactory(masterExecutor, workerExecutor, workerThreads);
+ }
+ }
+
+ @Override
+ public void start() {
+ ServerBootstrap bootstrap = new ServerBootstrap(factory);
+ bootstrap.setPipelineFactory(pipeline);
+ Channel ch = bootstrap.bind(address);
+ serverChannels.add(ch);
+ }
+
+ @Override
+ public void stop() {
+ // We *pause* the acceptor so no new connections are made
+ ChannelGroupFuture future = serverChannels.unbind().awaitUninterruptibly();
+ if (!future.isCompleteSuccess()) {
+ log.warn("Server channel group did not completely unbind");
+ for (Channel ch : future.getGroup()) {
+ if (ch.isBound()) {
+ log.warn("{0} is still bound to {1}", ch, ch.getRemoteAddress());
+ }
+ }
+ }
+
+ // TODO remove workaround when integrating Netty 3.2.x - https://jira.jboss.org/jira/browse/NETTY-256
+ masterExecutor.shutdown();
+ try {
+ masterExecutor.awaitTermination(30, TimeUnit.SECONDS);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+
+ workerExecutor.shutdown();
+ serverChannels.close().awaitUninterruptibly();
+ future = acceptedChannels.close().awaitUninterruptibly();
+ if (!future.isCompleteSuccess()) {
+ log.warn("Channel group did not completely close");
+ for (Channel ch : future.getGroup()) {
+ if (ch.isBound()) {
+ log.warn(ch + " is still connected to " + ch.getRemoteAddress());
+ }
+ }
+ }
+ log.debug("Channel group completely closed, release external resources");
+ factory.releaseExternalResources();
+ }
+
+ private static class MemcachedThreadFactory implements ThreadFactory {
+ final String cacheName;
+ final ExecutorType type;
+
+ MemcachedThreadFactory(String cacheName, ExecutorType type) {
+ this.cacheName = cacheName;
+ this.type = type;
+ }
+
+ @Override
+ public Thread newThread(Runnable r) {
+ Thread t = new Thread(r, System.getProperty("program.name") + "-" + cacheName + '-' + type.toString().toLowerCase() + '-' + type.getAndIncrement());
+ t.setDaemon(true);
+ return t;
+ }
+ }
+
+ private static enum ExecutorType {
+ MASTER(1), WORKER(1);
+
+ final AtomicInteger threadCounter;
+
+ ExecutorType(int startIndex) {
+ this.threadCounter = new AtomicInteger(startIndex);
+ }
+
+ int getAndIncrement() {
+ return threadCounter.getAndIncrement();
+ }
+ }
+}
Added: trunk/server/hotrod/pom.xml
===================================================================
--- trunk/server/hotrod/pom.xml (rev 0)
+++ trunk/server/hotrod/pom.xml 2010-02-11 12:29:16 UTC (rev 1496)
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.infinispan</groupId>
+ <artifactId>infinispan-server-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>infinispan-server-hotrod</artifactId>
+ <name>Infinispan Server Hotrod Module</name>
+ <description>Infinispan server hotrod module</description>
+
+ <properties>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>infinispan-server-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+</project>
Modified: trunk/server/memcached/pom.xml
===================================================================
--- trunk/server/memcached/pom.xml 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/pom.xml 2010-02-11 12:29:16 UTC (rev 1496)
@@ -5,9 +5,9 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.infinispan</groupId>
- <artifactId>infinispan-parent</artifactId>
+ <artifactId>infinispan-server-parent</artifactId>
<version>4.0.0-SNAPSHOT</version>
- <relativePath>../parent/pom.xml</relativePath>
+ <relativePath>../pom.xml</relativePath>
</parent>
<artifactId>infinispan-server-memcached</artifactId>
@@ -15,52 +15,22 @@
<description>Infinispan server memcached module</description>
<properties>
- <version.netty>3.1.5.GA</version.netty>
<version.spymemcached>2.4.2</version.spymemcached>
- <version.gnu.getopt>1.0.13</version.gnu.getopt>
- <version.apache.log4j>1.2.15</version.apache.log4j>
</properties>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
- <artifactId>infinispan-core</artifactId>
+ <artifactId>infinispan-server-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>infinispan-core</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.netty</groupId>
- <artifactId>netty</artifactId>
- <version>${version.netty}</version>
- </dependency>
-
- <dependency>
<groupId>spy</groupId>
<artifactId>memcached</artifactId>
<version>${version.spymemcached}</version>
<scope>test</scope>
</dependency>
-
- <dependency>
- <groupId>gnu-getopt</groupId>
- <artifactId>getopt</artifactId>
- <version>${version.gnu.getopt}</version>
- </dependency>
-
- <dependency>
- <groupId>apache-log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>${version.apache.log4j}</version>
- <scope>test</scope>
- </dependency>
</dependencies>
<repositories>
Deleted: trunk/server/memcached/src/main/java/org/infinispan/server/core/Channel.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/core/Channel.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/core/Channel.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -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;
-
-
-/**
- * Channel.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
-public interface Channel extends Comparable<Channel> {
- ChannelFuture write(Object message);
- ChannelFuture disconnect();
-}
Deleted: trunk/server/memcached/src/main/java/org/infinispan/server/core/ChannelBuffer.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/core/ChannelBuffer.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/core/ChannelBuffer.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -1,34 +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;
-
-/**
- * ChannelBuffer.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
-public interface ChannelBuffer {
- byte readByte();
- void readBytes(byte[] dst, int dstIndex, int length);
-}
Deleted: trunk/server/memcached/src/main/java/org/infinispan/server/core/ChannelBuffers.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/core/ChannelBuffers.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/core/ChannelBuffers.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -1,34 +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;
-
-/**
- * ChannelBuffers.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
-public interface ChannelBuffers {
- ChannelBuffer wrappedBuffer(ChannelBuffer... buffers);
- ChannelBuffer wrappedBuffer(byte[] array);
-}
Deleted: trunk/server/memcached/src/main/java/org/infinispan/server/core/ChannelFuture.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/core/ChannelFuture.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/core/ChannelFuture.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -1,45 +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.util.concurrent.TimeUnit;
-
-/**
- * ChannelFuture.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
-public interface ChannelFuture {
- Channel getChannel();
- boolean isDone();
- boolean isCancelled();
- boolean setSuccess();
- boolean setFailure(Throwable cause);
- ChannelFuture await() throws InterruptedException;
- ChannelFuture awaitUninterruptibly();
- boolean await(long timeout, TimeUnit unit) throws InterruptedException;
- boolean await(long timeoutMillis) throws InterruptedException;
- boolean awaitUninterruptibly(long timeout, TimeUnit unit);
- boolean awaitUninterruptibly(long timeoutMillis);
-}
Deleted: trunk/server/memcached/src/main/java/org/infinispan/server/core/ChannelHandlerContext.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/core/ChannelHandlerContext.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/core/ChannelHandlerContext.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -1,34 +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;
-
-/**
- * ChannelHandlerContext.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
-public interface ChannelHandlerContext {
- Channel getChannel();
- ChannelBuffers getChannelBuffers();
-}
Deleted: trunk/server/memcached/src/main/java/org/infinispan/server/core/Command.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/core/Command.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/core/Command.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -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;
-
-/**
- * Command.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
-public interface Command {
-
- Object perform(ChannelHandlerContext ctx) throws Throwable;
-
-}
Deleted: trunk/server/memcached/src/main/java/org/infinispan/server/core/CommandDecoder.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/core/CommandDecoder.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/core/CommandDecoder.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -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;
-
-/**
- * CommandDecoder.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
-public interface CommandDecoder {
-
-}
Deleted: trunk/server/memcached/src/main/java/org/infinispan/server/core/CommandFactory.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/core/CommandFactory.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/core/CommandFactory.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -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;
-
-/**
- * CommandFactory.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
-public interface CommandFactory {
- Command createCommand(String line) throws IOException;
-}
Deleted: trunk/server/memcached/src/main/java/org/infinispan/server/core/CommandHandler.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/core/CommandHandler.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/core/CommandHandler.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -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;
-
-/**
- * CommandHandler.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
-public interface CommandHandler {
- void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Throwable;
-}
Deleted: trunk/server/memcached/src/main/java/org/infinispan/server/core/CommandInterceptor.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/core/CommandInterceptor.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/core/CommandInterceptor.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -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/memcached/src/main/java/org/infinispan/server/core/InterceptorChain.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/core/InterceptorChain.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/core/InterceptorChain.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -1,36 +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.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/memcached/src/main/java/org/infinispan/server/core/InterceptorChainFactory.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/core/InterceptorChainFactory.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/core/InterceptorChainFactory.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -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();
-}
Deleted: trunk/server/memcached/src/main/java/org/infinispan/server/core/MessageEvent.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/core/MessageEvent.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/core/MessageEvent.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -1,36 +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.net.SocketAddress;
-
-/**
- * MessageEvent.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
-public interface MessageEvent {
- Object getMessage();
- SocketAddress getRemoteAddress();
-}
Deleted: trunk/server/memcached/src/main/java/org/infinispan/server/core/ServerBootstrap.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/core/ServerBootstrap.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/core/ServerBootstrap.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -1,34 +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;
-
-/**
- * ChannelFactory.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
-public interface ServerBootstrap {
- void start();
- void stop();
-}
Deleted: trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/NettyChannel.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/NettyChannel.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/NettyChannel.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -1,56 +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.netty;
-
-import org.infinispan.server.core.Channel;
-import org.infinispan.server.core.ChannelFuture;
-
-/**
- * NettyChannel.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
-public class NettyChannel implements Channel {
- final org.jboss.netty.channel.Channel ch;
-
- public NettyChannel(org.jboss.netty.channel.Channel ch) {
- this.ch = ch;
- }
-
- @Override
- public ChannelFuture disconnect() {
- return new NettyChannelFuture(ch.disconnect(), this);
- }
-
- @Override
- public ChannelFuture write(Object message) {
- return new NettyChannelFuture(ch.write(message), this);
- }
-
- @Override
- public int compareTo(Channel o) {
- return ch.compareTo(((NettyChannel) o).ch);
- }
-
-}
Deleted: trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/NettyChannelBuffer.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/NettyChannelBuffer.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/NettyChannelBuffer.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -1,560 +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.netty;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.nio.channels.GatheringByteChannel;
-import java.nio.channels.ScatteringByteChannel;
-
-import org.infinispan.server.core.ChannelBuffer;
-import org.jboss.netty.buffer.ChannelBufferFactory;
-import org.jboss.netty.buffer.ChannelBufferIndexFinder;
-
-/**
- * NettyChannelBuffer.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
-public class NettyChannelBuffer implements ChannelBuffer, org.jboss.netty.buffer.ChannelBuffer {
- final org.jboss.netty.buffer.ChannelBuffer buffer;
-
- public NettyChannelBuffer(org.jboss.netty.buffer.ChannelBuffer buffer) {
- this.buffer = buffer;
- }
-
- @Override
- public byte readByte() {
- return buffer.readByte();
- }
-
- @Override
- public void readBytes(byte[] dst, int dstIndex, int length) {
- buffer.readBytes(dst, dstIndex, length);
- }
-
- @Override
- public int compareTo(org.jboss.netty.buffer.ChannelBuffer o) {
- return buffer.compareTo(o);
- }
-
- @Override
- public int capacity() {
- return buffer.capacity();
- }
-
- @Override
- public void clear() {
- buffer.clear();
- }
-
- @Override
- public org.jboss.netty.buffer.ChannelBuffer copy() {
- return buffer.copy();
- }
-
- @Override
- public org.jboss.netty.buffer.ChannelBuffer copy(int index, int length) {
- return buffer.copy(index, length);
- }
-
- @Override
- public void discardReadBytes() {
- buffer.discardReadBytes();
- }
-
- @Override
- public org.jboss.netty.buffer.ChannelBuffer duplicate() {
- return buffer.duplicate();
- }
-
- @Override
- public ChannelBufferFactory factory() {
- return buffer.factory();
- }
-
- @Override
- public byte getByte(int index) {
- return buffer.getByte(index);
- }
-
- @Override
- public void getBytes(int index, org.jboss.netty.buffer.ChannelBuffer dst) {
- buffer.getBytes(index, dst);
- }
-
- @Override
- public void getBytes(int index, byte[] dst) {
- buffer.getBytes(index, dst);
- }
-
- @Override
- public void getBytes(int index, ByteBuffer dst) {
- buffer.getBytes(index, dst);
- }
-
- @Override
- public void getBytes(int index, org.jboss.netty.buffer.ChannelBuffer dst, int length) {
- buffer.getBytes(index, dst, length);
- }
-
- @Override
- public void getBytes(int index, OutputStream out, int length) throws IOException {
- buffer.getBytes(index, out, length);
- }
-
- @Override
- public int getBytes(int index, GatheringByteChannel out, int length) throws IOException {
- return buffer.getBytes(index, out, length);
- }
-
- @Override
- public void getBytes(int index, org.jboss.netty.buffer.ChannelBuffer dst, int dstIndex, int length) {
- buffer.getBytes(index, dst, dstIndex, length);
- }
-
- @Override
- public void getBytes(int index, byte[] dst, int dstIndex, int length) {
- buffer.getBytes(index, dst, dstIndex, length);
- }
-
- @Override
- public int getInt(int index) {
- return buffer.getInt(index);
- }
-
- @Override
- public long getLong(int index) {
- return buffer.getLong(index);
- }
-
- @Override
- public int getMedium(int index) {
- return buffer.getMedium(index);
- }
-
- @Override
- public short getShort(int index) {
- return buffer.getShort(index);
- }
-
- @Override
- public short getUnsignedByte(int index) {
- return buffer.getUnsignedByte(index);
- }
-
- @Override
- public long getUnsignedInt(int index) {
- return buffer.getUnsignedInt(index);
- }
-
- @Override
- public int getUnsignedMedium(int index) {
- return buffer.getUnsignedMedium(index);
- }
-
- @Override
- public int getUnsignedShort(int index) {
- return buffer.getUnsignedShort(index);
- }
-
- @Override
- public int indexOf(int fromIndex, int toIndex, byte value) {
- return buffer.indexOf(fromIndex, toIndex, value);
- }
-
- @Override
- public int indexOf(int fromIndex, int toIndex, ChannelBufferIndexFinder indexFinder) {
- return buffer.indexOf(fromIndex, toIndex, indexFinder);
- }
-
- @Override
- public void markReaderIndex() {
- buffer.markReaderIndex();
- }
-
- @Override
- public void markWriterIndex() {
- buffer.markWriterIndex();
- }
-
- @Override
- public ByteOrder order() {
- return buffer.order();
- }
-
- @Override
- public org.jboss.netty.buffer.ChannelBuffer readBytes(int length) {
- return buffer.readBytes(length);
- }
-
- @Override
- public org.jboss.netty.buffer.ChannelBuffer readBytes(ChannelBufferIndexFinder indexFinder) {
- return buffer.readBytes(indexFinder);
- }
-
- @Override
- public void readBytes(org.jboss.netty.buffer.ChannelBuffer dst) {
- buffer.readBytes(dst);
- }
-
- @Override
- public void readBytes(byte[] dst) {
- buffer.readBytes(dst);
- }
-
- @Override
- public void readBytes(ByteBuffer dst) {
- buffer.readBytes(dst);
- }
-
- @Override
- public void readBytes(org.jboss.netty.buffer.ChannelBuffer dst, int length) {
- buffer.readBytes(dst, length);
- }
-
- @Override
- public void readBytes(OutputStream out, int length) throws IOException {
- buffer.readBytes(out, length);
- }
-
- @Override
- public int readBytes(GatheringByteChannel out, int length) throws IOException {
- return buffer.readBytes(out, length);
- }
-
- @Override
- public void readBytes(org.jboss.netty.buffer.ChannelBuffer dst, int dstIndex, int length) {
- buffer.readBytes(dst, dstIndex, length);
- }
-
- @Override
- public int readInt() {
- return buffer.readInt();
- }
-
- @Override
- public long readLong() {
- return buffer.readLong();
- }
-
- @Override
- public int readMedium() {
- return buffer.readMedium();
- }
-
- @Override
- public short readShort() {
- return buffer.readShort();
- }
-
- @Override
- public org.jboss.netty.buffer.ChannelBuffer readSlice(int length) {
- return buffer.readSlice(length);
- }
-
- @Override
- public org.jboss.netty.buffer.ChannelBuffer readSlice(ChannelBufferIndexFinder indexFinder) {
- return buffer.readSlice(indexFinder);
- }
-
- @Override
- public short readUnsignedByte() {
- return buffer.readUnsignedByte();
- }
-
- @Override
- public long readUnsignedInt() {
- return buffer.readUnsignedInt();
- }
-
- @Override
- public int readUnsignedMedium() {
- return buffer.readUnsignedMedium();
- }
-
- @Override
- public int readUnsignedShort() {
- return buffer.readUnsignedShort();
- }
-
- @Override
- public boolean readable() {
- return buffer.readable();
- }
-
- @Override
- public int readableBytes() {
- return buffer.readableBytes();
- }
-
- @Override
- public int readerIndex() {
- return buffer.readerIndex();
- }
-
- @Override
- public void readerIndex(int readerIndex) {
- buffer.readerIndex(readerIndex);
- }
-
- @Override
- public void resetReaderIndex() {
- buffer.resetReaderIndex();
- }
-
- @Override
- public void resetWriterIndex() {
- buffer.resetWriterIndex();
- }
-
- @Override
- public void setByte(int index, byte value) {
- buffer.setByte(index, value);
- }
-
- @Override
- public void setBytes(int index, org.jboss.netty.buffer.ChannelBuffer src) {
- buffer.setBytes(index, src);
- }
-
- @Override
- public void setBytes(int index, byte[] src) {
- buffer.setBytes(index, src);
- }
-
- @Override
- public void setBytes(int index, ByteBuffer src) {
- buffer.setBytes(index, src);
- }
-
- @Override
- public void setBytes(int index, org.jboss.netty.buffer.ChannelBuffer src, int length) {
- buffer.setBytes(index, src, length);
- }
-
- @Override
- public int setBytes(int index, InputStream in, int length) throws IOException {
- return buffer.setBytes(index, in, length);
- }
-
- @Override
- public int setBytes(int index, ScatteringByteChannel in, int length) throws IOException {
- return buffer.setBytes(index, in, length);
- }
-
- @Override
- public void setBytes(int index, org.jboss.netty.buffer.ChannelBuffer src, int srcIndex, int length) {
- buffer.setBytes(index, src, srcIndex, length);
- }
-
- @Override
- public void setBytes(int index, byte[] src, int srcIndex, int length) {
- buffer.setBytes(index, src, srcIndex, length);
- }
-
- @Override
- public void setIndex(int readerIndex, int writerIndex) {
- buffer.setIndex(readerIndex, writerIndex);
- }
-
- @Override
- public void setInt(int index, int value) {
- buffer.setInt(index, value);
- }
-
- @Override
- public void setLong(int index, long value) {
- buffer.setLong(index, value);
- }
-
- @Override
- public void setMedium(int index, int value) {
- buffer.setMedium(index, value);
- }
-
- @Override
- public void setShort(int index, short value) {
- buffer.setShort(index, value);
- }
-
- @Override
- public void setZero(int index, int length) {
- buffer.setZero(index, length);
- }
-
- @Override
- public void skipBytes(int length) {
- buffer.skipBytes(length);
- }
-
- @Override
- public int skipBytes(ChannelBufferIndexFinder indexFinder) {
- return buffer.skipBytes(indexFinder);
- }
-
- @Override
- public org.jboss.netty.buffer.ChannelBuffer slice() {
- return buffer.slice();
- }
-
- @Override
- public org.jboss.netty.buffer.ChannelBuffer slice(int index, int length) {
- return buffer.slice(index, length);
- }
-
- @Override
- public ByteBuffer toByteBuffer() {
- return buffer.toByteBuffer();
- }
-
- @Override
- public ByteBuffer toByteBuffer(int index, int length) {
- return buffer.toByteBuffer(index, length);
- }
-
- @Override
- public ByteBuffer[] toByteBuffers() {
- return buffer.toByteBuffers();
- }
-
- @Override
- public ByteBuffer[] toByteBuffers(int index, int length) {
- return buffer.toByteBuffers(index, length);
- }
-
- @Override
- public String toString(String charsetName) {
- return buffer.toString(charsetName);
- }
-
- @Override
- public String toString(String charsetName, ChannelBufferIndexFinder terminatorFinder) {
- return buffer.toString(charsetName, terminatorFinder);
- }
-
- @Override
- public String toString(int index, int length, String charsetName) {
- return buffer.toString(index, length, charsetName);
- }
-
- @Override
- public String toString(int index, int length, String charsetName, ChannelBufferIndexFinder terminatorFinder) {
- return buffer.toString(charsetName, terminatorFinder);
- }
-
- @Override
- public boolean writable() {
- return buffer.writable();
- }
-
- @Override
- public int writableBytes() {
- return buffer.writableBytes();
- }
-
- @Override
- public void writeByte(byte value) {
- buffer.writeByte(value);
- }
-
- @Override
- public void writeBytes(org.jboss.netty.buffer.ChannelBuffer src) {
- buffer.writeBytes(src);
- }
-
- @Override
- public void writeBytes(byte[] src) {
- buffer.writeBytes(src);
- }
-
- @Override
- public void writeBytes(ByteBuffer src) {
- buffer.writeBytes(src);
- }
-
- @Override
- public void writeBytes(org.jboss.netty.buffer.ChannelBuffer src, int length) {
- buffer.writeBytes(src, length);
- }
-
- @Override
- public int writeBytes(InputStream in, int length) throws IOException {
- return buffer.writeBytes(in, length);
- }
-
- @Override
- public int writeBytes(ScatteringByteChannel in, int length) throws IOException {
- return buffer.writeBytes(in, length);
- }
-
- @Override
- public void writeBytes(org.jboss.netty.buffer.ChannelBuffer src, int srcIndex, int length) {
- buffer.writeBytes(src, srcIndex, length);
- }
-
- @Override
- public void writeBytes(byte[] src, int srcIndex, int length) {
- buffer.writeBytes(src, srcIndex, length);
- }
-
- @Override
- public void writeInt(int value) {
- buffer.writeInt(value);
- }
-
- @Override
- public void writeLong(long value) {
- buffer.writeLong(value);
- }
-
- @Override
- public void writeMedium(int value) {
- buffer.writeMedium(value);
- }
-
- @Override
- public void writeShort(short value) {
- buffer.writeShort(value);
- }
-
- @Override
- public void writeZero(int length) {
- buffer.writeZero(length);
- }
-
- @Override
- public int writerIndex() {
- return buffer.writerIndex();
- }
-
- @Override
- public void writerIndex(int writerIndex) {
- buffer.writerIndex(writerIndex);
- }
-
-}
Deleted: trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/NettyChannelBuffers.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/NettyChannelBuffers.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/NettyChannelBuffers.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -1,54 +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.netty;
-
-import org.infinispan.server.core.ChannelBuffer;
-import org.infinispan.server.core.ChannelBuffers;
-
-/**
- * NettyChannelBuffers.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
-public enum NettyChannelBuffers implements ChannelBuffers {
- INSTANCE;
-
- @Override
- public ChannelBuffer wrappedBuffer(byte[] array) {
- return new NettyChannelBuffer(org.jboss.netty.buffer.ChannelBuffers.wrappedBuffer(array));
- }
-
- @Override
- public ChannelBuffer wrappedBuffer(ChannelBuffer... buffers) {
- org.jboss.netty.buffer.ChannelBuffer[] nettyBuffers = new org.jboss.netty.buffer.ChannelBuffer[buffers.length];
- for (int i =0; i < buffers.length; i++) {
- nettyBuffers[i] = ((NettyChannelBuffer) buffers[i]).buffer;
- }
- return new NettyChannelBuffer(org.jboss.netty.buffer.ChannelBuffers.wrappedBuffer(nettyBuffers));
- }
-
- public static NettyChannelBuffers getInstance() {
- return INSTANCE;
- }
-}
Deleted: trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/NettyChannelFuture.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/NettyChannelFuture.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/NettyChannelFuture.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -1,102 +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.netty;
-
-import java.util.concurrent.TimeUnit;
-
-import org.infinispan.server.core.Channel;
-import org.infinispan.server.core.ChannelFuture;
-
-/**
- * NettyChannelFuture.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
-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) {
- this.future = future;
- this.ch = ch;
- }
-
- @Override
- public ChannelFuture await() throws InterruptedException {
- future.await();
- return this;
- }
-
- @Override
- public boolean await(long timeout, TimeUnit unit) throws InterruptedException {
- return future.await(timeout, unit);
- }
-
- @Override
- public boolean await(long timeoutMillis) throws InterruptedException {
- return future.await(timeoutMillis);
- }
-
- @Override
- public ChannelFuture awaitUninterruptibly() {
- future.awaitUninterruptibly();
- return this;
- }
-
- @Override
- public boolean awaitUninterruptibly(long timeout, TimeUnit unit) {
- return future.awaitUninterruptibly(timeout, unit);
- }
-
- @Override
- public boolean awaitUninterruptibly(long timeoutMillis) {
- return future.awaitUninterruptibly(timeoutMillis);
- }
-
- @Override
- public Channel getChannel() {
- return ch;
- }
-
- @Override
- public boolean isCancelled() {
- return future.isCancelled();
- }
-
- @Override
- public boolean isDone() {
- return future.isDone();
- }
-
- @Override
- public boolean setFailure(Throwable cause) {
- return future.setFailure(cause);
- }
-
- @Override
- public boolean setSuccess() {
- return future.setSuccess();
- }
-
-}
Deleted: trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/NettyChannelHandlerContext.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/NettyChannelHandlerContext.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/NettyChannelHandlerContext.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -1,52 +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.netty;
-
-import org.infinispan.server.core.Channel;
-import org.infinispan.server.core.ChannelBuffers;
-import org.infinispan.server.core.ChannelHandlerContext;
-
-/**
- * NettyChannelHandlerContext.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
-public class NettyChannelHandlerContext implements ChannelHandlerContext {
- final org.jboss.netty.channel.ChannelHandlerContext ctx;
- final Channel ch;
-
- public NettyChannelHandlerContext(org.jboss.netty.channel.ChannelHandlerContext ctx) {
- this.ctx = ctx;
- this.ch = new NettyChannel(ctx.getChannel());
- }
-
- @Override
- public Channel getChannel() {
- return ch;
- }
-
- public ChannelBuffers getChannelBuffers() {
- return NettyChannelBuffers.INSTANCE;
- }
-}
Deleted: trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/NettyChannelPipelineFactory.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/NettyChannelPipelineFactory.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/NettyChannelPipelineFactory.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -1,55 +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.netty;
-
-import static org.jboss.netty.channel.Channels.pipeline;
-
-import org.jboss.netty.channel.ChannelHandler;
-import org.jboss.netty.channel.ChannelPipeline;
-import org.jboss.netty.channel.ChannelPipelineFactory;
-
-/**
- * NettyChannelPipelineFactory.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
-public class NettyChannelPipelineFactory implements ChannelPipelineFactory {
- private final ChannelHandler decoder;
- private final ChannelHandler handler;
-
- public NettyChannelPipelineFactory(ChannelHandler decoder, ChannelHandler handler) {
- this.decoder = decoder;
- this.handler = handler;
- }
-
- @Override
- public ChannelPipeline getPipeline() throws Exception {
- // Create a default pipeline implementation.
- ChannelPipeline pipeline = pipeline();
- pipeline.addLast("decoder", decoder);
- pipeline.addLast("handler", handler);
- return pipeline;
- }
-
-}
Deleted: trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/NettyChannelUpstreamHandler.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/NettyChannelUpstreamHandler.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/NettyChannelUpstreamHandler.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -1,69 +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.netty;
-
-import org.infinispan.CacheException;
-import org.infinispan.server.core.CommandHandler;
-import org.jboss.netty.channel.ChannelHandlerContext;
-import org.jboss.netty.channel.ChannelPipelineCoverage;
-import org.jboss.netty.channel.ChannelStateEvent;
-import org.jboss.netty.channel.MessageEvent;
-import org.jboss.netty.channel.SimpleChannelUpstreamHandler;
-import org.jboss.netty.channel.group.ChannelGroup;
-
-/**
- * NettyUpstreamHandler.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
- at ChannelPipelineCoverage("one")
-public class NettyChannelUpstreamHandler extends SimpleChannelUpstreamHandler {
- final CommandHandler handler;
- final ChannelGroup group;
-
- public NettyChannelUpstreamHandler(CommandHandler handler, ChannelGroup group) {
- this.handler = handler;
- this.group = group;
- }
-
- @Override
- public void channelOpen(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
- group.add(e.getChannel());
- super.channelOpen(ctx, e);
- }
-
- @Override
- public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception {
- try {
- handler.messageReceived(new NettyChannelHandlerContext(ctx), new NettyMessageEvent(e));
- } catch (Exception ee) {
- throw ee;
- } catch (Throwable t) {
- throw new CacheException(t);
- }
- }
-
-
-
-}
Deleted: trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/NettyMessageEvent.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/NettyMessageEvent.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/NettyMessageEvent.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -1,52 +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.netty;
-
-import java.net.SocketAddress;
-
-import org.infinispan.server.core.MessageEvent;
-
-/**
- * NettyMessageEvent.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
-public class NettyMessageEvent implements MessageEvent {
- final org.jboss.netty.channel.MessageEvent event;
-
- public NettyMessageEvent(org.jboss.netty.channel.MessageEvent event) {
- this.event = event;
- }
-
- @Override
- public Object getMessage() {
- return event.getMessage();
- }
-
- @Override
- public SocketAddress getRemoteAddress() {
- return event.getRemoteAddress();
- }
-
-}
Deleted: trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/NettyServerBootstrap.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/NettyServerBootstrap.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/NettyServerBootstrap.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -1,165 +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.netty;
-
-import java.net.SocketAddress;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ThreadFactory;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import org.infinispan.server.core.CommandHandler;
-import org.infinispan.server.core.netty.memcached.NettyMemcachedDecoder;
-import org.infinispan.util.logging.Log;
-import org.infinispan.util.logging.LogFactory;
-import org.jboss.netty.bootstrap.ServerBootstrap;
-import org.jboss.netty.channel.Channel;
-import org.jboss.netty.channel.ChannelFactory;
-import org.jboss.netty.channel.ChannelPipelineFactory;
-import org.jboss.netty.channel.group.ChannelGroup;
-import org.jboss.netty.channel.group.ChannelGroupFuture;
-import org.jboss.netty.channel.group.DefaultChannelGroup;
-import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory;
-
-/**
- * NettyChannelFactory.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
-public class NettyServerBootstrap implements org.infinispan.server.core.ServerBootstrap {
- private static final Log log = LogFactory.getLog(NettyServerBootstrap.class);
- final ChannelPipelineFactory pipeline;
- final SocketAddress address;
- final ChannelFactory factory;
- final ChannelGroup serverChannels = new DefaultChannelGroup("memcached-channels");
- final ChannelGroup acceptedChannels = new DefaultChannelGroup("memcached-accepted");
- final ExecutorService masterExecutor;
- final ExecutorService workerExecutor;
-
- public NettyServerBootstrap(CommandHandler commandHandler, NettyMemcachedDecoder decoder, SocketAddress address,
- int masterThreads, int workerThreads, String cacheName) {
- ThreadFactory tf = new MemcachedThreadFactory(cacheName, ExecutorType.MASTER);
- if (masterThreads == 0) {
- log.debug("Configured unlimited threads for master thread pool");
- masterExecutor = Executors.newCachedThreadPool(tf);
- } else {
- log.debug("Configured {0} threads for master thread pool", masterThreads);
- masterExecutor = Executors.newFixedThreadPool(masterThreads, tf);
- }
-
- tf = new MemcachedThreadFactory(cacheName, ExecutorType.WORKER);
- if (workerThreads == 0) {
- log.debug("Configured unlimited threads for worker thread pool");
- workerExecutor = Executors.newCachedThreadPool(tf);
- } else {
- log.debug("Configured {0} threads for worker thread pool", workerThreads);
- workerExecutor = Executors.newFixedThreadPool(workerThreads, tf);
- }
-
- NettyChannelUpstreamHandler handler = new NettyChannelUpstreamHandler(commandHandler, acceptedChannels);
- this.pipeline = new NettyChannelPipelineFactory(decoder, handler);
- this.address = address;
- if (workerThreads == 0) {
- factory = new NioServerSocketChannelFactory(masterExecutor, workerExecutor);
- } else {
- factory = new NioServerSocketChannelFactory(masterExecutor, workerExecutor, workerThreads);
- }
- }
-
- @Override
- public void start() {
- ServerBootstrap bootstrap = new ServerBootstrap(factory);
- bootstrap.setPipelineFactory(pipeline);
- Channel ch = bootstrap.bind(address);
- serverChannels.add(ch);
- }
-
- @Override
- public void stop() {
- // We *pause* the acceptor so no new connections are made
- ChannelGroupFuture future = serverChannels.unbind().awaitUninterruptibly();
- if (!future.isCompleteSuccess()) {
- log.warn("Server channel group did not completely unbind");
- for (Channel ch : future.getGroup()) {
- if (ch.isBound()) {
- log.warn("{0} is still bound to {1}", ch, ch.getRemoteAddress());
- }
- }
- }
-
- // TODO remove workaround when integrating Netty 3.2.x - https://jira.jboss.org/jira/browse/NETTY-256
- masterExecutor.shutdown();
- try {
- masterExecutor.awaitTermination(30, TimeUnit.SECONDS);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
-
- workerExecutor.shutdown();
- serverChannels.close().awaitUninterruptibly();
- future = acceptedChannels.close().awaitUninterruptibly();
- if (!future.isCompleteSuccess()) {
- log.warn("Channel group did not completely close");
- for (Channel ch : future.getGroup()) {
- if (ch.isBound()) {
- log.warn(ch + " is still connected to " + ch.getRemoteAddress());
- }
- }
- }
- log.debug("Channel group completely closed, release external resources");
- factory.releaseExternalResources();
- }
-
- private static class MemcachedThreadFactory implements ThreadFactory {
- final String cacheName;
- final ExecutorType type;
-
- MemcachedThreadFactory(String cacheName, ExecutorType type) {
- this.cacheName = cacheName;
- this.type = type;
- }
-
- @Override
- public Thread newThread(Runnable r) {
- Thread t = new Thread(r, System.getProperty("program.name") + "-" + cacheName + '-' + type.toString().toLowerCase() + '-' + type.getAndIncrement());
- t.setDaemon(true);
- return t;
- }
- }
-
- private static enum ExecutorType {
- MASTER(1), WORKER(1);
-
- final AtomicInteger threadCounter;
-
- ExecutorType(int startIndex) {
- this.threadCounter = new AtomicInteger(startIndex);
- }
-
- int getAndIncrement() {
- return threadCounter.getAndIncrement();
- }
- }
-}
Deleted: trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/memcached/NettyMemcachedDecoder.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/memcached/NettyMemcachedDecoder.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/core/netty/memcached/NettyMemcachedDecoder.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -1,149 +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.netty.memcached;
-
-import static org.infinispan.server.memcached.TextProtocolUtil.CR;
-import static org.infinispan.server.memcached.TextProtocolUtil.CRLF;
-import static org.infinispan.server.memcached.TextProtocolUtil.LF;
-import static org.jboss.netty.buffer.ChannelBuffers.wrappedBuffer;
-
-import java.io.IOException;
-import java.io.StreamCorruptedException;
-import java.util.concurrent.ScheduledExecutorService;
-
-import org.infinispan.Cache;
-import org.infinispan.server.core.Command;
-import org.infinispan.server.core.InterceptorChain;
-import org.infinispan.server.memcached.Reply;
-import org.infinispan.server.memcached.UnknownCommandException;
-import org.infinispan.server.memcached.commands.CommandFactory;
-import org.infinispan.server.memcached.commands.StorageCommand;
-import org.infinispan.server.memcached.commands.TextCommand;
-import org.infinispan.server.memcached.commands.Value;
-import org.infinispan.util.logging.Log;
-import org.infinispan.util.logging.LogFactory;
-import org.jboss.netty.buffer.ChannelBuffer;
-import org.jboss.netty.channel.Channel;
-import org.jboss.netty.channel.ChannelHandlerContext;
-import org.jboss.netty.channel.ExceptionEvent;
-import org.jboss.netty.handler.codec.replay.ReplayingDecoder;
-
-/**
- * NettyMemcachedDecoder.
- *
- * @author Galder Zamarreño
- * @since 4.0
- */
-public class NettyMemcachedDecoder extends ReplayingDecoder<NettyMemcachedDecoder.State> {
- private static final Log log = LogFactory.getLog(NettyMemcachedDecoder.class);
-
- private final CommandFactory factory;
- private volatile TextCommand command;
-
- protected enum State {
- READ_COMMAND, READ_UNSTRUCTURED_DATA
- }
-
- public NettyMemcachedDecoder(Cache<String, Value> cache, InterceptorChain chain, ScheduledExecutorService scheduler) {
- super(State.READ_COMMAND, true);
- factory = new CommandFactory(cache, chain, scheduler);
- }
-
- @Override
- protected Object decode(ChannelHandlerContext ctx, Channel channel, ChannelBuffer buffer, State state) throws Exception {
- switch (state) {
- case READ_COMMAND:
- command = factory.createCommand(readLine(buffer));
- if (command.getType().isStorage())
- checkpoint(State.READ_UNSTRUCTURED_DATA);
- else
- return command;
- break;
- case READ_UNSTRUCTURED_DATA:
- StorageCommand storageCmd = (StorageCommand) command;
- byte[] data= new byte[storageCmd.getParams().getBytes()];
- buffer.readBytes(data, 0, data.length);
- byte next = buffer.readByte();
- if (next == CR) {
- next = buffer.readByte();
- if (next == LF) {
- try {
- return reset(storageCmd.setData(data));
- } catch (IOException ioe) {
- checkpoint(State.READ_COMMAND);
- throw ioe;
- }
- } else {
- throw new StreamCorruptedException("Expecting \r\n after data block");
- }
- } else {
- throw new StreamCorruptedException("Expecting \r\n after data block");
- }
- }
- return null;
- }
-
- @Override
- public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception {
- Throwable t = e.getCause();
- log.error("Unexpected exception", t);
- Channel ch = ctx.getChannel();
- if (t instanceof UnknownCommandException) {
- ch.write(wrappedBuffer(wrappedBuffer(Reply.ERROR.bytes()), wrappedBuffer(CRLF)));
- } else if (t instanceof IOException) {
- StringBuilder sb = new StringBuilder();
- sb.append(Reply.CLIENT_ERROR).append(' ').append(t);
- ch.write(wrappedBuffer(wrappedBuffer(sb.toString().getBytes()), wrappedBuffer(CRLF)));
- } else {
- StringBuilder sb = new StringBuilder();
- sb.append(Reply.SERVER_ERROR).append(' ').append(t);
- ch.write(wrappedBuffer(wrappedBuffer(sb.toString().getBytes()), wrappedBuffer(CRLF)));
- }
- }
-
- private Object reset(Command c) {
- this.command = null;
- checkpoint(State.READ_COMMAND);
- return c;
- }
-
- private String readLine(ChannelBuffer buffer) {
- StringBuilder sb = new StringBuilder(64);
- int lineLength = 0;
- while (true) {
- byte next = buffer.readByte();
- if (next == CR) {
- next = buffer.readByte();
- if (next == LF) {
- return sb.toString();
- }
- } else if (next == LF) {
- return sb.toString();
- } else {
- lineLength++;
- sb.append((char) next);
- }
- }
- }
-
-}
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-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/TextServer.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -29,9 +29,9 @@
import org.infinispan.Cache;
import org.infinispan.manager.DefaultCacheManager;
-import org.infinispan.server.core.ServerBootstrap;
-import org.infinispan.server.core.netty.NettyServerBootstrap;
-import org.infinispan.server.core.netty.memcached.NettyMemcachedDecoder;
+import org.infinispan.server.core.Server;
+import org.infinispan.server.core.transport.netty.NettyServer;
+import org.infinispan.server.memcached.transport.netty.NettyMemcachedDecoder;
import org.infinispan.server.core.InterceptorChain;
import org.infinispan.server.memcached.commands.TextCommandHandler;
import org.infinispan.server.memcached.commands.Value;
@@ -53,12 +53,12 @@
private final int masterThreads;
private final int workerThreads;
private final ScheduledExecutorService scheduler;
- private ServerBootstrap bootstrap;
+ private Server server;
public TextServer(String host, int port, String configFile, int masterThreads, int workerThreads) throws IOException {
this(host, port, configFile == null
- ? new DefaultCacheManager().getCache()
- : new DefaultCacheManager(configFile).getCache(),
+ ? new DefaultCacheManager().<String, Value>getCache()
+ : new DefaultCacheManager(configFile).<String, Value>getCache(),
masterThreads, workerThreads);
if (configFile == null) {
log.debug("Using cache manager using configuration defaults");
@@ -67,7 +67,7 @@
}
}
- public TextServer(String host, int port, Cache cache, int masterThreads, int workerThreads) throws IOException {
+ public TextServer(String host, int port, Cache<String, Value> cache, int masterThreads, int workerThreads) throws IOException {
this.host = host;
this.port = port;
this.masterThreads = masterThreads;
@@ -85,15 +85,15 @@
NettyMemcachedDecoder decoder = new NettyMemcachedDecoder(cache, chain, scheduler);
TextCommandHandler commandHandler = new TextCommandHandler(cache, chain);
- bootstrap = new NettyServerBootstrap(commandHandler, decoder, new InetSocketAddress(host, port),
+ server = new NettyServer(commandHandler, decoder, new InetSocketAddress(host, port),
masterThreads, workerThreads, cache.getName());
- bootstrap.start();
+ server.start();
log.info("Started Memcached text server bound to {0}:{1}", host, port);
}
public void stop() {
- if (bootstrap != null) {
- bootstrap.stop();
+ if (server != null) {
+ server.stop();
}
cache.stop();
scheduler.shutdown();
Modified: trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/AddCommand.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/AddCommand.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/AddCommand.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -25,7 +25,7 @@
import java.util.concurrent.TimeUnit;
import org.infinispan.Cache;
-import org.infinispan.server.core.ChannelHandlerContext;
+import org.infinispan.server.core.transport.ChannelHandlerContext;
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/AppendCommand.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/AppendCommand.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/AppendCommand.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -23,7 +23,7 @@
package org.infinispan.server.memcached.commands;
import org.infinispan.Cache;
-import org.infinispan.server.core.ChannelHandlerContext;
+import org.infinispan.server.core.transport.ChannelHandlerContext;
import org.infinispan.server.memcached.Reply;
import org.infinispan.server.memcached.TextProtocolUtil;
import org.infinispan.server.memcached.interceptors.TextProtocolVisitor;
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-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/CasCommand.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -25,7 +25,7 @@
import java.io.IOException;
import org.infinispan.Cache;
-import org.infinispan.server.core.ChannelHandlerContext;
+import org.infinispan.server.core.transport.ChannelHandlerContext;
import org.infinispan.server.core.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/DecrementCommand.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/DecrementCommand.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/DecrementCommand.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -25,7 +25,7 @@
import java.math.BigInteger;
import org.infinispan.Cache;
-import org.infinispan.server.core.ChannelHandlerContext;
+import org.infinispan.server.core.transport.ChannelHandlerContext;
import org.infinispan.server.memcached.interceptors.TextProtocolVisitor;
import org.infinispan.util.logging.Log;
import org.infinispan.util.logging.LogFactory;
Modified: trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/DeleteCommand.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/DeleteCommand.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/DeleteCommand.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -25,9 +25,9 @@
import static org.infinispan.server.memcached.TextProtocolUtil.CRLF;
import org.infinispan.Cache;
-import org.infinispan.server.core.Channel;
-import org.infinispan.server.core.ChannelBuffers;
-import org.infinispan.server.core.ChannelHandlerContext;
+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.memcached.Reply;
import org.infinispan.server.memcached.interceptors.TextProtocolVisitor;
Modified: trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/FlushAllCommand.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/FlushAllCommand.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/FlushAllCommand.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -30,9 +30,9 @@
import org.infinispan.Cache;
import org.infinispan.context.Flag;
-import org.infinispan.server.core.Channel;
-import org.infinispan.server.core.ChannelBuffers;
-import org.infinispan.server.core.ChannelHandlerContext;
+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.memcached.interceptors.TextProtocolVisitor;
/**
Modified: trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/GetCommand.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/GetCommand.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/GetCommand.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -23,10 +23,10 @@
package org.infinispan.server.memcached.commands;
import org.infinispan.Cache;
-import org.infinispan.server.core.Channel;
-import org.infinispan.server.core.ChannelBuffer;
-import org.infinispan.server.core.ChannelBuffers;
-import org.infinispan.server.core.ChannelHandlerContext;
+import org.infinispan.server.core.transport.Channel;
+import org.infinispan.server.core.transport.ChannelBuffer;
+import org.infinispan.server.core.transport.ChannelBuffers;
+import org.infinispan.server.core.transport.ChannelHandlerContext;
import org.infinispan.server.memcached.interceptors.TextProtocolVisitor;
import static org.infinispan.server.memcached.TextProtocolUtil.CRLF;
Modified: trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/IncrementCommand.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/IncrementCommand.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/IncrementCommand.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -25,7 +25,7 @@
import java.math.BigInteger;
import org.infinispan.Cache;
-import org.infinispan.server.core.ChannelHandlerContext;
+import org.infinispan.server.core.transport.ChannelHandlerContext;
import org.infinispan.server.memcached.interceptors.TextProtocolVisitor;
import org.infinispan.util.logging.Log;
import org.infinispan.util.logging.LogFactory;
Modified: trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/NumericCommand.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/NumericCommand.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/NumericCommand.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -32,9 +32,9 @@
import org.infinispan.CacheException;
import org.infinispan.util.logging.Log;
import org.infinispan.util.logging.LogFactory;
-import org.infinispan.server.core.ChannelBuffers;
-import org.infinispan.server.core.ChannelHandlerContext;
-import org.infinispan.server.core.Channel;
+import org.infinispan.server.core.transport.ChannelBuffers;
+import org.infinispan.server.core.transport.ChannelHandlerContext;
+import org.infinispan.server.core.transport.Channel;
import org.infinispan.server.memcached.Reply;
/**
Modified: trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/PrependCommand.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/PrependCommand.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/PrependCommand.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -23,7 +23,7 @@
package org.infinispan.server.memcached.commands;
import org.infinispan.Cache;
-import org.infinispan.server.core.ChannelHandlerContext;
+import org.infinispan.server.core.transport.ChannelHandlerContext;
import org.infinispan.server.memcached.TextProtocolUtil;
import org.infinispan.server.memcached.interceptors.TextProtocolVisitor;
Modified: trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/QuitCommand.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/QuitCommand.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/QuitCommand.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -22,8 +22,8 @@
*/
package org.infinispan.server.memcached.commands;
-import org.infinispan.server.core.Channel;
-import org.infinispan.server.core.ChannelHandlerContext;
+import org.infinispan.server.core.transport.Channel;
+import org.infinispan.server.core.transport.ChannelHandlerContext;
import org.infinispan.server.memcached.interceptors.TextProtocolVisitor;
/**
Modified: trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/ReplaceCommand.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/ReplaceCommand.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/ReplaceCommand.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -25,7 +25,7 @@
import java.util.concurrent.TimeUnit;
import org.infinispan.Cache;
-import org.infinispan.server.core.ChannelHandlerContext;
+import org.infinispan.server.core.transport.ChannelHandlerContext;
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/SetCommand.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/SetCommand.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/SetCommand.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -27,9 +27,9 @@
import org.infinispan.Cache;
import org.infinispan.CacheException;
-import org.infinispan.server.core.Channel;
-import org.infinispan.server.core.ChannelBuffers;
-import org.infinispan.server.core.ChannelHandlerContext;
+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.memcached.Reply;
import org.infinispan.server.memcached.TextProtocolUtil;
import org.infinispan.server.memcached.interceptors.TextProtocolVisitor;
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-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/StatsCommand.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -29,9 +29,9 @@
import java.util.concurrent.TimeUnit;
import org.infinispan.Cache;
-import org.infinispan.server.core.Channel;
-import org.infinispan.server.core.ChannelBuffers;
-import org.infinispan.server.core.ChannelHandlerContext;
+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.interceptors.TextProtocolVisitor;
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-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/TextCommand.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -22,7 +22,7 @@
*/
package org.infinispan.server.memcached.commands;
-import org.infinispan.server.core.ChannelHandlerContext;
+import org.infinispan.server.core.transport.ChannelHandlerContext;
import org.infinispan.server.core.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-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/TextCommandHandler.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -23,7 +23,7 @@
package org.infinispan.server.memcached.commands;
import org.infinispan.Cache;
-import org.infinispan.server.core.ChannelHandlerContext;
+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;
Modified: trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/VersionCommand.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/VersionCommand.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/commands/VersionCommand.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -27,9 +27,9 @@
import static org.infinispan.server.memcached.TextProtocolUtil.CRLF;
import org.infinispan.Version;
-import org.infinispan.server.core.Channel;
-import org.infinispan.server.core.ChannelBuffers;
-import org.infinispan.server.core.ChannelHandlerContext;
+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.memcached.interceptors.TextProtocolVisitor;
Modified: trunk/server/memcached/src/main/java/org/infinispan/server/memcached/interceptors/AbstractVisitor.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/memcached/interceptors/AbstractVisitor.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/interceptors/AbstractVisitor.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -22,7 +22,7 @@
*/
package org.infinispan.server.memcached.interceptors;
-import org.infinispan.server.core.ChannelHandlerContext;
+import org.infinispan.server.core.transport.ChannelHandlerContext;
import org.infinispan.server.memcached.commands.AddCommand;
import org.infinispan.server.memcached.commands.AppendCommand;
import org.infinispan.server.memcached.commands.CasCommand;
Modified: trunk/server/memcached/src/main/java/org/infinispan/server/memcached/interceptors/CallInterceptor.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/memcached/interceptors/CallInterceptor.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/interceptors/CallInterceptor.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -22,7 +22,7 @@
*/
package org.infinispan.server.memcached.interceptors;
-import org.infinispan.server.core.ChannelHandlerContext;
+import org.infinispan.server.core.transport.ChannelHandlerContext;
import org.infinispan.server.memcached.commands.TextCommand;
/**
Modified: trunk/server/memcached/src/main/java/org/infinispan/server/memcached/interceptors/StatsInterceptor.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/memcached/interceptors/StatsInterceptor.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/interceptors/StatsInterceptor.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -24,7 +24,7 @@
import java.util.concurrent.atomic.AtomicLong;
-import org.infinispan.server.core.ChannelHandlerContext;
+import org.infinispan.server.core.transport.ChannelHandlerContext;
import org.infinispan.server.memcached.Reply;
import org.infinispan.server.memcached.commands.CasCommand;
import org.infinispan.server.memcached.commands.DecrementCommand;
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-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/interceptors/TextCommandInterceptor.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -22,7 +22,7 @@
*/
package org.infinispan.server.memcached.interceptors;
-import org.infinispan.server.core.ChannelHandlerContext;
+import org.infinispan.server.core.transport.ChannelHandlerContext;
import org.infinispan.server.core.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-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/interceptors/TextCommandInterceptorImpl.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -22,7 +22,7 @@
*/
package org.infinispan.server.memcached.interceptors;
-import org.infinispan.server.core.ChannelHandlerContext;
+import org.infinispan.server.core.transport.ChannelHandlerContext;
import org.infinispan.server.core.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-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/interceptors/TextProtocolInterceptorChain.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -27,7 +27,7 @@
import java.util.LinkedList;
import java.util.List;
-import org.infinispan.server.core.ChannelHandlerContext;
+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;
Modified: trunk/server/memcached/src/main/java/org/infinispan/server/memcached/interceptors/TextProtocolVisitor.java
===================================================================
--- trunk/server/memcached/src/main/java/org/infinispan/server/memcached/interceptors/TextProtocolVisitor.java 2010-02-11 10:13:20 UTC (rev 1495)
+++ trunk/server/memcached/src/main/java/org/infinispan/server/memcached/interceptors/TextProtocolVisitor.java 2010-02-11 12:29:16 UTC (rev 1496)
@@ -22,7 +22,7 @@
*/
package org.infinispan.server.memcached.interceptors;
-import org.infinispan.server.core.ChannelHandlerContext;
+import org.infinispan.server.core.transport.ChannelHandlerContext;
import org.infinispan.server.memcached.commands.AddCommand;
import org.infinispan.server.memcached.commands.AppendCommand;
import org.infinispan.server.memcached.commands.CasCommand;
More information about the infinispan-commits
mailing list