use of com.rabbitmq.jms.util.RMQJMSException in project rabbitmq-jms-client by rabbitmq.
the class RMQConnection method close.
/**
* From the JMS Spec:
* <blockquote>
* <p>This call blocks until a
* receive or message listener in progress has completed. A blocked message consumer receive call returns null when
* this message consumer is closed.</p>
* </blockquote>
* {@inheritDoc}
*/
@Override
public void close() throws JMSException {
logger.trace("closing connection ({})", this);
if (this.closed)
return;
this.closed = true;
removeClientID();
// We null any exception listener since we don't want it driven during close().
this.exceptionListener.set(null);
closeAllSessions();
try {
this.rabbitConnection.close();
} catch (ShutdownSignalException x) {
// nothing to do
} catch (IOException x) {
if (!(x.getCause() instanceof ShutdownSignalException)) {
throw new RMQJMSException(x);
}
}
}
Aggregations