[infinispan-commits] Infinispan SVN: r1828 - in trunk/server/core/src/main/scala/org/infinispan/server/core: transport/netty and 1 other directory.

infinispan-commits at lists.jboss.org infinispan-commits at lists.jboss.org
Wed May 19 11:48:39 EDT 2010


Author: galder.zamarreno at jboss.com
Date: 2010-05-19 11:48:39 -0400 (Wed, 19 May 2010)
New Revision: 1828

Modified:
   trunk/server/core/src/main/scala/org/infinispan/server/core/Main.scala
   trunk/server/core/src/main/scala/org/infinispan/server/core/transport/netty/NettyChannelPipelineFactory.scala
Log:
[ISPN-443] (Errors/typos in startServer.sh) Fixed and set disable to -1.

Modified: trunk/server/core/src/main/scala/org/infinispan/server/core/Main.scala
===================================================================
--- trunk/server/core/src/main/scala/org/infinispan/server/core/Main.scala	2010-05-19 15:33:33 UTC (rev 1827)
+++ trunk/server/core/src/main/scala/org/infinispan/server/core/Main.scala	2010-05-19 15:48:39 UTC (rev 1828)
@@ -12,7 +12,8 @@
 import org.infinispan.manager.{CacheManager, DefaultCacheManager}
 
 /**
- * // TODO: Document this
+ * Main class for server startup.
+ *
  * @author Galder Zamarreño
  * @since 4.1
  */
@@ -94,8 +95,8 @@
          showAndExit
       }
       val idleTimeout = if (props.get(PROP_KEY_IDLE_TIMEOUT) == None) IDLE_TIMEOUT_DEFAULT else props.get(PROP_KEY_IDLE_TIMEOUT).get.toInt
-      if (idleTimeout < 0)
-         throw new IllegalArgumentException("Idle timeout can't be lower than 0: " + idleTimeout)
+      if (idleTimeout < -1)
+         throw new IllegalArgumentException("Idle timeout can't be lower than -1: " + idleTimeout)
 
       // TODO: move class name and protocol number to a resource file under the corresponding project
       val clazz = protocol.get match {
@@ -123,7 +124,7 @@
 
    private def processCommandLine(args: Array[String]) {
       programName = System.getProperty("program.name", "startServer")
-      var sopts = "-:hD:Vp:l:m:t:c:r:"
+      var sopts = "-:hD:Vp:l:m:t:c:r:i:"
       var lopts = Array(
          new LongOpt("help", LongOpt.NO_ARGUMENT, null, 'h'),
          new LongOpt("version", LongOpt.NO_ARGUMENT, null, 'V'),
@@ -200,12 +201,12 @@
       println
       println("    -c, --cache_config=<filename>      Cache configuration file (default: creates cache with default values)")
       println
-      println("    -r, --protocol=                    Protocol to understand by the server. This is a mandatory option and you should choose one of the two options")
+      println("    -r, --protocol=                    Protocol to understand by the server. This is a mandatory option and you should choose one of these options")
       println("          [memcached|hotrod|websocket]")
       println
       println("    -i, --idle_timeout=<num>           Idle read timeout, in seconds, used to detect stale connections (default: 60 seconds).")
       println("                                       If no new messages have been read within this time, the server disconnects the channel.")
-      println("                                       Passing 0 disables idle timeout.")
+      println("                                       Passing -1 disables idle timeout.")
       println
       println("    -D<name>[=<value>]                 Set a system property")
       println

Modified: trunk/server/core/src/main/scala/org/infinispan/server/core/transport/netty/NettyChannelPipelineFactory.scala
===================================================================
--- trunk/server/core/src/main/scala/org/infinispan/server/core/transport/netty/NettyChannelPipelineFactory.scala	2010-05-19 15:33:33 UTC (rev 1827)
+++ trunk/server/core/src/main/scala/org/infinispan/server/core/transport/netty/NettyChannelPipelineFactory.scala	2010-05-19 15:48:39 UTC (rev 1828)
@@ -7,7 +7,10 @@
 import org.jboss.netty.util.{HashedWheelTimer, Timer}
 
 /**
- * // TODO: Document this
+ * Pipeline factory for Netty based channels. For each pipeline created, a new decoder is created which means that
+ * each incoming connection deals with a unique decoder instance. Since the encoder does not maintain any state,
+ * a single encoder instance is shared by all incoming connections, if and only if, the protocol mandates an encoder.
+ *
  * @author Galder Zamarreño
  * @since 4.1
  */
@@ -22,7 +25,8 @@
       pipeline.addLast("decoder", new DecoderAdapter(server.getDecoder, transport))
       if (encoder != null)
          pipeline.addLast("encoder", encoder)
-      if (idleTimeout != 0) {
+      // Idle timeout logic is disabled with -1 or 0 values
+      if (idleTimeout > 0) {
          timer = new HashedWheelTimer
          pipeline.addLast("idleHandler", new IdleStateHandler(timer, idleTimeout, 0, 0))
          pipeline.addLast("idleHandlerProvider", new IdleStateHandlerProvider)



More information about the infinispan-commits mailing list