* @throws Exception
* @org.apache.xbean.DestroyMethod
*/
@PreDestroy
public void stop() throws Exception {
ServiceStopper stopper = new ServiceStopper();
if (consumer != null) {
try {
consumer.close();
consumer = null;
} catch (JMSException e) {
stopper.onException(this, e);
}
}
if (session != null) {
try {
session.close();
session = null;
} catch (JMSException e) {
stopper.onException(this, e);
}
}
if (connection != null) {
try {
connection.close();
connection = null;
} catch (JMSException e) {
stopper.onException(this, e);
}
}
stopper.throwFirstException();
}