activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1440225 - /activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java
Date Wed, 30 Jan 2013 00:19:46 GMT
Author: tabish
Date: Wed Jan 30 00:19:45 2013
New Revision: 1440225

URL: http://svn.apache.org/viewvc?rev=1440225&view=rev
Log:
Wrap a couple of heavier LOG calls in quick tests for enabled. 

Modified:
    activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java

Modified: activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java?rev=1440225&r1=1440224&r2=1440225&view=diff
==============================================================================
--- activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java
(original)
+++ activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java
Wed Jan 30 00:19:45 2013
@@ -322,7 +322,10 @@ public abstract class DemandForwardingBr
                     if (l != null) {
                         l.onStart(this);
                     }
-                    LOG.info("Network connection between " + localBroker + " and " + remoteBroker
+ "(" + remoteBrokerName + ") has been established.");
+
+                    if (LOG.isInfoEnabled()) {
+                        LOG.info("Network connection between " + localBroker + " and " +
remoteBroker + "(" + remoteBrokerName + ") has been established.");
+                    }
 
                 } else {
                     LOG.warn("Bridge was disposed before the startLocalBridge() method was
fully executed.");
@@ -400,7 +403,9 @@ public abstract class DemandForwardingBr
     public void stop() throws Exception {
         if (started.compareAndSet(true, false)) {
             if (disposed.compareAndSet(false, true)) {
-                LOG.debug(" stopping " + configuration.getBrokerName() + " bridge to " +
remoteBrokerName);
+                if (LOG.isDebugEnabled()) {
+                    LOG.debug(" stopping " + configuration.getBrokerName() + " bridge to
" + remoteBrokerName);
+                }
                 NetworkBridgeListener l = this.networkBridgeListener;
                 if (l != null) {
                     l.onStop(this);
@@ -416,12 +421,16 @@ public abstract class DemandForwardingBr
                                 serialExecutor.shutdown();
                                 if (!serialExecutor.awaitTermination(5, TimeUnit.SECONDS))
{
                                     List<Runnable> pendingTasks = serialExecutor.shutdownNow();
-                                    LOG.info("pending tasks on stop" + pendingTasks);
+                                    if (LOG.isInfoEnabled()) {
+                                        LOG.info("pending tasks on stop" + pendingTasks);
+                                    }
                                 }
                                 localBroker.oneway(new ShutdownInfo());
                                 remoteBroker.oneway(new ShutdownInfo());
                             } catch (Throwable e) {
-                                LOG.debug("Caught exception sending shutdown", e);
+                                if (LOG.isDebugEnabled()) {
+                                    LOG.debug("Caught exception sending shutdown", e);
+                                }
                             } finally {
                                 sendShutdown.countDown();
                             }
@@ -450,7 +459,9 @@ public abstract class DemandForwardingBr
             if (remoteBrokerInfo != null) {
                 brokerService.getBroker().removeBroker(null, remoteBrokerInfo);
                 brokerService.getBroker().networkBridgeStopped(remoteBrokerInfo);
-                LOG.info(configuration.getBrokerName() + " bridge to " + remoteBrokerName
+ " stopped");
+                if (LOG.isInfoEnabled()) {
+                    LOG.info(configuration.getBrokerName() + " bridge to " + remoteBrokerName
+ " stopped");
+                }
             }
         }
     }
@@ -756,8 +767,14 @@ public abstract class DemandForwardingBr
                 }
                 return;
             }
-            LOG.info("Network connection between " + localBroker + " and " + remoteBroker
+ " shutdown due to a local error: " + error);
-            LOG.debug("The local Exception was:" + error, error);
+
+            if (LOG.isInfoEnabled()) {
+                LOG.info("Network connection between " + localBroker + " and " + remoteBroker
+ " shutdown due to a local error: " + error);
+            }
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("The local Exception was:" + error, error);
+            }
+
             brokerService.getTaskRunnerFactory().execute(new Runnable() {
                 @Override
                 public void run() {



Mime
View raw message