activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r648250 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq: ActiveMQConnection.java broker/util/CommandAgent.java
Date Tue, 15 Apr 2008 13:40:21 GMT
Author: chirino
Date: Tue Apr 15 06:40:10 2008
New Revision: 648250

URL: http://svn.apache.org/viewvc?rev=648250&view=rev
Log:
Avoid the ugly  'Async exception with no exception listener' message from showing up in the
output when shutting down the broker.


Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/util/CommandAgent.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java?rev=648250&r1=648249&r2=648250&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
Tue Apr 15 06:40:10 2008
@@ -1692,7 +1692,7 @@
                 });
 
             } else {
-                LOG.warn("Async exception with no exception listener: " + error, error);
+                LOG.debug("Async exception with no exception listener: " + error, error);
             }
         }
     }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/util/CommandAgent.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/util/CommandAgent.java?rev=648250&r1=648249&r2=648250&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/util/CommandAgent.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/util/CommandAgent.java
Tue Apr 15 06:40:10 2008
@@ -19,6 +19,7 @@
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.Destination;
+import javax.jms.ExceptionListener;
 import javax.jms.JMSException;
 import javax.jms.MessageConsumer;
 import javax.jms.Session;
@@ -39,7 +40,7 @@
  * @version $Revision$
  * @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 String brokerUrl = "vm://localhost";
@@ -137,6 +138,7 @@
     public Connection getConnection() throws JMSException {
         if (connection == null) {
             connection = createConnection();
+            connection.setExceptionListener(this);
             connection.start();
         }
         return connection;
@@ -163,5 +165,12 @@
 
     protected Destination createCommandDestination() {
         return AdvisorySupport.getAgentDestination();
+    }
+
+    public void onException(JMSException exception) {
+        try {
+            stop();
+        } catch (Exception e) {
+        }
     }
 }



Mime
View raw message