Author: ron.sigal(a)jboss.com
Date: 2009-05-08 02:59:30 -0400 (Fri, 08 May 2009)
New Revision: 5160
Modified:
remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/ConnectionValidator.java
Log:
JBREM-1128: Separated stopped into stopping and stopped.
Modified:
remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/ConnectionValidator.java
===================================================================
---
remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/ConnectionValidator.java 2009-05-08
02:10:31 UTC (rev 5159)
+++
remoting2/branches/2.2.2-SP11_JBREM-1112/src/main/org/jboss/remoting/ConnectionValidator.java 2009-05-08
06:59:30 UTC (rev 5160)
@@ -236,6 +236,7 @@
private Object notificationLock = new Object();
private boolean started;
private volatile boolean stopped;
+ private volatile boolean stopping;
private String invokerSessionId;
private boolean tieToLease = true;
private boolean stopLeaseOnFailure = true;
@@ -305,7 +306,7 @@
".addConnectionListener() instead.");
}
- if (stopped)
+ if (stopping)
{
return;
}
@@ -326,7 +327,7 @@
try
{
- if(!stopped)
+ if(!stopping)
{
isValid = false;
@@ -378,7 +379,7 @@
{
synchronized (lock)
{
- if (stopped)
+ if (stopping)
{
log.debug(this + " is stopped. Cannot add ConnectionListener: "
+ listener + " for " + client);
return false;
@@ -414,7 +415,7 @@
}
synchronized (lock)
{
- if (stopped)
+ if (stopping)
{
log.debug(this + " is stopped. It's too late to remove " +
listener);
return false;
@@ -448,7 +449,7 @@
public long getPingPeriod()
{
- if (stopped)
+ if (stopping)
{
return -1;
}
@@ -473,11 +474,11 @@
final Throwable t = thr;
synchronized (lock)
{
- if (stopped)
+ if (stopping)
{
return;
}
- stopped = true;
+ stopping = true;
log.debug(this + " is stopped. No more listeners will be
accepted.");
Iterator itr = listeners.keySet().iterator();
@@ -750,6 +751,7 @@
{
listeners.clear();
}
+ stopping = true;
stopped = true;
timer = null;
}
Show replies by date