[jboss-cvs] JBoss Messaging SVN: r4304 - in trunk/src: main/org/jboss/messaging/core/client and 4 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue May 27 09:08:44 EDT 2008


Author: jmesnil
Date: 2008-05-27 09:08:44 -0400 (Tue, 27 May 2008)
New Revision: 4304

Modified:
   trunk/src/config/jbm-configuration.xml
   trunk/src/main/org/jboss/messaging/core/client/ConnectionParams.java
   trunk/src/main/org/jboss/messaging/core/client/impl/ClientConsumerImpl.java
   trunk/src/main/org/jboss/messaging/core/client/impl/ConnectionParamsImpl.java
   trunk/src/main/org/jboss/messaging/core/client/impl/RemotingConnectionImpl.java
   trunk/src/main/org/jboss/messaging/core/config/Configuration.java
   trunk/src/main/org/jboss/messaging/core/config/impl/ConfigurationImpl.java
   trunk/src/main/org/jboss/messaging/core/config/impl/FileConfiguration.java
   trunk/src/main/org/jboss/messaging/core/server/impl/ClientPingerImpl.java
Log:
all remoting time attributes (timeouts, periods, intervals) are expressed in milliseconds

Modified: trunk/src/config/jbm-configuration.xml
===================================================================
--- trunk/src/config/jbm-configuration.xml	2008-05-27 10:05:31 UTC (rev 4303)
+++ trunk/src/config/jbm-configuration.xml	2008-05-27 13:08:44 UTC (rev 4304)
@@ -21,8 +21,8 @@
       
       <remoting-host>localhost</remoting-host>
 
-      <!--  timeout in seconds -->
-      <remoting-timeout>5</remoting-timeout>
+      <!--  timeout in milliseconds -->
+      <remoting-timeout>5000</remoting-timeout>
       
       <!-- true to disable invm communication when the client and the server are in the same JVM.     -->
       <!-- it is not allowed to disable invm communication when the remoting-transport is set to INVM -->

Modified: trunk/src/main/org/jboss/messaging/core/client/ConnectionParams.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/client/ConnectionParams.java	2008-05-27 10:05:31 UTC (rev 4303)
+++ trunk/src/main/org/jboss/messaging/core/client/ConnectionParams.java	2008-05-27 13:08:44 UTC (rev 4304)
@@ -9,9 +9,9 @@
  */
 public interface ConnectionParams extends Serializable
 {
-   int DEFAULT_KEEP_ALIVE_INTERVAL = 10; // in seconds
-   int DEFAULT_KEEP_ALIVE_TIMEOUT = 5; // in seconds
-   int DEFAULT_REQRES_TIMEOUT = 5; // in seconds
+   int DEFAULT_KEEP_ALIVE_INTERVAL = 10000; // in ms
+   int DEFAULT_KEEP_ALIVE_TIMEOUT = 5000; // ms
+   int DEFAULT_REQRES_TIMEOUT = 5000; // in ms
    boolean DEFAULT_INVM_DISABLED = false;
    boolean DEFAULT_SSL_ENABLED = false;
    public final static String REMOTING_SSL_KEYSTORE_PATH = "remoting.ssl.keystore.path";
@@ -20,17 +20,17 @@
    public final static String REMOTING_SSL_TRUSTSTORE_PASSWORD = "remoting.ssl.truststore.password";
    public final static String REMOTING_ENABLE_SSL = "remoting.enable.ssl";
 
-   int getTimeout();
+   long getTimeout();
 
-   void setTimeout(int timeout);
+   void setTimeout(long timeout);
 
-   int getKeepAliveInterval();
+   long getKeepAliveInterval();
 
-   void setKeepAliveInterval(int keepAliveInterval);
+   void setKeepAliveInterval(long keepAliveInterval);
 
-   int getKeepAliveTimeout();
+   long getKeepAliveTimeout();
 
-   void setKeepAliveTimeout(int keepAliveTimeout);
+   void setKeepAliveTimeout(long keepAliveTimeout);
 
    boolean isInvmDisabled();
 

Modified: trunk/src/main/org/jboss/messaging/core/client/impl/ClientConsumerImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/client/impl/ClientConsumerImpl.java	2008-05-27 10:05:31 UTC (rev 4303)
+++ trunk/src/main/org/jboss/messaging/core/client/impl/ClientConsumerImpl.java	2008-05-27 13:08:44 UTC (rev 4304)
@@ -53,7 +53,7 @@
 
    private static final boolean trace = log.isTraceEnabled();
    
-   private static final long CLOSE_TIMEOUT_SECONDS = 10;
+   private static final long CLOSE_TIMEOUT_MILLISECONDS = 10000;
 
    // Attributes
    // -----------------------------------------------------------------------------------
@@ -413,7 +413,7 @@
       long start = System.currentTimeMillis();
       try
       {
-      	future.get(CLOSE_TIMEOUT_SECONDS, TimeUnit.SECONDS);
+      	future.get(CLOSE_TIMEOUT_MILLISECONDS, TimeUnit.MILLISECONDS);
       }
       catch (Exception e)
       {
@@ -421,7 +421,7 @@
       }
       long end = System.currentTimeMillis();
       
-      if (end - start >= CLOSE_TIMEOUT_SECONDS * 1000)
+      if (end - start >= CLOSE_TIMEOUT_MILLISECONDS)
       {
       	log.warn("Timed out waiting for handler to complete processing");
       }

Modified: trunk/src/main/org/jboss/messaging/core/client/impl/ConnectionParamsImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/client/impl/ConnectionParamsImpl.java	2008-05-27 10:05:31 UTC (rev 4303)
+++ trunk/src/main/org/jboss/messaging/core/client/impl/ConnectionParamsImpl.java	2008-05-27 13:08:44 UTC (rev 4304)
@@ -31,9 +31,9 @@
 public class ConnectionParamsImpl implements ConnectionParams
 {
 
-   protected int timeout = DEFAULT_REQRES_TIMEOUT;
-   protected int keepAliveInterval = DEFAULT_KEEP_ALIVE_INTERVAL;
-   protected int keepAliveTimeout = DEFAULT_KEEP_ALIVE_TIMEOUT;
+   protected long timeout = DEFAULT_REQRES_TIMEOUT;
+   protected long keepAliveInterval = DEFAULT_KEEP_ALIVE_INTERVAL;
+   protected long keepAliveTimeout = DEFAULT_KEEP_ALIVE_TIMEOUT;
    protected boolean invmDisabled = DEFAULT_INVM_DISABLED;
    protected boolean invmDisabledModified = false;
    protected boolean tcpNoDelay;
@@ -49,32 +49,32 @@
    protected long writeQueueMinBytes = 32 * 1024L;
    protected long writeQueueMaxBytes = 64 * 1024L;
 
-   public int getTimeout()
+   public long getTimeout()
    {
       return timeout;
    }
 
-   public void setTimeout(int timeout)
+   public void setTimeout(long timeout)
    {
       this.timeout = timeout;
    }
 
-   public int getKeepAliveInterval()
+   public long getKeepAliveInterval()
    {
       return keepAliveInterval;
    }
 
-   public void setKeepAliveInterval(int keepAliveInterval)
+   public void setKeepAliveInterval(long keepAliveInterval)
    {
       this.keepAliveInterval = keepAliveInterval;
    }
 
-   public int getKeepAliveTimeout()
+   public long getKeepAliveTimeout()
    {
       return keepAliveTimeout;
    }
 
-   public void setKeepAliveTimeout(int keepAliveTimeout)
+   public void setKeepAliveTimeout(long keepAliveTimeout)
    {
       this.keepAliveTimeout = keepAliveTimeout;
    }

Modified: trunk/src/main/org/jboss/messaging/core/client/impl/RemotingConnectionImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/client/impl/RemotingConnectionImpl.java	2008-05-27 10:05:31 UTC (rev 4303)
+++ trunk/src/main/org/jboss/messaging/core/client/impl/RemotingConnectionImpl.java	2008-05-27 13:08:44 UTC (rev 4304)
@@ -180,7 +180,7 @@
             throw new MessagingException(MessagingException.INTERNAL_ERROR);
          }
          
-         Packet response = handler.waitForResponse(1000 * connectionParams.getTimeout());
+         Packet response = handler.waitForResponse(connectionParams.getTimeout());
          
          if (response == null)
          {

Modified: trunk/src/main/org/jboss/messaging/core/config/Configuration.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/config/Configuration.java	2008-05-27 10:05:31 UTC (rev 4303)
+++ trunk/src/main/org/jboss/messaging/core/config/Configuration.java	2008-05-27 13:08:44 UTC (rev 4304)
@@ -67,11 +67,11 @@
 
    int getTcpSendBufferSize();
 
-   int getKeepAliveInterval();
+   long getKeepAliveInterval();
 
-   int getKeepAliveTimeout();
+   long getKeepAliveTimeout();
 
-   int getTimeout();
+   long getTimeout();
    
    long getWriteQueueMaxBytes();
 

Modified: trunk/src/main/org/jboss/messaging/core/config/impl/ConfigurationImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/config/impl/ConfigurationImpl.java	2008-05-27 10:05:31 UTC (rev 4303)
+++ trunk/src/main/org/jboss/messaging/core/config/impl/ConfigurationImpl.java	2008-05-27 13:08:44 UTC (rev 4304)
@@ -46,9 +46,6 @@
    public static final String REMOTING_ENABLE_SSL_SYSPROP_KEY = "jbm.remoting.enable.ssl";
 
    public static final int DEFAULT_REMOTING_PORT = 5400;
-   public static final int DEFAULT_KEEP_ALIVE_INTERVAL = 10; // in seconds
-   public static final int DEFAULT_KEEP_ALIVE_TIMEOUT = 5; // in seconds
-   public static final int DEFAULT_REQRES_TIMEOUT = 5; // in seconds
    public static final boolean DEFAULT_INVM_DISABLED = false;
    public static final boolean DEFAULT_SSL_ENABLED = false;
    public static final int DEFAULT_MAX_AIO = 3000;
@@ -99,9 +96,9 @@
    protected int port = DEFAULT_REMOTING_PORT;
    protected int serverID = 0;
    
-   protected int timeout = DEFAULT_REQRES_TIMEOUT;
-   protected int keepAliveInterval = DEFAULT_KEEP_ALIVE_INTERVAL;
-   protected int keepAliveTimeout = DEFAULT_KEEP_ALIVE_TIMEOUT;
+   protected long timeout = ConnectionParams.DEFAULT_REQRES_TIMEOUT;
+   protected long keepAliveInterval = ConnectionParams.DEFAULT_KEEP_ALIVE_INTERVAL;
+   protected long keepAliveTimeout = ConnectionParams.DEFAULT_KEEP_ALIVE_TIMEOUT;
    protected boolean invmDisabled = DEFAULT_INVM_DISABLED;
    protected boolean invmDisabledModified = false;
    protected boolean tcpNoDelay;
@@ -198,27 +195,27 @@
       this.serverID = serverID;
    }
    
-   public int getKeepAliveInterval()
+   public long getKeepAliveInterval()
    {
       return keepAliveInterval;
    }
    
-   public void setKeepAliveInterval(int keepAliveInterval)
+   public void setKeepAliveInterval(long keepAliveInterval)
    {
       this.keepAliveInterval = keepAliveInterval;
    }
 
-   public int getKeepAliveTimeout()
+   public long getKeepAliveTimeout()
    {
       return keepAliveTimeout;
    }
 
-   public void setKeepAliveTimeout(int keepAliveTimeout)
+   public void setKeepAliveTimeout(long keepAliveTimeout)
    {
       this.keepAliveTimeout = keepAliveTimeout;
    }
    
-   public int getTimeout()
+   public long getTimeout()
    {
       return timeout;
    }

Modified: trunk/src/main/org/jboss/messaging/core/config/impl/FileConfiguration.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/config/impl/FileConfiguration.java	2008-05-27 10:05:31 UTC (rev 4303)
+++ trunk/src/main/org/jboss/messaging/core/config/impl/FileConfiguration.java	2008-05-27 13:08:44 UTC (rev 4304)
@@ -29,6 +29,7 @@
 import java.net.URL;
 import java.util.ArrayList;
 
+import org.jboss.messaging.core.client.ConnectionParams;
 import org.jboss.messaging.core.remoting.TransportType;
 import org.jboss.messaging.core.server.JournalType;
 import org.jboss.messaging.util.XMLUtil;
@@ -70,7 +71,7 @@
 
       port = getInteger(e, "remoting-bind-address", DEFAULT_REMOTING_PORT);
       
-      timeout = getInteger(e, "remoting-timeout", 5);
+      timeout = getInteger(e, "remoting-timeout", ConnectionParams.DEFAULT_REQRES_TIMEOUT);
       
       invmDisabled = getBoolean(e, "remoting-disable-invm", false);
       

Modified: trunk/src/main/org/jboss/messaging/core/server/impl/ClientPingerImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/server/impl/ClientPingerImpl.java	2008-05-27 10:05:31 UTC (rev 4303)
+++ trunk/src/main/org/jboss/messaging/core/server/impl/ClientPingerImpl.java	2008-05-27 13:08:44 UTC (rev 4304)
@@ -90,7 +90,7 @@
          {
             try
             {
-               wait(server.getConfiguration().getKeepAliveInterval() * 1000);
+               wait(server.getConfiguration().getKeepAliveInterval());
             }
             catch (InterruptedException e)
             {
@@ -102,7 +102,7 @@
             sender.send(ping);
             synchronized (this)
             {
-               wait(server.getConfiguration().getKeepAliveTimeout() * 1000);
+               wait(server.getConfiguration().getKeepAliveTimeout());
             }
             if(pong == null)
             {




More information about the jboss-cvs-commits mailing list