Protect against recursing.

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@369174 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2006-01-15 03:41:03 +00:00
parent 613c2705ce
commit 23334ff9a6
1 changed files with 12 additions and 6 deletions

View File

@ -78,6 +78,7 @@ public abstract class AbstractConnection implements Service, Connection, Task, C
protected final TaskRunner taskRunner;
protected final Connector connector;
private ConnectionStatistics statistics = new ConnectionStatistics();
private boolean inServiceException=false;
protected final ConcurrentHashMap connectionStates = new ConcurrentHashMap();
@ -161,12 +162,17 @@ public abstract class AbstractConnection implements Service, Connection, Task, C
}
public void serviceException(Throwable e) {
if( !disposed ) {
if( log.isDebugEnabled() )
log.debug("Async error occurred: "+e,e);
ConnectionError ce = new ConnectionError();
ce.setException(e);
dispatchAsync(ce);
if( !disposed && !inServiceException ) {
inServiceException = true;
try {
if( log.isDebugEnabled() )
log.debug("Async error occurred: "+e,e);
ConnectionError ce = new ConnectionError();
ce.setException(e);
dispatchAsync(ce);
} finally {
inServiceException = false;
}
}
}