[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting ...
Tom Elrod
tom.elrod at jboss.com
Tue Dec 12 09:41:16 EST 2006
User: telrod
Date: 06/12/12 09:41:16
Modified: src/main/org/jboss/remoting Tag: remoting_2_x
ConnectionValidator.java
Log:
JBREM-648 - fix for NPE on connection validator after client disconnect.
Revision Changes Path
No revision
No revision
1.13.2.2 +25 -11 JBossRemoting/src/main/org/jboss/remoting/ConnectionValidator.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ConnectionValidator.java
===================================================================
RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/ConnectionValidator.java,v
retrieving revision 1.13.2.1
retrieving revision 1.13.2.2
diff -u -b -r1.13.2.1 -r1.13.2.2
--- ConnectionValidator.java 12 Dec 2006 04:55:30 -0000 1.13.2.1
+++ ConnectionValidator.java 12 Dec 2006 14:41:16 -0000 1.13.2.2
@@ -45,6 +45,9 @@
protected static final Logger log = Logger.getLogger(ConnectionValidator.class.getName());
+ private Object lock = new Object();
+ private boolean stopped = false;
+
/**
* Default ping period. Value is 2 seconds.
*/
@@ -64,15 +67,20 @@
private void start()
{
TimerUtil.schedule(this, pingPeriod);
+ stopped = false;
}
public void stop()
{
+ synchronized(lock)
+ {
cancel();
if (!listeners.isEmpty())
{
listeners.clear();
}
+ stopped = true;
+ }
}
@@ -113,6 +121,10 @@
*/
public void run()
{
+ synchronized(lock)
+ {
+ if(!stopped)
+ {
try
{
boolean isValid = checkConnection(client.getInvoker().getLocator(), client.getConfiguration());
@@ -126,6 +138,8 @@
notifyListeners(thr);
}
}
+ }
+ }
private void notifyListeners(Throwable thr)
{
More information about the jboss-cvs-commits
mailing list