if (exc == null)
{
return;
}
ConnectionClose close = exc.getClose();
if (close == null || close.getReplyCode() == ConnectionCloseCode.CONNECTION_FORCED)
{
_conn.getProtocolHandler().setFailoverLatch(new CountDownLatch(1));
_qpidConnection.notifyFailoverRequired();
synchronized (_conn.getFailoverMutex())
{
try
{
if (_conn.firePreFailover(false) && _conn.attemptReconnection())
{
_conn.failoverPrep();
_conn.resubscribeSessions();
_conn.fireFailoverComplete();
return;
}
}
catch (Exception e)
{
_logger.error("error during failover", e);
}
finally
{
_conn.getProtocolHandler().getFailoverLatch().countDown();
_conn.getProtocolHandler().setFailoverLatch(null);
}
}
}
_conn.setClosed();
ExceptionListener listener = _conn.getExceptionListenerNoCheck();
if (listener == null)
{
_logger.error("connection exception: " + conn, exc);
}
else
{
String code = null;
if (close != null)
{
code = close.getReplyCode().toString();
}
JMSException ex = new JMSException(exc.getMessage(), code);
ex.setLinkedException(exc);
ex.initCause(exc);