/*
* BEGIN INTERFACE ExceptionListener
*/
public void onException(JMSException jmse) {
BrokerErrorEvent bee = null;
isConnected = false;
/*
* Broker initiated connection close.
*/
if (ClientResources.X_BROKER_GOODBYE == jmse.getErrorCode()) {
/*
* Check to see if this BrokerAdminConn has initiated the
* shutdown. Only propagate the error message if it is
* NOT initiated by this BrokerAdminConn.
*/
if (!isInitiator()) {
bee = new BrokerErrorEvent(this, BrokerErrorEvent.ALT_SHUTDOWN);
bee.setBrokerHost(getBrokerHost());
bee.setBrokerPort(getBrokerPort());
bee.setBrokerName(getKey());
}
/*
* Broker unexpectedly shutdown.
*/
} else if (jmse.getLinkedException() instanceof EOFException) {
bee = new BrokerErrorEvent(this, BrokerErrorEvent.UNEXPECTED_SHUTDOWN);
bee.setBrokerHost(getBrokerHost());
bee.setBrokerPort(getBrokerPort());
bee.setBrokerName(getKey());
/*
* Other misc. connection problems.
*/
} else {
bee = new BrokerErrorEvent(this, BrokerErrorEvent.CONNECTION_ERROR);
bee.setBrokerHost(getBrokerHost());
bee.setBrokerPort(getBrokerPort());
bee.setBrokerName(getKey());
}
if (bee != null)
fireAdminEventDispatched(bee);
removeAllAdminEventListeners();
}