mirror of https://github.com/apache/activemq.git
Avoid the ugly 'Async exception with no exception listener' message from showing up in the output when shutting down the broker.
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@648250 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2d5c942bb2
commit
ce7495ec1e
|
@ -1692,7 +1692,7 @@ public class ActiveMQConnection implements Connection, TopicConnection, QueueCon
|
||||||
});
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
LOG.warn("Async exception with no exception listener: " + error, error);
|
LOG.debug("Async exception with no exception listener: " + error, error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@ package org.apache.activemq.broker.util;
|
||||||
import javax.jms.Connection;
|
import javax.jms.Connection;
|
||||||
import javax.jms.ConnectionFactory;
|
import javax.jms.ConnectionFactory;
|
||||||
import javax.jms.Destination;
|
import javax.jms.Destination;
|
||||||
|
import javax.jms.ExceptionListener;
|
||||||
import javax.jms.JMSException;
|
import javax.jms.JMSException;
|
||||||
import javax.jms.MessageConsumer;
|
import javax.jms.MessageConsumer;
|
||||||
import javax.jms.Session;
|
import javax.jms.Session;
|
||||||
|
@ -39,7 +40,7 @@ import org.springframework.beans.factory.InitializingBean;
|
||||||
* @version $Revision$
|
* @version $Revision$
|
||||||
* @org.apache.xbean.XBean
|
* @org.apache.xbean.XBean
|
||||||
*/
|
*/
|
||||||
public class CommandAgent implements Service, InitializingBean, DisposableBean, FactoryBean {
|
public class CommandAgent implements Service, InitializingBean, DisposableBean, FactoryBean, ExceptionListener {
|
||||||
private static final Log LOG = LogFactory.getLog(CommandAgent.class);
|
private static final Log LOG = LogFactory.getLog(CommandAgent.class);
|
||||||
|
|
||||||
private String brokerUrl = "vm://localhost";
|
private String brokerUrl = "vm://localhost";
|
||||||
|
@ -137,6 +138,7 @@ public class CommandAgent implements Service, InitializingBean, DisposableBean,
|
||||||
public Connection getConnection() throws JMSException {
|
public Connection getConnection() throws JMSException {
|
||||||
if (connection == null) {
|
if (connection == null) {
|
||||||
connection = createConnection();
|
connection = createConnection();
|
||||||
|
connection.setExceptionListener(this);
|
||||||
connection.start();
|
connection.start();
|
||||||
}
|
}
|
||||||
return connection;
|
return connection;
|
||||||
|
@ -164,4 +166,11 @@ public class CommandAgent implements Service, InitializingBean, DisposableBean,
|
||||||
protected Destination createCommandDestination() {
|
protected Destination createCommandDestination() {
|
||||||
return AdvisorySupport.getAgentDestination();
|
return AdvisorySupport.getAgentDestination();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onException(JMSException exception) {
|
||||||
|
try {
|
||||||
|
stop();
|
||||||
|
} catch (Exception e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue