Author: ron.sigal(a)jboss.com
Date: 2008-02-25 19:50:56 -0500 (Mon, 25 Feb 2008)
New Revision: 3504
Modified:
remoting2/branches/2.2/src/main/org/jboss/remoting/MicroRemoteClientInvoker.java
Log:
JBREM-892: Added facility for forcing shut down of LeasePinger.
Modified:
remoting2/branches/2.2/src/main/org/jboss/remoting/MicroRemoteClientInvoker.java
===================================================================
---
remoting2/branches/2.2/src/main/org/jboss/remoting/MicroRemoteClientInvoker.java 2008-02-26
00:48:33 UTC (rev 3503)
+++
remoting2/branches/2.2/src/main/org/jboss/remoting/MicroRemoteClientInvoker.java 2008-02-26
00:50:56 UTC (rev 3504)
@@ -308,6 +308,11 @@
{
return this.unmarshaller;
}
+
+ public String getSessionId()
+ {
+ return this.invokerSessionID;
+ }
public void terminateLease(String sessionId, int disconnectTimeout)
{
@@ -316,19 +321,39 @@
if(leasePinger != null)
{
leasePinger.setDisconnectTimeout(disconnectTimeout);
- boolean isLastClientLease = leasePinger.removeClient(sessionId);
- if(isLastClientLease)
+
+ if (sessionId == null)
{
+ // Independent of any particular Client - force LeasePinger shutdown.
+ // Should be called only if there is a reasonable belief that the lease
+ // has already stopped on the server side.
try
{
leasePinger.stopPing();
}
catch (Exception e)
{
- log.error("error shutting down lease pinger");
+ log.debug("error shutting down lease pinger");
}
leasePinger = null;
}
+ else
+ {
+ // Remove a particular Client.
+ boolean isLastClientLease = leasePinger.removeClient(sessionId);
+ if(isLastClientLease)
+ {
+ try
+ {
+ leasePinger.stopPing();
+ }
+ catch (Exception e)
+ {
+ log.debug("error shutting down lease pinger");
+ }
+ leasePinger = null;
+ }
+ }
}
}
}
Show replies by date