mirror of https://github.com/apache/activemq.git
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:
parent
613c2705ce
commit
23334ff9a6
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue