camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmuel...@apache.org
Subject svn commit: r1085587 [1/3] - in /camel/trunk/camel-core/src: main/java/org/apache/camel/builder/xml/ main/java/org/apache/camel/component/bean/ main/java/org/apache/camel/component/file/ main/java/org/apache/camel/component/file/strategy/ main/java/org...
Date Fri, 25 Mar 2011 22:34:28 GMT
Author: cmueller
Date: Fri Mar 25 22:34:26 2011
New Revision: 1085587

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

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/builder/xml/XsltUriResolver.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/BeanInvocation.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/bean/CamelInvocationHandler.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.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/GenericFile.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/GenericFileEndpoint.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileOnCompletion.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/component/file/strategy/FileChangedExclusiveReadLockStrategy.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/FileLockExclusiveReadLockStrategy.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/GenericFileDeleteProcessStrategy.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/GenericFileProcessStrategySupport.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/GenericFileRenameExclusiveReadLockStrategy.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/MarkerFileExclusiveReadLockStrategy.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/seda/SedaConsumer.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/seda/SedaProducer.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/timer/TimerConsumer.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/converter/TimePatternConverter.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/converter/stream/CachedOutputStream.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExecutorServiceStrategy.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultInflightRepository.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultPackageScanClassResolver.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultProducer.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultScheduledPollConsumer.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultServicePool.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultShutdownStrategy.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultUnitOfWork.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/EventDrivenPollingConsumer.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ProducerCache.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ScheduledPollConsumer.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/AnnotationTypeConverterLoader.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/BaseTypeConverterRegistry.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/FutureTypeConverter.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/PropertyEditorTypeConverter.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/language/simple/SimpleLanguageSupport.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/management/DefaultManagementAgent.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/InstrumentationProcessor.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/management/JmxMBeanAssembler.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/management/JmxNotificationEventNotifier.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/BatchProcessor.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/DelayProcessorSupport.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Enricher.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/LoopProcessor.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/OnCompletionProcessor.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Pipeline.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RecipientListProcessor.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/RoutingSlip.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/ThroughputLogger.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/TryProcessor.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/exceptionpolicy/DefaultExceptionPolicyStrategy.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/idempotent/FileIdempotentRepository.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/TraceInterceptor.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/loadbalancer/FailOverLoadBalancer.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/util/AsyncProcessorHelper.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/util/DefaultTimeoutMap.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/util/EventHelper.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/util/IntrospectionSupport.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/util/ServiceHelper.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/util/UnitOfWorkHelper.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/util/concurrent/ExecutorServiceHelper.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/converter/TimerDrivenTimePatternConverterTest.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=1085587&r1=1085586&r2=1085587&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 Fri Mar 25 22:34:26 2011
@@ -635,9 +635,7 @@ public class XPathBuilder implements Exp
     }
 
     protected Object doInEvaluateAs(XPathExpression xpathExpression, Exchange exchange, QName resultQName) {
-        if (LOG.isTraceEnabled()) {
-            LOG.trace("Evaluating exchange: " + exchange + " as: " + resultQName);
-        }
+        LOG.trace("Evaluating exchange: {} as: {}", exchange, resultQName);
 
         Object answer;
 
@@ -671,9 +669,7 @@ public class XPathBuilder implements Exp
             throw new InvalidXPathExpression(getText(), e);
         }
 
-        if (LOG.isTraceEnabled()) {
-            LOG.trace("Done evaluating exchange: " + exchange + " as: " + resultQName + " with result: " + answer);
-        }
+        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/builder/xml/XsltUriResolver.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XsltUriResolver.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XsltUriResolver.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XsltUriResolver.java Fri Mar 25 22:34:26 2011
@@ -58,9 +58,7 @@ public class XsltUriResolver implements 
             throw new TransformerException("include href is empty");
         }
 
-        if (LOG.isTraceEnabled()) {
-            LOG.trace("Resolving URI with href: " + href + " and base: " + base);
-        }
+        LOG.trace("Resolving URI with href: {} and base: {}", href, base);
 
         if (href.startsWith("classpath:")) {
             if (LOG.isDebugEnabled()) {

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=1085587&r1=1085586&r2=1085587&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 Fri Mar 25 22:34:26 2011
@@ -180,9 +180,7 @@ public class BeanInfo {
             methodInfo = defaultMethod;
         }
         if (methodInfo != null) {
-            if (LOG.isTraceEnabled()) {
-                LOG.trace("Chosen method to invoke: " + methodInfo + " on bean: " + pojo);
-            }
+            LOG.trace("Chosen method to invoke: {} on bean: {}", methodInfo, pojo);
             return methodInfo.createMethodInvocation(pojo, exchange);
         }
 
@@ -201,16 +199,12 @@ public class BeanInfo {
         // get the target clazz as it could potentially have been enhanced by CGLIB etc.
         clazz = getTargetClass(clazz);
 
-        if (LOG.isTraceEnabled()) {
-            LOG.trace("Introspecting class: " + clazz);
-        }
+        LOG.trace("Introspecting class: {}", clazz);
 
         Method[] methods = clazz.getDeclaredMethods();
         for (Method method : methods) {
             boolean valid = isValidMethod(clazz, method);
-            if (LOG.isTraceEnabled()) {
-                LOG.trace("Method:  " + method + " is valid: " + valid);
-            }
+            LOG.trace("Method:  {} is valid: {}", method, valid);
             if (valid) {
                 introspect(clazz, method);
             }
@@ -230,9 +224,7 @@ public class BeanInfo {
      * @return the method info, is newer <tt>null</tt>
      */
     protected MethodInfo introspect(Class<?> clazz, Method method) {
-        if (LOG.isTraceEnabled()) {
-            LOG.trace("Introspecting class: " + clazz + ", method: " + method);
-        }
+        LOG.trace("Introspecting class: {}, method: {}", clazz, method);
         String opName = method.getName();
 
         MethodInfo methodInfo = createMethodInfo(clazz, method);
@@ -242,16 +234,12 @@ public class BeanInfo {
         // the method then use it (we are traversing upwards: sub (child) -> super (farther) )
         MethodInfo existingMethodInfo = overridesExistingMethod(methodInfo);
         if (existingMethodInfo != null) {
-            if (LOG.isTraceEnabled()) {
-                LOG.trace("This method is already overridden in a subclass, so the method from the sub class is preferred: " + existingMethodInfo);
-            }
+            LOG.trace("This method is already overridden in a subclass, so the method from the sub class is preferred: {}", existingMethodInfo);
 
             return existingMethodInfo;
         }
 
-        if (LOG.isTraceEnabled()) {
-            LOG.trace("Adding operation: " + opName + " for method: " + methodInfo);
-        }
+        LOG.trace("Adding operation: {} for method: {}", opName, methodInfo);
 
         if (hasMethod(opName)) {
             // we have an overloaded method so add the method info to the same key
@@ -312,9 +300,7 @@ public class BeanInfo {
         boolean hasHandlerAnnotation = ObjectHelper.hasAnnotation(method.getAnnotations(), Handler.class);
 
         int size = parameterTypes.length;
-        if (LOG.isTraceEnabled()) {
-            LOG.trace("Creating MethodInfo for class: " + clazz + " method: " + method + " having " + size + " parameters");
-        }
+        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];
@@ -323,15 +309,11 @@ public class BeanInfo {
             hasCustomAnnotation |= expression != null;
 
             ParameterInfo parameterInfo = new ParameterInfo(i, parameterType, parameterAnnotations, expression);
-            if (LOG.isTraceEnabled()) {
-                LOG.trace("Parameter #" + i + ": " + parameterInfo);
-            }
+            LOG.trace("Parameter #{}: {}", i, parameterInfo);
             parameters.add(parameterInfo);
             if (expression == null) {
                 boolean bodyAnnotation = ObjectHelper.hasAnnotation(parameterAnnotations, Body.class);
-                if (LOG.isTraceEnabled() && bodyAnnotation) {
-                    LOG.trace("Parameter #" + i + " has @Body annotation");
-                }
+                LOG.trace("Parameter #{} has @Body annotation", i);
                 hasCustomAnnotation |= bodyAnnotation;
                 if (bodyParameters.isEmpty()) {
                     // okay we have not yet set the body parameter and we have found
@@ -344,18 +326,14 @@ public class BeanInfo {
                         // but we allow null bodies in case the message really contains a null body
                         expression = ExpressionBuilder.mandatoryBodyExpression(parameterType, true);
                     }
-                    if (LOG.isTraceEnabled()) {
-                        LOG.trace("Parameter #" + i + " is the body parameter using expression " + expression);
-                    }
+                    LOG.trace("Parameter #{} is the body parameter using expression {}", i, expression);
                     parameterInfo.setExpression(expression);
                     bodyParameters.add(parameterInfo);
                 } else {
                     // will ignore the expression for parameter evaluation
                 }
             }
-            if (LOG.isTraceEnabled()) {
-                LOG.trace("Parameter #" + i + " has parameter info: " + parameterInfo);
-            }
+            LOG.trace("Parameter #{} has parameter info: ", i, parameterInfo);
         }
 
         // now lets add the method to the repository
@@ -438,9 +416,7 @@ public class BeanInfo {
         Object body = in.getBody();
         if (body != null) {
             Class bodyType = body.getClass();
-            if (LOG.isTraceEnabled()) {
-                LOG.trace("Matching for method with a single parameter that matches type: " + bodyType.getCanonicalName());
-            }
+            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>();
@@ -454,9 +430,7 @@ public class BeanInfo {
 
                 // try to match the arguments
                 if (methodInfo.bodyParameterMatches(bodyType)) {
-                    if (LOG.isTraceEnabled()) {
-                        LOG.trace("Found a possible method: " + methodInfo);
-                    }
+                    LOG.trace("Found a possible method: {}", methodInfo);
                     if (methodInfo.hasExceptionParameter()) {
                         // methods with accepts exceptions
                         possiblesWithException.add(methodInfo);
@@ -482,17 +456,13 @@ public class BeanInfo {
 
         Exception exception = ExpressionBuilder.exchangeExceptionExpression().evaluate(exchange, Exception.class);
         if (exception != null && possiblesWithException.size() == 1) {
-            if (LOG.isTraceEnabled()) {
-                LOG.trace("Exchange has exception set so we prefer method that also has exception as parameter");
-            }
+            LOG.trace("Exchange has exception set so we prefer method that also has exception as parameter");
             // prefer the method that accepts exception in case we have an exception also
             return possiblesWithException.get(0);
         } else if (possibles.size() == 1) {
             return possibles.get(0);
         } else if (possibles.isEmpty()) {
-            if (LOG.isTraceEnabled()) {
-                LOG.trace("No possible methods so now trying to convert body to parameter types");
-            }
+            LOG.trace("No possible methods so now trying to convert body to parameter types");
 
             // lets try converting
             Object newBody = null;
@@ -506,8 +476,8 @@ public class BeanInfo {
                 Object value = convertToType(exchange, methodInfo.getBodyParameterType(), body);
                 if (value != null) {
                     if (LOG.isTraceEnabled()) {
-                        LOG.trace("Converted body from: " + body.getClass().getCanonicalName()
-                                + "to: " + methodInfo.getBodyParameterType().getCanonicalName());
+                        LOG.trace("Converted body from: {} to: {}",
+                                body.getClass().getCanonicalName(), methodInfo.getBodyParameterType().getCanonicalName());
                     }
                     matchCounter++;
                     newBody = value;
@@ -518,9 +488,7 @@ public class BeanInfo {
                 throw new AmbiguousMethodCallException(exchange, Arrays.asList(matched, matched));
             }
             if (matched != null) {
-                if (LOG.isTraceEnabled()) {
-                    LOG.trace("Setting converted body: " + body);
-                }
+                LOG.trace("Setting converted body: {}", body);
                 Message in = exchange.getIn();
                 in.setBody(newBody);
                 return matched;
@@ -529,9 +497,7 @@ public class BeanInfo {
             // if we only have a single method with custom annotations, lets use that one
             if (possibleWithCustomAnnotation.size() == 1) {
                 MethodInfo answer = possibleWithCustomAnnotation.get(0);
-                if (LOG.isTraceEnabled()) {
-                    LOG.trace("There are only one method with annotations so we choose it: " + answer);
-                }
+                LOG.trace("There are only one method with annotations so we choose it: {}", answer);
                 return answer;
             }
             // phew try to choose among multiple methods with annotations

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInvocation.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInvocation.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInvocation.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInvocation.java Fri Mar 25 22:34:26 2011
@@ -79,13 +79,9 @@ public class BeanInvocation implements E
      */
     public void invoke(Object pojo, Exchange exchange) {
         try {
-            if (LOG.isTraceEnabled()) {
-                LOG.trace("Invoking method: " + getMethod() + " with args: " + getArgs());
-            }
+            LOG.trace("Invoking method: {} with args: {}", getMethod(), getArgs());
             Object response = getMethod().invoke(pojo, getArgs());
-            if (LOG.isTraceEnabled()) {
-                LOG.trace("Got response: " + response);
-            }
+            LOG.trace("Got response: {}", response);
             exchange.getOut().setBody(response);
         } catch (InvocationTargetException e) {
             exchange.setException(ObjectHelper.wrapRuntimeCamelException(e.getCause()));

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=1085587&r1=1085586&r2=1085587&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 Fri Mar 25 22:34:26 2011
@@ -93,9 +93,7 @@ public class BeanProcessor extends Servi
         // should not be invoked if an explicit method has been set
         Processor processor = getProcessor();
         if (!isExplicitMethod && processor != null) {
-            if (LOG.isTraceEnabled()) {
-                LOG.trace("Using a custom adapter as bean invocation: " + processor);
-            }
+            LOG.trace("Using a custom adapter as bean invocation: {}", processor);
             try {
                 processor.process(exchange);
             } catch (Throwable e) {
@@ -114,14 +112,10 @@ public class BeanProcessor extends Servi
         // so we must test whether BeanHolder and BeanInvocation is the same bean or not
         BeanInvocation beanInvoke = in.getBody(BeanInvocation.class);
         if (beanInvoke != null) {
-            if (LOG.isTraceEnabled()) {
-                LOG.trace("Exchange IN body is a BeanInvocation instance: " + beanInvoke);
-            }
+            LOG.trace("Exchange IN body is a BeanInvocation instance: {}", beanInvoke);
             Class<?> clazz = beanInvoke.getMethod().getDeclaringClass();
             boolean sameBean = clazz.isInstance(bean);
-            if (LOG.isTraceEnabled()) {
-                LOG.debug("BeanHolder bean: " + bean.getClass() + " and beanInvocation bean: " + clazz + " is same instance: " + sameBean);
-            }
+            LOG.debug("BeanHolder bean: {} and beanInvocation bean: {} is same instance: {}", new Object[]{bean.getClass(), clazz, sameBean});
             if (sameBean) {
                 beanInvoke.invoke(bean, exchange);
                 // propagate headers
@@ -166,17 +160,13 @@ public class BeanProcessor extends Servi
             AtomicBoolean sync = new AtomicBoolean(true);
             value = invocation.proceed(callback, sync);
             if (!sync.get()) {
-                if (LOG.isTraceEnabled()) {
-                    LOG.trace("Processing exchangeId: " + exchange.getExchangeId() + " is continued being processed asynchronously");
-                }
+                LOG.trace("Processing exchangeId: {} is continued being processed asynchronously", exchange.getExchangeId());
                 // the remainder of the routing will be completed async
                 // so we break out now, then the callback will be invoked which then continue routing from where we left here
                 return false;
             }
 
-            if (LOG.isTraceEnabled()) {
-                LOG.trace("Processing exchangeId: " + exchange.getExchangeId() + " is continued being processed synchronously");
-            }
+            LOG.trace("Processing exchangeId: {} is continued being processed synchronously", exchange.getExchangeId());
         } catch (InvocationTargetException e) {
             // lets unwrap the exception when its an invocation target exception
             exchange.setException(e.getCause());

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/CamelInvocationHandler.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/CamelInvocationHandler.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/CamelInvocationHandler.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/CamelInvocationHandler.java Fri Mar 25 22:34:26 2011
@@ -59,9 +59,7 @@ public class CamelInvocationHandler impl
         exchange.getIn().setBody(invocation);
 
         // process the exchange
-        if (LOG.isTraceEnabled()) {
-            LOG.trace("Proxied method call " + method.getName() + " invoking producer: " + producer);
-        }
+        LOG.trace("Proxied method call {} invoking producer: {}", method.getName(), producer);
         producer.process(exchange);
 
         // check if we had an exception
@@ -98,9 +96,7 @@ public class CamelInvocationHandler impl
         // use type converter so we can convert output in the desired type defined by the method
         // and let it be mandatory so we know wont return null if we cant convert it to the defined type
         Object answer = exchange.getOut().getMandatoryBody(to);
-        if (LOG.isTraceEnabled()) {
-            LOG.trace("Proxied method call " + method.getName() + " returning: " + answer);
-        }
+        LOG.trace("Proxied method call {} returning: {}", method.getName(), answer);
         return answer;
     }
 

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java Fri Mar 25 22:34:26 2011
@@ -219,7 +219,7 @@ public class MethodInfo {
 
                 // invoke pojo
                 if (LOG.isTraceEnabled()) {
-                    LOG.trace(">>>> invoking: " + method + " on bean: " + pojo + " with arguments: " + asString(arguments) + " for exchange: " + exchange);
+                    LOG.trace(">>>> invoking: {} on bean: {} with arguments: {} for exchange: {}", new Object[]{method, pojo, asString(arguments), exchange});
                 }
                 Object result = invoke(method, pojo, arguments, exchange);
 
@@ -324,17 +324,13 @@ public class MethodInfo {
 
     protected Expression createParametersExpression() {
         final int size = parameters.size();
-        if (LOG.isTraceEnabled()) {
-            LOG.trace("Creating parameters expression for " + size + " parameters");
-        }
+        LOG.trace("Creating parameters expression for {} parameters", size);
 
         final Expression[] expressions = new Expression[size];
         for (int i = 0; i < size; i++) {
             Expression parameterExpression = parameters.get(i).getExpression();
             expressions[i] = parameterExpression;
-            if (LOG.isTraceEnabled()) {
-                LOG.trace("Parameter #" + i + " has expression: " + parameterExpression);
-            }
+            LOG.trace("Parameter #{} has expression: {}", i, parameterExpression);
         }
         return new Expression() {
             @SuppressWarnings("unchecked")
@@ -359,15 +355,13 @@ public class MethodInfo {
                                 try {
                                     value = exchange.getContext().getTypeConverter().mandatoryConvertTo(parameters.get(i).getType(), result);
                                     if (LOG.isTraceEnabled()) {
-                                        LOG.trace("Parameter #" + i + " evaluated as: " + value + " type: " + ObjectHelper.type(value));
+                                        LOG.trace("Parameter #{} evaluated as: {} type: ", new Object[]{i, value, ObjectHelper.type(value)});
                                     }
                                 } catch (NoTypeConversionAvailableException e) {
                                     throw ObjectHelper.wrapCamelExecutionException(exchange, e);
                                 }
                             } else {
-                                if (LOG.isTraceEnabled()) {
-                                    LOG.trace("Parameter #" + i + " evaluated as null");
-                                }
+                                LOG.trace("Parameter #{} evaluated as null", i);
                             }
                         }
                     }

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=1085587&r1=1085586&r2=1085587&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 Fri Mar 25 22:34:26 2011
@@ -36,9 +36,7 @@ public class FileConsumer extends Generi
     }
 
     protected boolean pollDirectory(String fileName, List<GenericFile<File>> fileList) {
-        if (log.isTraceEnabled()) {
-            log.trace("pollDirectory from fileName: " + fileName);
-        }
+        log.trace("pollDirectory from fileName: {}", fileName);
 
         File directory = new File(fileName);
         if (!directory.exists() || !directory.isDirectory()) {
@@ -51,21 +49,15 @@ public class FileConsumer extends Generi
             return true;
         }
 
-        if (log.isTraceEnabled()) {
-            log.trace("Polling directory: " + directory.getPath());
-        }
+        log.trace("Polling directory: {}", directory.getPath());
         File[] files = directory.listFiles();
         if (files == null || files.length == 0) {
             // no files in this directory to poll
-            if (log.isTraceEnabled()) {
-                log.trace("No files found in directory: " + directory.getPath());
-            }
+            log.trace("No files found in directory: {}", directory.getPath());
             return true;
         } else {
             // we found some files
-            if (log.isTraceEnabled()) {
-                log.trace("Found " + files.length + " in directory: " + directory.getPath());
-            }
+            log.trace("Found {} in directory: {}", files.length, directory.getPath());
         }
 
         for (File file : files) {
@@ -76,8 +68,8 @@ public class FileConsumer extends Generi
 
             // trace log as Windows/Unix can have different views what the file is?
             if (log.isTraceEnabled()) {
-                log.trace("Found file: " + file + " [isAbsolute: " + file.isAbsolute() + ", isDirectory: "
-                        + file.isDirectory() + ", isFile: " + file.isFile() + ", isHidden: " + file.isHidden() + "]");
+                log.trace("Found file: {} [isAbsolute: {}, isDirectory: {}, isFile: {}, isHidden: {}]",
+                        new Object[]{file, file.isAbsolute(), file.isDirectory(), file.isFile(), file.isHidden()});
             }
 
             // creates a generic file
@@ -96,13 +88,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)) {
-                        if (log.isTraceEnabled()) {
-                            log.trace("Skipping as file is already in progress: " + gf.getFileName());
-                        }
+                        log.trace("Skipping as file is already in progress: {}", gf.getFileName());
                     } else {
-                        if (log.isTraceEnabled()) {
-                            log.trace("Adding valid file: " + file);
-                        }
+                        log.trace("Adding valid file: {}", file);
                         // matched file so add
                         fileList.add(gf);
                     }

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=1085587&r1=1085586&r2=1085587&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 Fri Mar 25 22:34:26 2011
@@ -75,9 +75,7 @@ public class FileOperations implements G
 
         // always create endpoint defined directory
         if (endpoint.isAutoCreate() && !endpoint.getFile().exists()) {
-            if (LOG.isTraceEnabled()) {
-                LOG.trace("Building starting directory: " + endpoint.getFile());
-            }
+            LOG.trace("Building starting directory: {}", endpoint.getFile());
             endpoint.getFile().mkdirs();
         }
 
@@ -112,9 +110,7 @@ public class FileOperations implements G
             // the directory already exists
             return true;
         } else {
-            if (LOG.isTraceEnabled()) {
-                LOG.trace("Building directory: " + path);
-            }
+            LOG.trace("Building directory: {}", path);
             return path.mkdirs();
         }
     }
@@ -156,9 +152,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.");
@@ -228,17 +222,13 @@ 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,9 +239,7 @@ public class FileOperations implements G
         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;
@@ -269,9 +257,7 @@ public class FileOperations implements G
         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/GenericFile.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFile.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFile.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFile.java Fri Mar 25 22:34:26 2011
@@ -146,17 +146,13 @@ public class GenericFile<T>  {
      * @param newName the new name
      */
     public void changeFileName(String newName) {
-        if (LOG.isTraceEnabled()) {
-            LOG.trace("Changing name to: " + newName);
-        }
+        LOG.trace("Changing name to: {}", newName);
 
         // Make sure the newName is normalized.
         String newFileName = normalizePath(newName);
 
-        if (LOG.isTraceEnabled()) {            
-            LOG.trace("Normalized endpointPath: " + endpointPath);
-            LOG.trace("Normalized newFileName: " + newFileName);
-        }
+        LOG.trace("Normalized endpointPath: {}", endpointPath);
+        LOG.trace("Normalized newFileName: ()", newFileName);
 
         File file = new File(newFileName);
         if (!absolute) {
@@ -197,12 +193,12 @@ public class GenericFile<T>  {
         }
 
         if (LOG.isTraceEnabled()) {
-            LOG.trace("FileNameOnly: " + getFileNameOnly());
-            LOG.trace("FileName: " + getFileName());
-            LOG.trace("Absolute: " + isAbsolute());
-            LOG.trace("Relative path: " + getRelativeFilePath());
-            LOG.trace("Absolute path: " + getAbsoluteFilePath());
-            LOG.trace("Name changed to: " + this);
+            LOG.trace("FileNameOnly: {}", getFileNameOnly());
+            LOG.trace("FileName: {}", getFileName());
+            LOG.trace("Absolute: {}", isAbsolute());
+            LOG.trace("Relative path: {}", getRelativeFilePath());
+            LOG.trace("Absolute path: {}", getAbsoluteFilePath());
+            LOG.trace("Name changed to: {}", this);
         }
     }
 

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=1085587&r1=1085586&r2=1085587&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 Fri Mar 25 22:34:26 2011
@@ -263,9 +263,7 @@ public abstract class GenericFileConsume
      */
     protected void processExchange(final Exchange exchange) {
         GenericFile<T> file = getExchangeFileProperty(exchange);
-        if (log.isTraceEnabled()) {
-            log.trace("Processing file: " + file);
-        }
+        log.trace("Processing file: {}", file);
 
         // must extract the absolute name before the begin strategy as the file could potentially be pre moved
         // and then the file name would be changed
@@ -299,9 +297,7 @@ public abstract class GenericFileConsume
         final String name = target.getAbsoluteFilePath();
         try {
             // retrieve the file using the stream
-            if (log.isTraceEnabled()) {
-                log.trace("Retrieving file: " + name + " from: " + endpoint);
-            }
+            log.trace("Retrieving file: {} from: {}", name, endpoint);
 
             // retrieve the file and check it was a success
             boolean retrieved = operations.retrieveFile(name, exchange);
@@ -312,9 +308,7 @@ public abstract class GenericFileConsume
                 throw new GenericFileOperationFailedException("Cannot retrieve file: " + file + " from: " + endpoint);
             }
 
-            if (log.isTraceEnabled()) {
-                log.trace("Retrieved file: " + name + " from: " + endpoint);
-            }
+            log.trace("Retrieved file: {} from: {}", name, endpoint);
 
             // register on completion callback that does the completion strategies
             // (for instance to move the file after we have processed it)
@@ -330,9 +324,7 @@ public abstract class GenericFileConsume
             getAsyncProcessor().process(exchange, new AsyncCallback() {
                 public void done(boolean doneSync) {
                     // noop
-                    if (log.isTraceEnabled()) {
-                        log.trace("Done processing file: " + target + (doneSync ? " synchronously" : " asynchronously"));
-                    }
+                    log.trace("Done processing file: {} {}", target, doneSync ? "synchronously" : "asynchronously");
                 }
             });
 
@@ -355,14 +347,10 @@ public abstract class GenericFileConsume
      */
     protected boolean isValidFile(GenericFile<T> file, boolean isDirectory) {
         if (!isMatched(file, isDirectory)) {
-            if (log.isTraceEnabled()) {
-                log.trace("File did not match. Will skip this file: " + file);
-            }
+            log.trace("File did not match. Will skip this file: {}", file);
             return false;
         } else if (endpoint.isIdempotent() && endpoint.getIdempotentRepository().contains(file.getAbsoluteFilePath())) {
-            if (log.isTraceEnabled()) {
-                log.trace("This consumer is idempotent and the file has been consumed before. Will skip this file: " + file);
-            }
+            log.trace("This consumer is idempotent and the file has been consumed before. Will skip this file: {}", file);
             return false;
         }
 
@@ -438,17 +426,13 @@ public abstract class GenericFileConsume
 
             // is it a done file name?
             if (endpoint.isDoneFile(file.getFileNameOnly())) {
-                if (log.isTraceEnabled()) {
-                    log.trace("Skipping done file: " + file);
-                }
+                log.trace("Skipping done file: {}", file);
                 return false;
             }
 
             // the file is only valid if the done file exist
             if (!operations.existsFile(doneFileName)) {
-                if (log.isTraceEnabled()) {
-                    log.trace("Done file: " + doneFileName + " does not exist");
-                }
+                log.trace("Done file: {} does not exist", doneFileName);
                 return false;
             }
         }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java Fri Mar 25 22:34:26 2011
@@ -139,41 +139,31 @@ public abstract class GenericFileEndpoin
         Class<?> factory = null;
         try {
             FactoryFinder finder = getCamelContext().getFactoryFinder("META-INF/services/org/apache/camel/component/");
-            if (log.isTraceEnabled()) {
-                log.trace("Using FactoryFinder: " + finder);
-            }
+            log.trace("Using FactoryFinder: {}", finder);
             factory = finder.findClass(getScheme(), "strategy.factory.");
         } catch (ClassNotFoundException e) {
-            if (log.isTraceEnabled()) {
-                log.trace("'strategy.factory.class' not found", e);
-            }
+            log.trace("'strategy.factory.class' not found", e);
         } catch (IOException e) {
-            if (log.isTraceEnabled()) {
-                log.trace("No strategy factory defined in 'META-INF/services/org/apache/camel/component/'", e);
-            }
+            log.trace("No strategy factory defined in 'META-INF/services/org/apache/camel/component/'", e);
         }
 
         if (factory == null) {
             // use default
             try {
-                if (log.isTraceEnabled()) {
-                    log.trace("Using ClassResolver to resolve class: " + DEFAULT_STRATEGYFACTORY_CLASS);
-                }
+                log.trace("Using ClassResolver to resolve class: {}", DEFAULT_STRATEGYFACTORY_CLASS);
                 factory = this.getCamelContext().getClassResolver().resolveClass(DEFAULT_STRATEGYFACTORY_CLASS);
             } catch (Exception e) {
-                if (log.isTraceEnabled()) {
-                    log.trace("Cannot load class: " + DEFAULT_STRATEGYFACTORY_CLASS, e);
-                }
+                log.trace("Cannot load class: {}", DEFAULT_STRATEGYFACTORY_CLASS, e);
             }
             // fallback and us this class loader
             try {
                 if (log.isTraceEnabled()) {
-                    log.trace("Using classloader: " + this.getClass().getClassLoader() + " to resolve class: " + DEFAULT_STRATEGYFACTORY_CLASS);
+                    log.trace("Using classloader: {} to resolve class: {}", this.getClass().getClassLoader(), DEFAULT_STRATEGYFACTORY_CLASS);
                 }
                 factory = this.getCamelContext().getClassResolver().resolveClass(DEFAULT_STRATEGYFACTORY_CLASS, this.getClass().getClassLoader());
             } catch (Exception e) {
                 if (log.isTraceEnabled()) {
-                    log.trace("Cannot load class: " + DEFAULT_STRATEGYFACTORY_CLASS + " using classloader: " + this.getClass().getClassLoader(), e);
+                    log.trace("Cannot load class: {} using classloader: " + this.getClass().getClassLoader(), DEFAULT_STRATEGYFACTORY_CLASS, e);
                 }
             }
 

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileOnCompletion.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileOnCompletion.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileOnCompletion.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileOnCompletion.java Fri Mar 25 22:34:26 2011
@@ -124,9 +124,7 @@ public class GenericFileOnCompletion<T> 
             try {
                 // delete done file
                 boolean deleted = operations.deleteFile(doneFileName);
-                if (log.isTraceEnabled()) {
-                    log.trace("Done file: " + doneFileName + " was deleted: " + deleted);
-                }
+                log.trace("Done file: {} was deleted: {}", doneFileName, deleted);
                 if (!deleted) {
                     log.warn("Done file: " + doneFileName + " could not be deleted");
                 }
@@ -136,9 +134,7 @@ public class GenericFileOnCompletion<T> 
         }
 
         try {
-            if (log.isTraceEnabled()) {
-                log.trace("Commit file strategy: " + processStrategy + " for file: " + file);
-            }
+            log.trace("Commit file strategy: {} for file: {}", processStrategy, file);
             processStrategy.commit(operations, endpoint, exchange, file);
         } catch (Exception e) {
             handleException(e);

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=1085587&r1=1085586&r2=1085587&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 Fri Mar 25 22:34:26 2011
@@ -105,9 +105,7 @@ public class GenericFileProducer<T> exte
      * @throws Exception is thrown if some error
      */
     protected void processExchange(Exchange exchange, String target) throws Exception {
-        if (log.isTraceEnabled()) {
-            log.trace("Processing file: " + target + " for exchange: " + exchange);
-        }
+        log.trace("Processing file: {} for exchange: {}", target, exchange);
 
         try {
             preWriteCheck();
@@ -119,9 +117,7 @@ public class GenericFileProducer<T> exte
                 // compute temporary name with the temp prefix
                 tempTarget = createTempFileName(exchange, target);
 
-                if (log.isTraceEnabled()) {
-                    log.trace("Writing using tempNameFile: " + tempTarget);
-                }
+                log.trace("Writing using tempNameFile: {}", tempTarget);
 
                 // cater for file exists option on the real target as
                 // the file operations code will work on the temp file
@@ -130,18 +126,14 @@ public class GenericFileProducer<T> exte
                 if (operations.existsFile(target)) {
                     if (endpoint.getFileExist() == GenericFileExist.Ignore) {
                         // ignore but indicate that the file was written
-                        if (log.isTraceEnabled()) {
-                            log.trace("An existing file already exists: " + target + ". Ignore and do not override it.");
-                        }
+                        log.trace("An existing file already exists: {}. Ignore and do not override it.", target);
                         return;
                     } else if (endpoint.getFileExist() == GenericFileExist.Fail) {
                         throw new GenericFileOperationFailedException("File already exist: " + target + ". Cannot write new file.");
                     } else if (endpoint.isEagerDeleteTargetFile() && endpoint.getFileExist() == GenericFileExist.Override) {
                         // we override the target so we do this by deleting it so the temp file can be renamed later
                         // with success as the existing target file have been deleted
-                        if (log.isTraceEnabled()) {
-                            log.trace("Eagerly deleting existing file: " + target);
-                        }
+                        log.trace("Eagerly deleting existing file: {}", target);
                         if (!operations.deleteFile(target)) {
                             throw new GenericFileOperationFailedException("Cannot delete file: " + target);
                         }
@@ -150,9 +142,7 @@ public class GenericFileProducer<T> exte
 
                 // delete any pre existing temp file
                 if (operations.existsFile(tempTarget)) {
-                    if (log.isTraceEnabled()) {
-                        log.trace("Deleting existing temp file: " + tempTarget);
-                    }
+                    log.trace("Deleting existing temp file: {}", tempTarget);
                     if (!operations.deleteFile(tempTarget)) {
                         throw new GenericFileOperationFailedException("Cannot delete file: " + tempTarget);
                     }
@@ -171,18 +161,14 @@ public class GenericFileProducer<T> exte
                         && endpoint.getFileExist() == GenericFileExist.Override) {
                     // we override the target so we do this by deleting it so the temp file can be renamed later
                     // with success as the existing target file have been deleted
-                    if (log.isTraceEnabled()) {
-                        log.trace("Deleting existing file: " + target);
-                    }
+                    log.trace("Deleting existing file: {}", target);
                     if (!operations.deleteFile(target)) {
                         throw new GenericFileOperationFailedException("Cannot delete file: " + target);
                     }
                 }
 
                 // now we are ready to rename the temp file to the target file
-                if (log.isTraceEnabled()) {
-                    log.trace("Renaming file: [" + tempTarget + "] to: [" + target + "]");
-                }
+                log.trace("Renaming file: [{}] to: [{}]", tempTarget, target);
                 boolean renamed = operations.renameFile(tempTarget, target);
                 if (!renamed) {
                     throw new GenericFileOperationFailedException("Cannot rename file from: " + tempTarget + " to: " + target);
@@ -198,9 +184,7 @@ public class GenericFileProducer<T> exte
                 Exchange empty = new DefaultExchange(exchange);
                 empty.getIn().setBody("");
 
-                if (log.isTraceEnabled()) {
-                    log.trace("Writing done file: [" + doneFileName + "]");
-                }
+                log.trace("Writing done file: [{}]", doneFileName);
                 // delete any existing done file
                 if (operations.existsFile(doneFileName)) {
                     if (!operations.deleteFile(doneFileName)) {
@@ -262,9 +246,7 @@ public class GenericFileProducer<T> exte
         }
 
         // upload
-        if (log.isTraceEnabled()) {
-            log.trace("About to write [" + fileName + "] to [" + getEndpoint() + "] from exchange [" + exchange + "]");
-        }
+        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/component/file/strategy/FileChangedExclusiveReadLockStrategy.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/FileChangedExclusiveReadLockStrategy.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/FileChangedExclusiveReadLockStrategy.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/FileChangedExclusiveReadLockStrategy.java Fri Mar 25 22:34:26 2011
@@ -45,9 +45,7 @@ public class FileChangedExclusiveReadLoc
         File target = new File(file.getAbsoluteFilePath());
         boolean exclusive = false;
 
-        if (LOG.isTraceEnabled()) {
-            LOG.trace("Waiting for exclusive read lock to file: " + file);
-        }
+        LOG.trace("Waiting for exclusive read lock to file: {}", file);
 
         try {
             long lastModified = Long.MIN_VALUE;
@@ -68,10 +66,8 @@ public class FileChangedExclusiveReadLoc
                 long newLastModified = target.lastModified();
                 long newLength = target.length();
 
-                if (LOG.isTraceEnabled()) {
-                    LOG.trace("Previous last modified: " + lastModified + ", new last modified: " + newLastModified);
-                    LOG.trace("Previous length: " + length + ", new length: " + newLength);
-                }
+                LOG.trace("Previous last modified: {}, new last modified: {}", lastModified, newLastModified);
+                LOG.trace("Previous length: {}, new length: {}", length, newLength);
 
                 if (newLastModified == lastModified && newLength == length) {
                     // let super handle the last part of acquiring the lock now the file is not
@@ -111,9 +107,7 @@ public class FileChangedExclusiveReadLoc
     }
 
     private boolean sleep() {
-        if (LOG.isTraceEnabled()) {
-            LOG.trace("Exclusive read lock not granted. Sleeping for " + checkInterval + " millis.");
-        }
+        LOG.trace("Exclusive read lock not granted. Sleeping for {} millis.", checkInterval);
         try {
             Thread.sleep(checkInterval);
             return false;

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/FileLockExclusiveReadLockStrategy.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/FileLockExclusiveReadLockStrategy.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/FileLockExclusiveReadLockStrategy.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/FileLockExclusiveReadLockStrategy.java Fri Mar 25 22:34:26 2011
@@ -52,9 +52,7 @@ public class FileLockExclusiveReadLockSt
     public boolean acquireExclusiveReadLock(GenericFileOperations<File> operations, GenericFile<File> file, Exchange exchange) throws Exception {
         File target = new File(file.getAbsoluteFilePath());
 
-        if (LOG.isTraceEnabled()) {
-            LOG.trace("Waiting for exclusive read lock to file: " + target);
-        }
+        LOG.trace("Waiting for exclusive read lock to file: {}", target);
 
         try {
             // try to acquire rw lock on the file before we can consume it
@@ -81,9 +79,7 @@ public class FileLockExclusiveReadLockSt
                     // Also catch the OverlappingFileLockException here. Do nothing here                    
                 }
                 if (lock != null) {
-                    if (LOG.isTraceEnabled()) {
-                        LOG.trace("Acquired exclusive read lock: " + lock + " to file: " + target);
-                    }
+                    LOG.trace("Acquired exclusive read lock: {} to file: {}", lock, target);
                     lockFileName = target.getName();
                     exclusive = true;
                 } else {
@@ -128,9 +124,7 @@ public class FileLockExclusiveReadLockSt
     }
 
     private boolean sleep() {
-        if (LOG.isTraceEnabled()) {
-            LOG.trace("Exclusive read lock not granted. Sleeping for " + checkInterval + " millis.");
-        }
+        LOG.trace("Exclusive read lock not granted. Sleeping for {} millis.", checkInterval);
         try {
             Thread.sleep(checkInterval);
             return false;

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/GenericFileDeleteProcessStrategy.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/GenericFileDeleteProcessStrategy.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/GenericFileDeleteProcessStrategy.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/GenericFileDeleteProcessStrategy.java Fri Mar 25 22:34:26 2011
@@ -69,9 +69,7 @@ public class GenericFileDeleteProcessStr
             if (!exits) {
                 deleted = true;
             } else {
-                if (log.isTraceEnabled()) {
-                    log.trace("File was not deleted at this attempt will try again in 1 sec.: " + file);
-                }
+                log.trace("File was not deleted at this attempt will try again in 1 sec.: {}", file);
                 // sleep a bit and try again
                 Thread.sleep(1000);
             }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/GenericFileProcessStrategySupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/GenericFileProcessStrategySupport.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/GenericFileProcessStrategySupport.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/GenericFileProcessStrategySupport.java Fri Mar 25 22:34:26 2011
@@ -108,9 +108,7 @@ public abstract class GenericFileProcess
         File local = exchange.getIn().getHeader(Exchange.FILE_LOCAL_WORK_PATH, File.class);
         if (local != null && local.exists()) {
             boolean deleted = FileUtil.deleteFile(local);
-            if (log.isTraceEnabled()) {
-                log.trace("Local work file: " + local + " was deleted: " + deleted);
-            }
+            log.trace("Local work file: {} was deleted: {}", local, deleted);
         }
     }
 }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/GenericFileRenameExclusiveReadLockStrategy.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/GenericFileRenameExclusiveReadLockStrategy.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/GenericFileRenameExclusiveReadLockStrategy.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/GenericFileRenameExclusiveReadLockStrategy.java Fri Mar 25 22:34:26 2011
@@ -41,9 +41,7 @@ public class GenericFileRenameExclusiveR
 
     public boolean acquireExclusiveReadLock(GenericFileOperations<T> operations, GenericFile<T> file,
                                             Exchange exchange) throws Exception {
-        if (LOG.isTraceEnabled()) {
-            LOG.trace("Waiting for exclusive read lock to file: " + file);
-        }
+        LOG.trace("Waiting for exclusive read lock to file: {}", file);
 
         // the trick is to try to rename the file, if we can rename then we have exclusive read
         // since its a Generic file we cannot use java.nio to get a RW lock
@@ -68,9 +66,7 @@ public class GenericFileRenameExclusiveR
 
             exclusive = operations.renameFile(file.getAbsoluteFilePath(), newFile.getAbsoluteFilePath());
             if (exclusive) {
-                if (LOG.isTraceEnabled()) {
-                    LOG.trace("Acquired exclusive read lock to file: " + file);
-                }
+                LOG.trace("Acquired exclusive read lock to file: {}", file);
                 // rename it back so we can read it
                 operations.renameFile(newFile.getAbsoluteFilePath(), file.getAbsoluteFilePath());
             } else {
@@ -91,9 +87,7 @@ public class GenericFileRenameExclusiveR
     }
 
     private boolean sleep() {
-        if (LOG.isTraceEnabled()) {
-            LOG.trace("Exclusive read lock not granted. Sleeping for " + checkInterval + " millis.");
-        }
+        LOG.trace("Exclusive read lock not granted. Sleeping for {} millis.", checkInterval);
         try {
             Thread.sleep(checkInterval);
             return false;

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/MarkerFileExclusiveReadLockStrategy.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/MarkerFileExclusiveReadLockStrategy.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/MarkerFileExclusiveReadLockStrategy.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/MarkerFileExclusiveReadLockStrategy.java Fri Mar 25 22:34:26 2011
@@ -51,9 +51,7 @@ public class MarkerFileExclusiveReadLock
     public boolean acquireExclusiveReadLock(GenericFileOperations<File> operations,
                                             GenericFile<File> file, Exchange exchange) throws Exception {
         lockFileName = file.getAbsoluteFilePath() + FileComponent.DEFAULT_LOCK_FILE_POSTFIX;
-        if (LOG.isTraceEnabled()) {
-            LOG.trace("Locking the file: " + file + " using the lock file name: " + lockFileName);
-        }
+        LOG.trace("Locking the file: {} using the lock file name: {}", file, lockFileName);
 
         // create a plain file as marker filer for locking (do not use FileLock)
         lock = new File(lockFileName);
@@ -69,14 +67,10 @@ public class MarkerFileExclusiveReadLock
     public void releaseExclusiveReadLock(GenericFileOperations<File> operations,
                                          GenericFile<File> file, Exchange exchange) throws Exception {
         if (lock != null) {
-            if (LOG.isTraceEnabled()) {
-                LOG.trace("Unlocking file: " + lockFileName);
-            }
+            LOG.trace("Unlocking file: {}", lockFileName);
 
             boolean deleted = FileUtil.deleteFile(lock);
-            if (LOG.isTraceEnabled()) {
-                LOG.trace("Lock file: " + lockFileName + " was deleted: " + deleted);
-            }
+            LOG.trace("Lock file: {} was deleted: {}", lockFileName, deleted);
         }
     }
 

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java Fri Mar 25 22:34:26 2011
@@ -67,9 +67,7 @@ public class PropertiesComponent extends
         // override default locations
         String locations = getAndRemoveParameter(parameters, "locations", String.class);
         if (locations != null) {
-            if (LOG.isTraceEnabled()) {
-                LOG.trace("Overriding default locations with location: " + locations);
-            }
+            LOG.trace("Overriding default locations with location: {}", locations);
             paths = locations.split(",");
         }
         String endpointUri = parseUri(remaining, paths);
@@ -107,9 +105,7 @@ public class PropertiesComponent extends
             uri = uri + SUFFIX_TOKEN;
         }
 
-        if (LOG.isTraceEnabled()) {
-            LOG.trace("Parsing uri " + uri + " with properties: " + prop);
-        }
+        LOG.trace("Parsing uri {} with properties: {}", uri, prop);
         return propertiesParser.parseUri(uri, prop, PREFIX_TOKEN, SUFFIX_TOKEN);
     }
 

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/seda/SedaConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/seda/SedaConsumer.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/seda/SedaConsumer.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/seda/SedaConsumer.java Fri Mar 25 22:34:26 2011
@@ -128,9 +128,7 @@ public class SedaConsumer extends Servic
                         getExceptionHandler().handleException("Error processing exchange", exchange, e);
                     }
                 } else if (shutdownPending && queue.isEmpty()) {
-                    if (LOG.isTraceEnabled()) {
-                        LOG.trace("Shutdown is pending, so this consumer thread is breaking out because the task queue is empty.");
-                    }
+                    LOG.trace("Shutdown is pending, so this consumer thread is breaking out because the task queue is empty.");
                     // we want to shutdown so break out if there queue is empty
                     break;
                 }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/seda/SedaProducer.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/seda/SedaProducer.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/seda/SedaProducer.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/seda/SedaProducer.java Fri Mar 25 22:34:26 2011
@@ -68,12 +68,12 @@ public class SedaProducer extends Collec
                     // check for timeout, which then already would have invoked the latch
                     if (latch.getCount() == 0) {
                         if (log.isTraceEnabled()) {
-                            log.trace(this + ". Timeout occurred so response will be ignored: " + (response.hasOut() ? response.getOut() : response.getIn()));
+                            log.trace("{}. Timeout occurred so response will be ignored: {}", this, response.hasOut() ? response.getOut() : response.getIn());
                         }
                         return;
                     } else {
                         if (log.isTraceEnabled()) {
-                            log.trace(this + " with response: " + (response.hasOut() ? response.getOut() : response.getIn()));
+                            log.trace("{} with response: {}", this, response.hasOut() ? response.getOut() : response.getIn());
                         }
                         try {
                             ExchangeHelper.copyResults(exchange, response);
@@ -97,14 +97,12 @@ public class SedaProducer extends Collec
                 }
             });
 
-            if (log.isTraceEnabled()) {
-                log.trace("Adding Exchange to queue: " + copy);
-            }
+            log.trace("Adding Exchange to queue: {}", copy);
             queue.add(copy);
 
             if (timeout > 0) {
                 if (log.isTraceEnabled()) {
-                    log.trace("Waiting for task to complete using timeout (ms): " + timeout + " at [" + endpoint.getEndpointUri() + "]");
+                    log.trace("Waiting for task to complete using timeout (ms): {} at [{}]", timeout, endpoint.getEndpointUri());
                 }
                 // lets see if we can get the task done before the timeout
                 boolean done = false;
@@ -120,7 +118,7 @@ public class SedaProducer extends Collec
                 }
             } else {
                 if (log.isTraceEnabled()) {
-                    log.trace("Waiting for task to complete (blocking) at [" + endpoint.getEndpointUri() + "]");
+                    log.trace("Waiting for task to complete (blocking) at [{}]", endpoint.getEndpointUri());
                 }
                 // no timeout then wait until its done
                 try {
@@ -131,9 +129,7 @@ public class SedaProducer extends Collec
             }
         } else {
             // no wait, eg its a InOnly then just add to queue and return
-            if (log.isTraceEnabled()) {
-                log.trace("Adding Exchange to queue: " + copy);
-            }
+            log.trace("Adding Exchange to queue: {}", copy);
             queue.add(copy);
         }
 

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/timer/TimerConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/timer/TimerConsumer.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/timer/TimerConsumer.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/timer/TimerConsumer.java Fri Mar 25 22:34:26 2011
@@ -97,9 +97,7 @@ public class TimerConsumer extends Defau
         // also set now on in header with same key as quartz to be consistent
         exchange.getIn().setHeader("firedTime", now);
 
-        if (LOG.isTraceEnabled()) {
-            LOG.trace("Timer " + endpoint.getTimerName() + " is firing");
-        }
+        LOG.trace("Timer {} is firing", endpoint.getTimerName());
         try {
             getProcessor().process(exchange);
 

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/converter/TimePatternConverter.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/TimePatternConverter.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/converter/TimePatternConverter.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/converter/TimePatternConverter.java Fri Mar 25 22:34:26 2011
@@ -53,9 +53,7 @@ public final class TimePatternConverter 
             matcher = createMatcher(REPLACEMENT_PATTERN, source);
             String replacedSource = matcher.replaceAll(""); 
             
-            if (LOG.isTraceEnabled()) {
-                LOG.trace("Replaced original source " + source + " to " + replacedSource);
-            }
+            LOG.trace("Replaced original source {} to {}", source, replacedSource);
             
             matcher = createMatcher(HOUR_REGEX_PATTERN, replacedSource);
             if (matcher.find()) {
@@ -90,9 +88,7 @@ public final class TimePatternConverter 
             }
         }       
         
-        if (LOG.isTraceEnabled()) {
-            LOG.trace("source: " + source + " milliseconds: " + milliseconds);
-        }
+        LOG.trace("source: {} milliseconds: ", source, milliseconds);
         
         return milliseconds;
     }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/converter/stream/CachedOutputStream.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/stream/CachedOutputStream.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/converter/stream/CachedOutputStream.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/converter/stream/CachedOutputStream.java Fri Mar 25 22:34:26 2011
@@ -204,9 +204,7 @@ public class CachedOutputStream extends 
             tempFile = FileUtil.createTempFile("cos", ".tmp", outputDir);
         }
 
-        if (LOG.isTraceEnabled()) {
-            LOG.trace("Creating temporary stream cache file: " + tempFile);
-        }
+        LOG.trace("Creating temporary stream cache file: {}", tempFile);
 
         try {
             currentStream = new BufferedOutputStream(new FileOutputStream(tempFile));

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java Fri Mar 25 22:34:26 2011
@@ -396,9 +396,7 @@ public class DefaultCamelContext extends
     public Endpoint getEndpoint(String uri) {
         ObjectHelper.notEmpty(uri, "uri");
 
-        if (log.isTraceEnabled()) {
-            log.trace("Getting endpoint with uri: " + uri);
-        }
+        log.trace("Getting endpoint with uri: {}", uri);
 
         // in case path has property placeholders then try to let property component resolve those
         try {
@@ -410,9 +408,7 @@ public class DefaultCamelContext extends
         // normalize uri so we can do endpoint hits with minor mistakes and parameters is not in the same order
         uri = normalizeEndpointUri(uri);
 
-        if (log.isTraceEnabled()) {
-            log.trace("Getting endpoint with normalized uri: " + uri);
-        }
+        log.trace("Getting endpoint with normalized uri: {}", uri);
 
         Endpoint answer;
         String scheme = null;

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExecutorServiceStrategy.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExecutorServiceStrategy.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExecutorServiceStrategy.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExecutorServiceStrategy.java Fri Mar 25 22:34:26 2011
@@ -334,9 +334,7 @@ public class DefaultExecutorServiceStrat
             LOG.debug("Shutdown ExecutorService: " + executorService);
         }
         executorService.shutdown();
-        if (LOG.isTraceEnabled()) {
-            LOG.trace("Shutdown ExecutorService: " + executorService + " complete.");
-        }
+        LOG.trace("Shutdown ExecutorService: {} complete.", executorService);
     }
 
     public List<Runnable> shutdownNow(ExecutorService executorService) {
@@ -350,9 +348,7 @@ public class DefaultExecutorServiceStrat
             LOG.debug("ShutdownNow ExecutorService: " + executorService);
         }
         List<Runnable> answer = executorService.shutdownNow();
-        if (LOG.isTraceEnabled()) {
-            LOG.trace("ShutdownNow ExecutorService: " + executorService + " complete.");
-        }
+        LOG.trace("ShutdownNow ExecutorService: {} complete.", executorService);
 
         return answer;
     }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultInflightRepository.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultInflightRepository.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultInflightRepository.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultInflightRepository.java Fri Mar 25 22:34:26 2011
@@ -39,9 +39,7 @@ public class DefaultInflightRepository e
 
     public void add(Exchange exchange) {
         int count = totalCount.incrementAndGet();
-        if (LOG.isTraceEnabled()) {
-            LOG.trace("Total " + count + " inflight exchanges. Last added: " + exchange.getExchangeId());
-        }
+        LOG.trace("Total {} inflight exchanges. Last added: {}", count, exchange.getExchangeId());
 
         if (exchange.getFromEndpoint() == null) {
             return;
@@ -56,9 +54,7 @@ public class DefaultInflightRepository e
 
     public void remove(Exchange exchange) {
         int count = totalCount.decrementAndGet();
-        if (LOG.isTraceEnabled()) {
-            LOG.trace("Total " + count + " inflight exchanges. Last removed: " + exchange.getExchangeId());
-        }
+        LOG.trace("Total {} inflight exchanges. Last removed: {}", count, exchange.getExchangeId());
 
         if (exchange.getFromEndpoint() == null) {
             return;

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultPackageScanClassResolver.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultPackageScanClassResolver.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultPackageScanClassResolver.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultPackageScanClassResolver.java Fri Mar 25 22:34:26 2011
@@ -58,9 +58,7 @@ public class DefaultPackageScanClassReso
         try {
             ClassLoader ccl = Thread.currentThread().getContextClassLoader();
             if (ccl != null) {
-                if (log.isTraceEnabled()) {
-                    log.trace("Adding ContextClassLoader from current thread: " + ccl);
-                }
+                log.trace("Adding ContextClassLoader from current thread: {}", ccl);
                 classLoaders.add(ccl);
             }
         } catch (Exception e) {
@@ -214,8 +212,8 @@ public class DefaultPackageScanClassReso
 
     protected void find(PackageScanFilter test, String packageName, ClassLoader loader, Set<Class<?>> classes) {
         if (log.isTraceEnabled()) {
-            log.trace("Searching for: " + test + " in package: " + packageName + " using classloader: "
-                    + loader.getClass().getName());
+            log.trace("Searching for: {} in package: {} using classloader: {}", 
+                    new Object[]{test, packageName, loader.getClass().getName()});
         }
 
         Enumeration<URL> urls;
@@ -233,16 +231,14 @@ public class DefaultPackageScanClassReso
             URL url = null;
             try {
                 url = urls.nextElement();
-                if (log.isTraceEnabled()) {
-                    log.trace("URL from classloader: " + url);
-                }
+                log.trace("URL from classloader: {}", url);
                 
                 url = customResourceLocator(url);
 
                 String urlPath = url.getFile();
                 urlPath = URLDecoder.decode(urlPath, "UTF-8");
                 if (log.isTraceEnabled()) {
-                    log.trace("Decoded urlPath: " + urlPath + " with protocol: " + url.getProtocol());
+                    log.trace("Decoded urlPath: {} with protocol: {}", urlPath, url.getProtocol());
                 }
 
                 // If it's a file in a directory, trim the stupid file: spec
@@ -273,15 +269,11 @@ public class DefaultPackageScanClassReso
                     urlPath = urlPath.substring(0, urlPath.indexOf('!'));
                 }
 
-                if (log.isTraceEnabled()) {
-                    log.trace("Scanning for classes in [" + urlPath + "] matching criteria: " + test);
-                }
+                log.trace("Scanning for classes in [{}] matching criteria: {}", urlPath, test);
 
                 File file = new File(urlPath);
                 if (file.isDirectory()) {
-                    if (log.isTraceEnabled()) {
-                        log.trace("Loading from directory using file: " + file);
-                    }
+                    log.trace("Loading from directory using file: {}", file);
                     loadImplementationsInDirectory(test, packageName, file, classes);
                 } else {
                     InputStream stream;
@@ -290,18 +282,14 @@ public class DefaultPackageScanClassReso
                             || isAcceptableScheme(urlPath)) {                        
                         // load resources using http/https, sonicfs and other acceptable scheme
                         // sonic ESB requires to be loaded using a regular URLConnection
-                        if (log.isTraceEnabled()) {
-                            log.trace("Loading from jar using url: " + urlPath);
-                        }
+                        log.trace("Loading from jar using url: {}", urlPath);
                         URL urlStream = new URL(urlPath);
                         URLConnection con = urlStream.openConnection();
                         // disable cache mainly to avoid jar file locking on Windows
                         con.setUseCaches(false);
                         stream = con.getInputStream();
                     } else {
-                        if (log.isTraceEnabled()) {
-                            log.trace("Loading from jar using file: " + file);
-                        }
+                        log.trace("Loading from jar using file: {}", file);
                         stream = new FileInputStream(file);
                     }
 
@@ -332,9 +320,7 @@ public class DefaultPackageScanClassReso
      * @throws IOException is thrown by the classloader
      */
     protected Enumeration<URL> getResources(ClassLoader loader, String packageName) throws IOException {
-        if (log.isTraceEnabled()) {
-            log.trace("Getting resource URL for package: " + packageName + " with classloader: " + loader);
-        }
+        log.trace("Getting resource URL for package: {} with classloader: {}", packageName, loader);
         
         // If the URL is a jar, the URLClassloader.getResources() seems to require a trailing slash.  The
         // trailing slash is harmless for other URLs  
@@ -436,18 +422,12 @@ public class DefaultPackageScanClassReso
             Set<ClassLoader> set = getClassLoaders();
             boolean found = false;
             for (ClassLoader classLoader : set) {
-                if (log.isTraceEnabled()) {
-                    log.trace("Testing for class " + externalName + " matches criteria [" + test + "] using classloader:" + classLoader);
-                }
+                log.trace("Testing for class {} matches criteria [{}] using classloader: {}", new Object[]{externalName, test, classLoader});
                 try {
                     Class<?> type = classLoader.loadClass(externalName);
-                    if (log.isTraceEnabled()) {
-                        log.trace("Loaded the class: " + type + " in classloader: " + classLoader);
-                    }
+                    log.trace("Loaded the class: {} in classloader: {}", type, classLoader);
                     if (test.matches(type)) {
-                        if (log.isTraceEnabled()) {
-                            log.trace("Found class: " + type + " which matches the filter in classloader: " + classLoader);
-                        }
+                        log.trace("Found class: {} which matches the filter in classloader: {}", type, classLoader);
                         classes.add(type);
                     }
                     found = true;

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultProducer.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultProducer.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultProducer.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultProducer.java Fri Mar 25 22:34:26 2011
@@ -68,9 +68,7 @@ public abstract class DefaultProducer ex
                 log.debug("Starting producer: " + this);
             }
         } else {
-            if (log.isTraceEnabled()) {
-                log.trace("Starting producer: " + this);
-            }
+            log.trace("Starting producer: {}", this);
         }
     }
 
@@ -81,9 +79,7 @@ public abstract class DefaultProducer ex
                 log.debug("Stopping producer: " + this);
             }
         } else {
-            if (log.isTraceEnabled()) {
-                log.trace("Stopping producer: " + this);
-            }
+            log.trace("Stopping producer: {}", this);
         }
     }
 }



Mime
View raw message