[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting ...
Tom Elrod
tom.elrod at jboss.com
Tue Nov 7 11:19:30 EST 2006
User: telrod
Date: 06/11/07 11:19:30
Modified: src/main/org/jboss/remoting Tag: remoting_2_x Lease.java
ServerInvoker.java
Log:
JBREM-629 - fixes for NPE within Lease when notifies of client lost
Revision Changes Path
No revision
No revision
1.11.2.1 +11 -4 JBossRemoting/src/main/org/jboss/remoting/Lease.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Lease.java
===================================================================
RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/Lease.java,v
retrieving revision 1.11
retrieving revision 1.11.2.1
diff -u -b -r1.11 -r1.11.2.1
--- Lease.java 26 Sep 2006 02:27:52 -0000 1.11
+++ Lease.java 7 Nov 2006 16:19:30 -0000 1.11.2.1
@@ -242,6 +242,8 @@
}
else
{
+ try
+ {
stopLease();
notifyClientLost();
if (clientLeases != null)
@@ -249,6 +251,11 @@
clientLeases.remove(clientSessionId);
}
}
+ catch (Throwable thr)
+ {
+ log.error("Error terminating client lease and sending notification of lost client.", thr);
+ }
+ }
}
}
}
\ No newline at end of file
1.52.2.2 +16 -20 JBossRemoting/src/main/org/jboss/remoting/ServerInvoker.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ServerInvoker.java
===================================================================
RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/ServerInvoker.java,v
retrieving revision 1.52.2.1
retrieving revision 1.52.2.2
diff -u -b -r1.52.2.1 -r1.52.2.2
--- ServerInvoker.java 2 Nov 2006 18:47:21 -0000 1.52.2.1
+++ ServerInvoker.java 7 Nov 2006 16:19:30 -0000 1.52.2.2
@@ -58,7 +58,7 @@
*
* @author <a href="mailto:jhaynie at vocalocity.net">Jeff Haynie</a>
* @author <a href="mailto:tom.elrod at jboss.com">Tom Elrod</a>
- * @version $Revision: 1.52.2.1 $
+ * @version $Revision: 1.52.2.2 $
*/
public abstract class ServerInvoker extends AbstractInvoker implements ServerInvokerMBean
{
@@ -180,7 +180,7 @@
private long leasePeriod = DEFAULT_CLIENT_LEASE_PERIOD;
private boolean leaseManagement = false;
private Map clientLeases = new HashMap();
- protected ConnectionNotifier connectionNotifier = null;
+ protected ConnectionNotifier connectionNotifier = new ConnectionNotifier();
protected ServerSocketFactory serverSocketFactory = null;
@@ -541,11 +541,6 @@
public void addConnectionListener(ConnectionListener listener)
{
- if(connectionNotifier == null)
- {
- connectionNotifier = new ConnectionNotifier();
- }
-
connectionNotifier.addListener(listener);
if(leasePeriod > 0)
@@ -559,7 +554,7 @@
if(connectionNotifier != null)
{
connectionNotifier.removeListener(listener);
- }
+
// turn off lease management if no listeners (since no one to tell client died)
if(connectionNotifier.size() == 0)
{
@@ -577,6 +572,7 @@
clientLeases.clear();
}
}
+ }
/**
* Sets the amount of time (in milliseconds) that a client should renew its lease.
More information about the jboss-cvs-commits
mailing list