Wrap a couple of heavier LOG calls in quick tests for enabled.

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1440225 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Timothy A. Bish 2013-01-30 00:19:45 +00:00
parent 5fc2535edf
commit a5dd237a60
1 changed files with 24 additions and 7 deletions

View File

@ -322,7 +322,10 @@ public abstract class DemandForwardingBridgeSupport implements NetworkBridge, Br
if (l != null) { if (l != null) {
l.onStart(this); 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 { } else {
LOG.warn("Bridge was disposed before the startLocalBridge() method was fully executed."); LOG.warn("Bridge was disposed before the startLocalBridge() method was fully executed.");
@ -400,7 +403,9 @@ public abstract class DemandForwardingBridgeSupport implements NetworkBridge, Br
public void stop() throws Exception { public void stop() throws Exception {
if (started.compareAndSet(true, false)) { if (started.compareAndSet(true, false)) {
if (disposed.compareAndSet(false, true)) { 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; NetworkBridgeListener l = this.networkBridgeListener;
if (l != null) { if (l != null) {
l.onStop(this); l.onStop(this);
@ -416,12 +421,16 @@ public abstract class DemandForwardingBridgeSupport implements NetworkBridge, Br
serialExecutor.shutdown(); serialExecutor.shutdown();
if (!serialExecutor.awaitTermination(5, TimeUnit.SECONDS)) { if (!serialExecutor.awaitTermination(5, TimeUnit.SECONDS)) {
List<Runnable> pendingTasks = serialExecutor.shutdownNow(); 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()); localBroker.oneway(new ShutdownInfo());
remoteBroker.oneway(new ShutdownInfo()); remoteBroker.oneway(new ShutdownInfo());
} catch (Throwable e) { } catch (Throwable e) {
LOG.debug("Caught exception sending shutdown", e); if (LOG.isDebugEnabled()) {
LOG.debug("Caught exception sending shutdown", e);
}
} finally { } finally {
sendShutdown.countDown(); sendShutdown.countDown();
} }
@ -450,7 +459,9 @@ public abstract class DemandForwardingBridgeSupport implements NetworkBridge, Br
if (remoteBrokerInfo != null) { if (remoteBrokerInfo != null) {
brokerService.getBroker().removeBroker(null, remoteBrokerInfo); brokerService.getBroker().removeBroker(null, remoteBrokerInfo);
brokerService.getBroker().networkBridgeStopped(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 DemandForwardingBridgeSupport implements NetworkBridge, Br
} }
return; 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() { brokerService.getTaskRunnerFactory().execute(new Runnable() {
@Override @Override
public void run() { public void run() {