Author: ron.sigal(a)jboss.com
Date: 2009-05-04 21:52:00 -0400 (Mon, 04 May 2009)
New Revision: 5128
Modified:
remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/MicroRemoteClientInvoker.java
Log:
JBREM-1112 (and others to be named): (1) establishLease() calls
client.addConnectionListener(); (2) terminateLease() takes LeasePinger parameter..
Modified:
remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/MicroRemoteClientInvoker.java
===================================================================
---
remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/MicroRemoteClientInvoker.java 2009-05-05
01:49:23 UTC (rev 5127)
+++
remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/MicroRemoteClientInvoker.java 2009-05-05
01:52:00 UTC (rev 5128)
@@ -337,8 +337,18 @@
public void terminateLease(String sessionId, int disconnectTimeout)
{
+ terminateLease(sessionId, disconnectTimeout, null);
+ }
+
+ public void terminateLease(String sessionId, int disconnectTimeout, LeasePinger
passedLeasePinger)
+ {
synchronized(clientLeaseLock)
{
+ if (passedLeasePinger != leasePinger)
+ {
+ log.debug(this + ": " + passedLeasePinger + " != " +
leasePinger);
+ return;
+ }
if(leasePinger != null)
{
leasePinger.setDisconnectTimeout(disconnectTimeout);
@@ -402,6 +412,9 @@
public void establishLease(String clientSessionID, Map configuration, long
leasePeriod)
throws Throwable
{
+ Client client = (Client) configuration.get(Client.CLIENT);
+ ConnectionListener listener = (ConnectionListener)
configuration.remove(Client.CONNECTION_LISTENER);
+
synchronized (clientLeaseLock)
{
// if already have a lease pinger, then already have a client with an
established
@@ -464,6 +477,15 @@
e.initCause(throwable);
throw e;
}
+ finally
+ {
+// Client client = (Client) configuration.get(Client.CLIENT);
+// ConnectionListener listener = (ConnectionListener)
configuration.get(Client.CONNECTION_LISTENER);
+ if (client != null && listener != null)
+ {
+ client.addConnectionListener(listener, configuration);
+ }
+ }
}
}
Show replies by date