[jboss-remoting-commits] JBoss Remoting SVN: r5943 - remoting2/branches/2.2/src/main/org/jboss/remoting.

jboss-remoting-commits at lists.jboss.org jboss-remoting-commits at lists.jboss.org
Sat Jul 31 09:41:57 EDT 2010


Author: ron.sigal at jboss.com
Date: 2010-07-31 09:41:57 -0400 (Sat, 31 Jul 2010)
New Revision: 5943

Modified:
   remoting2/branches/2.2/src/main/org/jboss/remoting/MicroRemoteClientInvoker.java
Log:
JBREM-1238: Added use of leaseCreationTimeout.

Modified: remoting2/branches/2.2/src/main/org/jboss/remoting/MicroRemoteClientInvoker.java
===================================================================
--- remoting2/branches/2.2/src/main/org/jboss/remoting/MicroRemoteClientInvoker.java	2010-07-31 13:41:18 UTC (rev 5942)
+++ remoting2/branches/2.2/src/main/org/jboss/remoting/MicroRemoteClientInvoker.java	2010-07-31 13:41:57 UTC (rev 5943)
@@ -32,6 +32,7 @@
 public abstract class MicroRemoteClientInvoker extends AbstractInvoker implements ClientInvoker
 {
    private static final Logger log = Logger.getLogger(MicroRemoteClientInvoker.class);
+   private static final String LEASE_CREATION_TIMEOUT_DEFAULT = "30000";
    private boolean trace = log.isTraceEnabled();
 
    protected boolean connected = false;
@@ -44,6 +45,7 @@
    private boolean parentFirstClassLoading = true;
    private boolean changeInvalidStateToCannotConnect = false;
    private boolean useCurrentThreadClassLoader;
+   private String leaseCreationTimeout = LEASE_CREATION_TIMEOUT_DEFAULT;
 
    public MicroRemoteClientInvoker(InvokerLocator locator)
    {
@@ -343,6 +345,16 @@
       return this.invokerSessionID;
    }
 
+   public String getLeaseCreationTimeout()
+   {
+      return leaseCreationTimeout;
+   }
+
+   public void setLeaseCreationTimeout(String leaseCreationTimeout)
+   {
+      this.leaseCreationTimeout = leaseCreationTimeout;
+   }
+
    public void terminateLease(String sessionId, int disconnectTimeout)
    {
       terminateLease(sessionId, disconnectTimeout, null);
@@ -360,6 +372,10 @@
          if (trace) log.trace(this + " entering terminateLease() for " + leasePinger);
          if(leasePinger != null)
          {
+            if (disconnectTimeout == Client.DEFAULT_DISCONNECT_TIMEOUT)
+            {
+            	disconnectTimeout = Integer.parseInt(leaseCreationTimeout);
+            }
             leasePinger.setDisconnectTimeout(disconnectTimeout);
             
             if (sessionId == null)
@@ -468,6 +484,7 @@
                Map requestMap = new HashMap();
                requestMap.put(LeasePinger.LEASE_PINGER_ID, leasePingerId);
                requestMap.put(LeasePinger.TIME_STAMP, Long.toString(System.currentTimeMillis()));
+               requestMap.put(ServerInvoker.TIMEOUT, leaseCreationTimeout);
                if (trace) log.trace(this + " initiating lease for leasePingerId " + leasePingerId);
                InvocationRequest ir = new InvocationRequest(invokerSessionID, null, "$PING$", requestMap, new HashMap(), null);
 



More information about the jboss-remoting-commits mailing list