servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1380414 - /servicemix/smx4/nmr/trunk/nmr/core/src/main/java/org/apache/servicemix/nmr/core/ChannelImpl.java
Date Tue, 04 Sep 2012 00:55:13 GMT
Author: ffang
Date: Tue Sep  4 00:55:12 2012
New Revision: 1380414

URL: http://svn.apache.org/viewvc?rev=1380414&view=rev
Log:
[SMX4NMR-296]Add logger guard checks for nmr/ChannelImpl to optimize for better performance

Modified:
    servicemix/smx4/nmr/trunk/nmr/core/src/main/java/org/apache/servicemix/nmr/core/ChannelImpl.java

Modified: servicemix/smx4/nmr/trunk/nmr/core/src/main/java/org/apache/servicemix/nmr/core/ChannelImpl.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/nmr/core/src/main/java/org/apache/servicemix/nmr/core/ChannelImpl.java?rev=1380414&r1=1380413&r2=1380414&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/nmr/core/src/main/java/org/apache/servicemix/nmr/core/ChannelImpl.java
(original)
+++ servicemix/smx4/nmr/trunk/nmr/core/src/main/java/org/apache/servicemix/nmr/core/ChannelImpl.java
Tue Sep  4 00:55:12 2012
@@ -207,8 +207,12 @@ public class ChannelImpl implements Inte
             throw new ChannelClosedException();
         }
         // Log the exchange
-        logger.trace("Channel {} delivering exchange: {}", name, exchange.display(true));
-        logger.debug("Channel {} delivering exchange: {}", name, exchange.display(false));
+        if (logger.isTraceEnabled()) {
+            logger.trace("Channel {} delivering exchange: {}", name, exchange.display(true));
+        }
+        if (logger.isDebugEnabled()) {
+            logger.debug("Channel {} delivering exchange: {}", name, exchange.display(false));
+        }
         // Handle case where the exchange has been sent synchronously
         Semaphore lock = exchange.getRole() == Role.Provider ? exchange.getConsumerLock(false)
                 : exchange.getProviderLock(false);
@@ -285,8 +289,12 @@ public class ChannelImpl implements Inte
             throw new ChannelClosedException();
         }
         // Log the exchange
-        logger.trace("Channel {} dispatching exchange: {}", name, exchange.display(true));
-        logger.debug("Channel {} dispatching exchange: {}", name, exchange.display(false));
+        if (logger.isTraceEnabled()) {
+            logger.trace("Channel {} dispatching exchange: {}", name, exchange.display(true));
+        }
+        if (logger.isDebugEnabled()) {
+            logger.debug("Channel {} dispatching exchange: {}", name, exchange.display(false));
+        }
         // Set source endpoint
         if (exchange.getSource() == null) {
             exchange.setSource(endpoint);



Mime
View raw message