camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmuel...@apache.org
Subject svn commit: r1136687 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/builder/xml/ camel-core/src/main/java/org/apache/camel/component/bean/ camel-core/src/main/java/org/apache/camel/component/file/ camel-core/src/main/java/org/apache/camel...
Date Thu, 16 Jun 2011 21:19:13 GMT
Author: cmueller
Date: Thu Jun 16 21:19:12 2011
New Revision: 1136687

URL: http://svn.apache.org/viewvc?rev=1136687&view=rev
Log:
CAMEL-3759: After switching to slf4j, we can get rid of the 'isTraceEnabled', 'isDebugEnabled'
and 'isInfoEnabled' statements

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XPathBuilder.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanProcessor.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileConsumer.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileOperations.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileProducer.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/management/DefaultManagementLifecycleStrategy.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/management/JmxMBeanAssembler.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RedeliveryErrorHandler.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
    camel/trunk/components/camel-dozer/src/main/java/org/apache/camel/converter/dozer/DozerTypeConverterLoader.java
    camel/trunk/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosEventNotifier.java
    camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpTrapConsumer.java
    camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppConsumer.java
    camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppGroupChatProducer.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XPathBuilder.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XPathBuilder.java?rev=1136687&r1=1136686&r2=1136687&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XPathBuilder.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XPathBuilder.java Thu
Jun 16 21:19:12 2011
@@ -679,7 +679,9 @@ public class XPathBuilder implements Exp
             throw new InvalidXPathExpression(getText(), e);
         }
 
-        LOG.trace("Done evaluating exchange: {} as: {} with result: {}", new Object[]{exchange,
resultQName, answer});
+        if (LOG.isTraceEnabled()) {
+            LOG.trace("Done evaluating exchange: {} as: {} with result: {}", new Object[]{exchange,
resultQName, answer});
+        }
         return answer;
     }
 

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java?rev=1136687&r1=1136686&r2=1136687&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java Thu
Jun 16 21:19:12 2011
@@ -298,7 +298,9 @@ public class BeanInfo {
         boolean hasHandlerAnnotation = ObjectHelper.hasAnnotation(method.getAnnotations(),
Handler.class);
 
         int size = parameterTypes.length;
-        LOG.trace("Creating MethodInfo for class: {} method: {} having {} parameters", new
Object[]{clazz, method, size});
+        if (LOG.isTraceEnabled()) {
+            LOG.trace("Creating MethodInfo for class: {} method: {} having {} parameters",
new Object[]{clazz, method, size});
+        }
 
         for (int i = 0; i < size; i++) {
             Class parameterType = parameterTypes[i];
@@ -442,7 +444,9 @@ public class BeanInfo {
         Object body = in.getBody();
         if (body != null) {
             Class bodyType = body.getClass();
-            LOG.trace("Matching for method with a single parameter that matches type: {}",
bodyType.getCanonicalName());
+            if (LOG.isTraceEnabled()) {
+                LOG.trace("Matching for method with a single parameter that matches type:
{}", bodyType.getCanonicalName());
+            }
 
             List<MethodInfo> possibles = new ArrayList<MethodInfo>();
             List<MethodInfo> possiblesWithException = new ArrayList<MethodInfo>();

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanProcessor.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanProcessor.java?rev=1136687&r1=1136686&r2=1136687&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanProcessor.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanProcessor.java
Thu Jun 16 21:19:12 2011
@@ -122,7 +122,9 @@ public class BeanProcessor extends Servi
             LOG.trace("Exchange IN body is a BeanInvocation instance: {}", beanInvoke);
             Class<?> clazz = beanInvoke.getMethod().getDeclaringClass();
             boolean sameBean = clazz.isInstance(bean);
-            LOG.debug("BeanHolder bean: {} and beanInvocation bean: {} is same instance:
{}", new Object[]{bean.getClass(), clazz, sameBean});
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("BeanHolder bean: {} and beanInvocation bean: {} is same instance:
{}", new Object[]{bean.getClass(), clazz, sameBean});
+            }
             if (sameBean) {
                 beanInvoke.invoke(bean, exchange);
                 // propagate headers

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileConsumer.java?rev=1136687&r1=1136686&r2=1136687&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileConsumer.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileConsumer.java
Thu Jun 16 21:19:12 2011
@@ -51,11 +51,15 @@ public class FileConsumer extends Generi
         File[] files = directory.listFiles();
         if (files == null || files.length == 0) {
             // no files in this directory to poll
-            log.trace("No files found in directory: {}", directory.getPath());
+            if (log.isTraceEnabled()) {
+                log.trace("No files found in directory: {}", directory.getPath());
+            }
             return true;
         } else {
             // we found some files
-            log.trace("Found {} in directory: {}", files.length, directory.getPath());
+            if (log.isTraceEnabled()) {
+                log.trace("Found {} in directory: {}", files.length, directory.getPath());
+            }
         }
 
         for (File file : files) {
@@ -86,7 +90,9 @@ public class FileConsumer extends Generi
                 // Windows can report false to a file on a share so regard it always as a
file (if its not a directory)
                 if (isValidFile(gf, false)) {
                     if (isInProgress(gf)) {
-                        log.trace("Skipping as file is already in progress: {}", gf.getFileName());
+                        if (log.isTraceEnabled()) {
+                            log.trace("Skipping as file is already in progress: {}", gf.getFileName());
+                        }
                     } else {
                         log.trace("Adding valid file: {}", file);
                         // matched file so add

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileOperations.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileOperations.java?rev=1136687&r1=1136686&r2=1136687&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileOperations.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileOperations.java
Thu Jun 16 21:19:12 2011
@@ -113,7 +113,7 @@ public class FileOperations implements G
                 return true;
             } else {
                 if (LOG.isTraceEnabled()) {
-                    LOG.trace("Building directory: " + path);
+                    LOG.trace("Building directory: {}", path);
                 }
                 return path.mkdirs();
             }
@@ -157,9 +157,7 @@ public class FileOperations implements G
         if (file.exists()) {
             if (endpoint.getFileExist() == GenericFileExist.Ignore) {
                 // ignore but indicate that the file was written
-                if (LOG.isTraceEnabled()) {
-                    LOG.trace("An existing file already exists: " + file + ". Ignore and
do not override it.");
-                }
+                LOG.trace("An existing file already exists: {}. Ignore and do not override
it.", file);
                 return true;
             } else if (endpoint.getFileExist() == GenericFileExist.Fail) {
                 throw new GenericFileOperationFailedException("File already exist: " + file
+ ". Cannot write new file.");
@@ -230,16 +228,14 @@ public class FileOperations implements G
             if (last != null) {
                 boolean result = file.setLastModified(last);
                 if (LOG.isTraceEnabled()) {
-                    LOG.trace("Keeping last modified timestamp: " + last + " on file: " +
file + " with result: " + result);
+                    LOG.trace("Keeping last modified timestamp: {} on file: {} with result:
{}", new Object[]{last, file, result});
                 }
             }
         }
     }
 
     private boolean writeFileByLocalWorkPath(File source, File file) {
-        if (LOG.isTraceEnabled()) {
-            LOG.trace("Using local work file being renamed from: " + source + " to: " + file);
-        }
+        LOG.trace("Using local work file being renamed from: {} to: {}", source, file);
 
         return FileUtil.renameFile(source, file);
     }
@@ -249,11 +245,7 @@ public class FileOperations implements G
         FileChannel out = null;
         try {
             out = prepareOutputFileChannel(target, out);
-
-            if (LOG.isTraceEnabled()) {
-                LOG.trace("Using FileChannel to transfer from: " + in + " to: " + out);
-            }
-
+            LOG.trace("Using FileChannel to transfer from: {} to: {}", in, out);
             long size = in.size();
             long position = 0;
             while (position < size) {
@@ -269,10 +261,7 @@ public class FileOperations implements G
         FileChannel out = null;
         try {
             out = prepareOutputFileChannel(target, out);
-
-            if (LOG.isTraceEnabled()) {
-                LOG.trace("Using InputStream to transfer from: " + in + " to: " + out);
-            }
+            LOG.trace("Using InputStream to transfer from: {} to: {}", in, out);
             int size = endpoint.getBufferSize();
             byte[] buffer = new byte[size];
             ByteBuffer byteBuffer = ByteBuffer.wrap(buffer);

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java?rev=1136687&r1=1136686&r2=1136687&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java
Thu Jun 16 21:19:12 2011
@@ -314,7 +314,9 @@ public abstract class GenericFileConsume
             getAsyncProcessor().process(exchange, new AsyncCallback() {
                 public void done(boolean doneSync) {
                     // noop
-                    log.trace("Done processing file: {} {}", target, doneSync ? "synchronously"
: "asynchronously");
+                    if (log.isTraceEnabled()) {
+                        log.trace("Done processing file: {} {}", target, doneSync ? "synchronously"
: "asynchronously");
+                    }
                 }
             });
 

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileProducer.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileProducer.java?rev=1136687&r1=1136686&r2=1136687&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileProducer.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileProducer.java
Thu Jun 16 21:19:12 2011
@@ -247,7 +247,9 @@ public class GenericFileProducer<T> exte
         }
 
         // upload
-        log.trace("About to write [{}] to [{}] from exchange [{}]", new Object[]{fileName,
getEndpoint(), exchange});
+        if (log.isTraceEnabled()) {
+            log.trace("About to write [{}] to [{}] from exchange [{}]", new Object[]{fileName,
getEndpoint(), exchange});
+        }
 
         boolean success = operations.storeFile(fileName, exchange);
         if (!success) {

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/management/DefaultManagementLifecycleStrategy.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/management/DefaultManagementLifecycleStrategy.java?rev=1136687&r1=1136686&r2=1136687&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/management/DefaultManagementLifecycleStrategy.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/management/DefaultManagementLifecycleStrategy.java
Thu Jun 16 21:19:12 2011
@@ -215,7 +215,9 @@ public class DefaultManagementLifecycleS
             }
             ObjectName on = getManagementStrategy().getManagementNamingStrategy().getObjectNameForCamelContext(name);
             done = !getManagementStrategy().isManaged(mc, on);
-            LOG.trace("Using name: {} in ObjectName[{}] exists? {}", new Object[]{name, on,
done});
+            if (LOG.isTraceEnabled()) {
+                LOG.trace("Using name: {} in ObjectName[{}] exists? {}", new Object[]{name,
on, done});
+            }
         }
         return name;
     }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/management/JmxMBeanAssembler.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/management/JmxMBeanAssembler.java?rev=1136687&r1=1136686&r2=1136687&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/management/JmxMBeanAssembler.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/management/JmxMBeanAssembler.java
Thu Jun 16 21:19:12 2011
@@ -56,7 +56,7 @@ public class JmxMBeanAssembler {
         if (obj instanceof ManagedInstance) {
             Object custom = ((ManagedInstance) obj).getInstance();
             if (custom != null && ObjectHelper.hasAnnotation(custom.getClass().getAnnotations(),
ManagedResource.class)) {
-                LOG.trace("Assembling MBeanInfo for: {} from custom @ManagedResource object:
{}", name.toString(), custom);
+                LOG.trace("Assembling MBeanInfo for: {} from custom @ManagedResource object:
{}", name, custom);
                 // get the mbean info from the custom managed object
                 mbi = assembler.getMBeanInfo(custom, name.toString());
                 // and let the custom object be registered in JMX
@@ -66,7 +66,7 @@ public class JmxMBeanAssembler {
 
         if (mbi == null) {
             // use the default provided mbean which has been annotated with Spring JMX annotations
-            LOG.trace("Assembling MBeanInfo for: {} from @ManagedResource object: {}", name.toString(),
obj);
+            LOG.trace("Assembling MBeanInfo for: {} from @ManagedResource object: {}", name,
obj);
             mbi = assembler.getMBeanInfo(obj, name.toString());
         }
 

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RedeliveryErrorHandler.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RedeliveryErrorHandler.java?rev=1136687&r1=1136686&r2=1136687&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RedeliveryErrorHandler.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RedeliveryErrorHandler.java
Thu Jun 16 21:19:12 2011
@@ -108,7 +108,9 @@ public abstract class RedeliveryErrorHan
             // letting onRedeliver be executed at first
             deliverToOnRedeliveryProcessor(exchange, data);
 
-            log.trace("Redelivering exchangeId: {} -> {} for Exchange: {}", new Object[]{exchange.getExchangeId(),
outputAsync, exchange});
+            if (log.isTraceEnabled()) {
+                log.trace("Redelivering exchangeId: {} -> {} for Exchange: {}", new Object[]{exchange.getExchangeId(),
outputAsync, exchange});
+            }
 
             // emmit event we are doing redelivery
             EventHelper.notifyExchangeRedelivery(exchange.getContext(), exchange, data.redeliveryCounter);

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java?rev=1136687&r1=1136686&r2=1136687&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
Thu Jun 16 21:19:12 2011
@@ -309,16 +309,20 @@ public class AggregateProcessor extends 
         if (getCompletionTimeoutExpression() != null) {
             Long value = getCompletionTimeoutExpression().evaluate(exchange, Long.class);
             if (value != null && value > 0) {
-                LOG.trace("Updating correlation key {} to timeout after {} ms. as exchange
received: {}",
-                        new Object[]{key, value, exchange});
+                if (LOG.isTraceEnabled()) {
+                    LOG.trace("Updating correlation key {} to timeout after {} ms. as exchange
received: {}",
+                            new Object[]{key, value, exchange});
+                }
                 addExchangeToTimeoutMap(key, exchange, value);
                 timeoutSet = true;
             }
         }
         if (!timeoutSet && getCompletionTimeout() > 0) {
             // timeout is used so use the timeout map to keep an eye on this
-            LOG.trace("Updating correlation key {} to timeout after {} ms. as exchange received:
{}",
-                    new Object[]{key, getCompletionTimeout(), exchange});
+            if (LOG.isTraceEnabled()) {
+                LOG.trace("Updating correlation key {} to timeout after {} ms. as exchange
received: {}",
+                        new Object[]{key, getCompletionTimeout(), exchange});
+            }
             addExchangeToTimeoutMap(key, exchange, getCompletionTimeout());
         }
 

Modified: camel/trunk/components/camel-dozer/src/main/java/org/apache/camel/converter/dozer/DozerTypeConverterLoader.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-dozer/src/main/java/org/apache/camel/converter/dozer/DozerTypeConverterLoader.java?rev=1136687&r1=1136686&r2=1136687&view=diff
==============================================================================
--- camel/trunk/components/camel-dozer/src/main/java/org/apache/camel/converter/dozer/DozerTypeConverterLoader.java
(original)
+++ camel/trunk/components/camel-dozer/src/main/java/org/apache/camel/converter/dozer/DozerTypeConverterLoader.java
Thu Jun 16 21:19:12 2011
@@ -127,7 +127,9 @@ public class DozerTypeConverterLoader im
     private void registerClassMaps(TypeConverterRegistry registry, DozerBeanMapper dozer,
List<ClassMap> all) {
         DozerTypeConverter converter = new DozerTypeConverter(dozer);
         for (ClassMap map : all) {
-            log.info("Added {} -> {} as type converter to: {}", new Object[]{map.getSrcClassName(),
map.getDestClassName(), registry});
+            if (log.isInfoEnabled()) {
+                log.info("Added {} -> {} as type converter to: {}", new Object[]{map.getSrcClassName(),
map.getDestClassName(), registry});
+            }
             registry.addTypeConverter(map.getSrcClassToMap(), map.getDestClassToMap(), converter);
             registry.addTypeConverter(map.getDestClassToMap(), map.getSrcClassToMap(), converter);
         }

Modified: camel/trunk/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosEventNotifier.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosEventNotifier.java?rev=1136687&r1=1136686&r2=1136687&view=diff
==============================================================================
--- camel/trunk/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosEventNotifier.java
(original)
+++ camel/trunk/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosEventNotifier.java
Thu Jun 16 21:19:12 2011
@@ -50,7 +50,9 @@ public class NagiosEventNotifier extends
         Level level = determineLevel(eventObject);
         MessagePayload payload = new MessagePayload(getHostName(), level.ordinal(), getServiceName(),
message);
 
-        log.info("Sending notification to Nagios: {}", payload.getMessage());
+        if (log.isInfoEnabled()) {
+            log.info("Sending notification to Nagios: {}", payload.getMessage());
+        }
         sender.send(payload);
         log.trace("Sending notification done");
     }

Modified: camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpTrapConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpTrapConsumer.java?rev=1136687&r1=1136686&r2=1136687&view=diff
==============================================================================
--- camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpTrapConsumer.java
(original)
+++ camel/trunk/components/camel-snmp/src/main/java/org/apache/camel/component/snmp/SnmpTrapConsumer.java
Thu Jun 16 21:19:12 2011
@@ -52,7 +52,9 @@ public class SnmpTrapConsumer extends De
         super.doStart();
 
         // load connection data only if the endpoint is enabled
-        LOG.info("Starting trap consumer on {}", this.endpoint.getAddress());
+        if (LOG.isInfoEnabled()) {
+            LOG.info("Starting trap consumer on {}", this.endpoint.getAddress());
+        }
 
         this.listenGenericAddress = GenericAddress.parse(this.endpoint.getAddress());
 

Modified: camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppConsumer.java?rev=1136687&r1=1136686&r2=1136687&view=diff
==============================================================================
--- camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppConsumer.java
(original)
+++ camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppConsumer.java
Thu Jun 16 21:19:12 2011
@@ -65,11 +65,15 @@ public class XmppConsumer extends Defaul
             privateChat = chatManager.getThreadChat(endpoint.getChatId());
 
             if (privateChat != null) {
-                LOG.debug("Adding listener to existing chat opened to " + privateChat.getParticipant());
+                if (LOG.isDebugEnabled()) {
+                    LOG.debug("Adding listener to existing chat opened to " + privateChat.getParticipant());
+                }
                 privateChat.addMessageListener(this);
             } else {                
                 privateChat = connection.getChatManager().createChat(endpoint.getParticipant(),
endpoint.getChatId(), this);
-                LOG.debug("Opening private chat to " + privateChat.getParticipant());
+                if (LOG.isDebugEnabled()) {
+                    LOG.debug("Opening private chat to " + privateChat.getParticipant());
+                }
             }
         } else {
             // add the presence packet listener to the connection so we only get packets
that concerns us
@@ -84,7 +88,9 @@ public class XmppConsumer extends Defaul
             history.setMaxChars(0); // we do not want any historical messages
 
             muc.join(endpoint.getNickname(), null, history, SmackConfiguration.getPacketReplyTimeout());
-            LOG.info("Joined room: {} as: {}", muc.getRoom(), endpoint.getNickname());
+            if (LOG.isInfoEnabled()) {
+                LOG.info("Joined room: {} as: {}", muc.getRoom(), endpoint.getNickname());
+            }
         }
 
         super.doStart();
@@ -94,7 +100,9 @@ public class XmppConsumer extends Defaul
     protected void doStop() throws Exception {
         super.doStop();
         if (muc != null) {
-            LOG.info("Leaving room: {}", muc.getRoom());
+            if (LOG.isInfoEnabled()) {
+                LOG.info("Leaving room: {}", muc.getRoom());
+            }
             muc.removeMessageListener(this);
             muc.leave();
             muc = null;
@@ -106,7 +114,9 @@ public class XmppConsumer extends Defaul
 
     public void chatCreated(Chat chat, boolean createdLocally) {
         if (!createdLocally) {
-            LOG.debug("Accepting incoming chat session from " + chat.getParticipant());
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Accepting incoming chat session from " + chat.getParticipant());
+            }
             chat.addMessageListener(this);
         }
     }

Modified: camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppGroupChatProducer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppGroupChatProducer.java?rev=1136687&r1=1136686&r2=1136687&view=diff
==============================================================================
--- camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppGroupChatProducer.java
(original)
+++ camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppGroupChatProducer.java
Thu Jun 16 21:19:12 2011
@@ -58,7 +58,9 @@ public class XmppGroupChatProducer exten
                 connection.connect();
             }
 
-            LOG.debug("Sending XMPP message: {}", message.getBody());
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Sending XMPP message: {}", message.getBody());
+            }
             chat.sendMessage(message);
             // must invoke nextMessage to consume the response from the server
             // otherwise the client local queue will fill up (CAMEL-1467)
@@ -80,7 +82,9 @@ public class XmppGroupChatProducer exten
             DiscussionHistory history = new DiscussionHistory();
             history.setMaxChars(0); // we do not want any historical messages
             chat.join(endpoint.getNickname(), null, history, SmackConfiguration.getPacketReplyTimeout());
-            LOG.info("Joined room: {} as: {}", room, endpoint.getNickname());
+            if (LOG.isInfoEnabled()) {
+                LOG.info("Joined room: {} as: {}", room, endpoint.getNickname());
+            }
         }
 
         super.doStart();



Mime
View raw message