You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by cm...@apache.org on 2011/03/25 23:34:28 UTC
svn commit: r1085587 [2/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...
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultScheduledPollConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultScheduledPollConsumer.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultScheduledPollConsumer.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultScheduledPollConsumer.java Fri Mar 25 22:34:26 2011
@@ -51,9 +51,7 @@ public class DefaultScheduledPollConsume
}
messagesPolled++;
- if (log.isTraceEnabled()) {
- log.trace("Polled " + messagesPolled + " " + exchange);
- }
+ log.trace("Polled {} {}", messagesPolled, exchange);
// if the result of the polled exchange has output we should create a new exchange and
// use the output as input to the next processor
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultServicePool.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultServicePool.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultServicePool.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultServicePool.java Fri Mar 25 22:34:26 2011
@@ -66,9 +66,7 @@ public abstract class DefaultServicePool
entry = new ArrayBlockingQueue<Service>(capacity);
pool.put(key, entry);
}
- if (log.isTraceEnabled()) {
- log.trace("AddAndAcquire key: " + key + " service: " + service);
- }
+ log.trace("AddAndAcquire key: {} service: {}", key, service);
// test if queue will be full
if (entry.size() >= capacity) {
@@ -80,23 +78,17 @@ public abstract class DefaultServicePool
public synchronized Service acquire(Key key) {
BlockingQueue<Service> services = pool.get(key);
if (services == null || services.isEmpty()) {
- if (log.isTraceEnabled()) {
- log.trace("No free services in pool to acquire for key: " + key);
- }
+ log.trace("No free services in pool to acquire for key: {}", key);
return null;
}
Service answer = services.poll();
- if (log.isTraceEnabled()) {
- log.trace("Acquire: " + key + " service: " + answer);
- }
+ log.trace("Acquire: {} service: {}", key, answer);
return answer;
}
public synchronized void release(Key key, Service service) {
- if (log.isTraceEnabled()) {
- log.trace("Release: " + key + " service: " + service);
- }
+ log.trace("Release: {} service: {}", key, service);
BlockingQueue<Service> services = pool.get(key);
if (services != null) {
services.add(service);
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultShutdownStrategy.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultShutdownStrategy.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultShutdownStrategy.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultShutdownStrategy.java Fri Mar 25 22:34:26 2011
@@ -239,9 +239,7 @@ public class DefaultShutdownStrategy ext
* @param consumer the consumer to shutdown
*/
protected void shutdownNow(Consumer consumer) {
- if (LOG.isTraceEnabled()) {
- LOG.trace("Shutting down: " + consumer);
- }
+ LOG.trace("Shutting down: {}", consumer);
// allow us to do custom work before delegating to service helper
try {
@@ -263,9 +261,7 @@ public class DefaultShutdownStrategy ext
* @param consumer the consumer to suspend
*/
protected void suspendNow(Consumer consumer) {
- if (LOG.isTraceEnabled()) {
- LOG.trace("Suspending: " + consumer);
- }
+ LOG.trace("Suspending: {}", consumer);
// allow us to do custom work before delegating to service helper
try {
@@ -364,8 +360,9 @@ public class DefaultShutdownStrategy ext
ShutdownRunningTask shutdownRunningTask = order.getRoute().getRouteContext().getShutdownRunningTask();
if (LOG.isTraceEnabled()) {
- LOG.trace((suspendOnly ? "Suspending route: " : "Shutting down route: ") + order.getRoute().getId()
- + " with options [" + shutdownRoute + "," + shutdownRunningTask + "]");
+ LOG.trace("{}{} with options [{},{}]",
+ new Object[]{suspendOnly ? "Suspending route: " : "Shutting down route: ",
+ order.getRoute().getId(), shutdownRoute, shutdownRunningTask});
}
for (Consumer consumer : order.getInputs()) {
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultUnitOfWork.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultUnitOfWork.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultUnitOfWork.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultUnitOfWork.java Fri Mar 25 22:34:26 2011
@@ -57,9 +57,7 @@ public class DefaultUnitOfWork implement
private final Stack<RouteContext> routeContextStack = new Stack<RouteContext>();
public DefaultUnitOfWork(Exchange exchange) {
- if (log.isTraceEnabled()) {
- log.trace("UnitOfWork created for ExchangeId: " + exchange.getExchangeId() + " with " + exchange);
- }
+ log.trace("UnitOfWork created for ExchangeId: {} with {}", exchange.getExchangeId(), exchange);
tracedRouteNodes = new DefaultTracedRouteNodes();
context = exchange.getContext();
@@ -115,9 +113,7 @@ public class DefaultUnitOfWork implement
if (synchronizations == null) {
synchronizations = new ArrayList<Synchronization>();
}
- if (log.isTraceEnabled()) {
- log.trace("Adding synchronization " + synchronization);
- }
+ log.trace("Adding synchronization {}", synchronization);
synchronizations.add(synchronization);
}
@@ -143,24 +139,18 @@ public class DefaultUnitOfWork implement
}
if (handover) {
- if (log.isTraceEnabled()) {
- log.trace("Handover synchronization " + synchronization + " to: " + target);
- }
+ log.trace("Handover synchronization {} to: {}", synchronization, target);
target.addOnCompletion(synchronization);
// remove it if its handed over
it.remove();
} else {
- if (log.isTraceEnabled()) {
- log.trace("Handover not allow for synchronization " + synchronization);
- }
+ log.trace("Handover not allow for synchronization {}", synchronization);
}
}
}
public void done(Exchange exchange) {
- if (log.isTraceEnabled()) {
- log.trace("UnitOfWork done for ExchangeId: " + exchange.getExchangeId() + " with " + exchange);
- }
+ log.trace("UnitOfWork done for ExchangeId: {} with {}", exchange.getExchangeId(), exchange);
boolean failed = exchange.isFailed();
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/EventDrivenPollingConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/EventDrivenPollingConsumer.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/EventDrivenPollingConsumer.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/EventDrivenPollingConsumer.java Fri Mar 25 22:34:26 2011
@@ -63,9 +63,7 @@ public class EventDrivenPollingConsumer
handleInterruptedException(e);
}
}
- if (LOG.isTraceEnabled()) {
- LOG.trace("Consumer is not running, so returning null");
- }
+ LOG.trace("Consumer is not running, so returning null");
return null;
}
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ProducerCache.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ProducerCache.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ProducerCache.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ProducerCache.java Fri Mar 25 22:34:26 2011
@@ -397,9 +397,7 @@ public class ProducerCache extends Servi
int size = producers.size();
size += pool.size();
- if (LOG.isTraceEnabled()) {
- LOG.trace("size = " + size);
- }
+ LOG.trace("size = {}", size);
return size;
}
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ScheduledPollConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ScheduledPollConsumer.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ScheduledPollConsumer.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ScheduledPollConsumer.java Fri Mar 25 22:34:26 2011
@@ -66,9 +66,7 @@ public abstract class ScheduledPollConsu
*/
public void run() {
if (isSuspended()) {
- if (LOG.isTraceEnabled()) {
- LOG.trace("Cannot start to poll: " + this.getEndpoint() + " as its suspended");
- }
+ LOG.trace("Cannot start to poll: {} as its suspended", this.getEndpoint());
return;
}
@@ -82,9 +80,7 @@ public abstract class ScheduledPollConsu
if (isPollAllowed()) {
if (retryCounter == -1) {
- if (LOG.isTraceEnabled()) {
- LOG.trace("Starting to poll: " + this.getEndpoint());
- }
+ LOG.trace("Starting to poll: {}", this.getEndpoint());
} else {
if (LOG.isDebugEnabled()) {
LOG.debug("Retrying attempt " + retryCounter + " to poll: " + this.getEndpoint());
@@ -103,9 +99,7 @@ public abstract class ScheduledPollConsu
}
}
- if (LOG.isTraceEnabled()) {
- LOG.trace("Finished polling: " + this.getEndpoint());
- }
+ LOG.trace("Finished polling: {}", this.getEndpoint());
} catch (Exception e) {
try {
boolean retry = pollStrategy.rollback(this, getEndpoint(), retryCounter, e);
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/AnnotationTypeConverterLoader.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/AnnotationTypeConverterLoader.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/AnnotationTypeConverterLoader.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/AnnotationTypeConverterLoader.java Fri Mar 25 22:34:26 2011
@@ -83,7 +83,7 @@ public class AnnotationTypeConverterLoad
for (Class type : classes) {
if (LOG.isTraceEnabled()) {
- LOG.trace("Loading converter class: " + ObjectHelper.name(type));
+ LOG.trace("Loading converter class: {}", ObjectHelper.name(type));
}
loadConverterMethods(registry, type);
}
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/BaseTypeConverterRegistry.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/BaseTypeConverterRegistry.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/BaseTypeConverterRegistry.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/BaseTypeConverterRegistry.java Fri Mar 25 22:34:26 2011
@@ -149,8 +149,9 @@ public abstract class BaseTypeConverterR
@SuppressWarnings("unchecked")
protected Object doConvertTo(final Class type, final Exchange exchange, final Object value) {
if (log.isTraceEnabled()) {
- log.trace("Converting " + (value == null ? "null" : value.getClass().getCanonicalName())
- + " -> " + type.getCanonicalName() + " with value: " + value);
+ log.trace("Converting {} -> {} with value: {}",
+ new Object[]{value == null ? "null" : value.getClass().getCanonicalName(),
+ type.getCanonicalName(), value});
}
if (value == null) {
@@ -176,9 +177,7 @@ public abstract class BaseTypeConverterR
// try to find a suitable type converter
TypeConverter converter = getOrFindTypeConverter(type, value);
if (converter != null) {
- if (log.isTraceEnabled()) {
- log.trace("Using converter: " + converter + " to convert " + key);
- }
+ log.trace("Using converter: {} to convert {}", converter, key);
Object rc = converter.convertTo(type, exchange, value);
if (rc != null) {
return rc;
@@ -207,8 +206,9 @@ public abstract class BaseTypeConverterR
}
if (log.isTraceEnabled()) {
- log.trace("Fallback type converter " + fallback.getFallbackTypeConverter() + " converted type from: "
- + type.getCanonicalName() + " to: " + value.getClass().getCanonicalName());
+ log.trace("Fallback type converter {} converted type from: {} to: {}",
+ new Object[]{fallback.getFallbackTypeConverter(),
+ type.getCanonicalName(), value.getClass().getCanonicalName()});
}
// return converted value
@@ -234,9 +234,7 @@ public abstract class BaseTypeConverterR
}
public void addTypeConverter(Class<?> toType, Class<?> fromType, TypeConverter typeConverter) {
- if (log.isTraceEnabled()) {
- log.trace("Adding type converter: " + typeConverter);
- }
+ log.trace("Adding type converter: {}", typeConverter);
TypeMapping key = new TypeMapping(toType, fromType);
synchronized (typeMappings) {
TypeConverter converter = typeMappings.get(key);
@@ -252,9 +250,7 @@ public abstract class BaseTypeConverterR
}
public void addFallbackTypeConverter(TypeConverter typeConverter, boolean canPromote) {
- if (log.isTraceEnabled()) {
- log.trace("Adding fallback type converter: " + typeConverter + " which can promote: " + canPromote);
- }
+ log.trace("Adding fallback type converter: {} which can promote: {}", typeConverter, canPromote);
// add in top of fallback as the toString() fallback will nearly always be able to convert
fallbackConverters.add(0, new FallbackTypeConverter(typeConverter, canPromote));
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/FutureTypeConverter.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/FutureTypeConverter.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/FutureTypeConverter.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/FutureTypeConverter.java Fri Mar 25 22:34:26 2011
@@ -61,14 +61,10 @@ public final class FutureTypeConverter i
}
// do some trace logging as the get is blocking until the response is ready
- if (LOG.isTraceEnabled()) {
- LOG.trace("Getting future response");
- }
+ LOG.trace("Getting future response");
Object body = future.get();
- if (LOG.isTraceEnabled()) {
- LOG.trace("Got future response");
- }
+ LOG.trace("Got future response");
if (body == null) {
// return void to indicate its not possible to convert at this time
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/PropertyEditorTypeConverter.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/PropertyEditorTypeConverter.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/PropertyEditorTypeConverter.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/PropertyEditorTypeConverter.java Fri Mar 25 22:34:26 2011
@@ -78,9 +78,7 @@ public class PropertyEditorTypeConverter
private PropertyEditor lookupEditor(Class type) {
// check misses first
if (misses.containsKey(type)) {
- if (LOG.isTraceEnabled()) {
- LOG.trace("No previously found property editor for type: " + type);
- }
+ LOG.trace("No previously found property editor for type: {}", type);
return null;
}
@@ -94,14 +92,10 @@ public class PropertyEditorTypeConverter
// either we found an editor, or if not then register it as a miss
if (editor != null) {
- if (LOG.isTraceEnabled()) {
- LOG.trace("Found property editor for type: " + type + " -> " + editor);
- }
+ LOG.trace("Found property editor for type: {} -> {}", type, editor);
cache.put(type, editor);
} else {
- if (LOG.isTraceEnabled()) {
- LOG.trace("Cannot find property editor for type: " + type);
- }
+ LOG.trace("Cannot find property editor for type: {}", type);
misses.put(type, type);
}
}
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/language/simple/SimpleLanguageSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/language/simple/SimpleLanguageSupport.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/language/simple/SimpleLanguageSupport.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/language/simple/SimpleLanguageSupport.java Fri Mar 25 22:34:26 2011
@@ -164,13 +164,13 @@ public abstract class SimpleLanguageSupp
private void dumpMatcher(Matcher matcher) {
if (log.isTraceEnabled()) {
- log.trace("Matcher start: " + matcher.start());
- log.trace("Matcher end: " + matcher.end());
- log.trace("Matcher group: " + matcher.group());
- log.trace("Matcher group count: " + matcher.groupCount());
+ log.trace("Matcher start: {}", matcher.start());
+ log.trace("Matcher end: {}", matcher.end());
+ log.trace("Matcher group: {}", matcher.group());
+ log.trace("Matcher group count: {}", matcher.groupCount());
for (int i = 0; i < matcher.groupCount() + 1; i++) {
String group = matcher.group(i);
- log.trace("Matcher group #" + i + ": " + group);
+ log.trace("Matcher group #{}: {}", i, group);
}
}
}
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/management/DefaultManagementAgent.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/management/DefaultManagementAgent.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/management/DefaultManagementAgent.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/management/DefaultManagementAgent.java Fri Mar 25 22:34:26 2011
@@ -322,9 +322,7 @@ public class DefaultManagementAgent exte
// register bean if by force or not exists
ObjectInstance instance = null;
if (forceRegistration || !exists) {
- if (LOG.isTraceEnabled()) {
- LOG.trace("Registering MBean with objectname: " + name);
- }
+ LOG.trace("Registering MBean with objectname: {}", name);
instance = server.registerMBean(obj, name);
}
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=1085587&r1=1085586&r2=1085587&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 Fri Mar 25 22:34:26 2011
@@ -211,9 +211,7 @@ public class DefaultManagementLifecycleS
}
ObjectName on = getManagementStrategy().getManagementNamingStrategy().getObjectNameForCamelContext(name);
done = !getManagementStrategy().isManaged(mc, on);
- if (LOG.isTraceEnabled()) {
- LOG.trace("Using name: " + name + " in ObjectName[" + on + "] exists? " + done);
- }
+ LOG.trace("Using name: {} in ObjectName[{}] exists? {}", new Object[]{name, on, done});
}
return name;
}
@@ -348,9 +346,7 @@ public class DefaultManagementLifecycleS
// skip already managed services, for example if a route has been restarted
if (getManagementStrategy().isManaged(managedObject, null)) {
- if (LOG.isTraceEnabled()) {
- LOG.trace("The service is already managed: " + service);
- }
+ LOG.trace("The service is already managed: {}", service);
return;
}
@@ -533,9 +529,7 @@ public class DefaultManagementLifecycleS
// skip already managed routes, for example if the route has been restarted
if (getManagementStrategy().isManaged(mr, null)) {
- if (LOG.isTraceEnabled()) {
- LOG.trace("The route is already managed: " + route);
- }
+ LOG.trace("The route is already managed: {}", route);
continue;
}
@@ -572,9 +566,7 @@ public class DefaultManagementLifecycleS
// skip unmanaged routes
if (!getManagementStrategy().isManaged(mr, null)) {
- if (LOG.isTraceEnabled()) {
- LOG.trace("The route is not managed: " + route);
- }
+ LOG.trace("The route is not managed: {}", route);
continue;
}
@@ -597,9 +589,7 @@ public class DefaultManagementLifecycleS
// skip already managed services, for example if a route has been restarted
if (getManagementStrategy().isManaged(me, null)) {
- if (LOG.isTraceEnabled()) {
- LOG.trace("The error handler builder is already managed: " + errorHandlerBuilder);
- }
+ LOG.trace("The error handler builder is already managed: {}", errorHandlerBuilder);
return;
}
@@ -623,9 +613,7 @@ public class DefaultManagementLifecycleS
// skip already managed services, for example if a route has been restarted
if (getManagementStrategy().isManaged(mtp, null)) {
- if (LOG.isTraceEnabled()) {
- LOG.trace("The thread pool is already managed: " + threadPool);
- }
+ LOG.trace("The thread pool is already managed: {}", threadPool);
return;
}
@@ -756,9 +744,7 @@ public class DefaultManagementLifecycleS
return false;
}
- if (LOG.isTraceEnabled()) {
- LOG.trace("Checking whether to register " + service + " from route: " + route);
- }
+ LOG.trace("Checking whether to register {} from route: {}", service, route);
// always register if we are starting CamelContext
if (getCamelContext().getStatus().isStarting()) {
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/management/InstrumentationProcessor.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/management/InstrumentationProcessor.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/management/InstrumentationProcessor.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/management/InstrumentationProcessor.java Fri Mar 25 22:34:26 2011
@@ -82,9 +82,7 @@ public class InstrumentationProcessor ex
}
protected void recordTime(Exchange exchange, long duration) {
- if (LOG.isTraceEnabled()) {
- LOG.trace((type != null ? type + ": " : "") + "Recording duration: " + duration + " millis for exchange: " + exchange);
- }
+ LOG.trace("{}Recording duration: {} millis for exchange: {}", new Object[]{type != null ? type + ": " : "", duration, exchange});
if (!exchange.isFailed() && exchange.getException() == null) {
counter.completedExchange(duration);
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=1085587&r1=1085586&r2=1085587&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 Fri Mar 25 22:34:26 2011
@@ -56,9 +56,7 @@ public class JmxMBeanAssembler {
if (obj instanceof ManagedInstance) {
Object custom = ((ManagedInstance) obj).getInstance();
if (custom != null && ObjectHelper.hasAnnotation(custom.getClass().getAnnotations(), ManagedResource.class)) {
- if (LOG.isTraceEnabled()) {
- LOG.trace("Assembling MBeanInfo for: " + name.toString() + " from custom @ManagedResource object: " + custom);
- }
+ LOG.trace("Assembling MBeanInfo for: {} from custom @ManagedResource object: {}", name.toString(), 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
@@ -68,9 +66,7 @@ public class JmxMBeanAssembler {
if (mbi == null) {
// use the default provided mbean which has been annotated with Spring JMX annotations
- if (LOG.isTraceEnabled()) {
- LOG.trace("Assembling MBeanInfo for: " + name.toString() + " from @ManagedResource object: " + obj);
- }
+ LOG.trace("Assembling MBeanInfo for: {} from @ManagedResource object: {}", name.toString(), obj);
mbi = assembler.getMBeanInfo(obj, name.toString());
}
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/management/JmxNotificationEventNotifier.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/management/JmxNotificationEventNotifier.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/management/JmxNotificationEventNotifier.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/management/JmxNotificationEventNotifier.java Fri Mar 25 22:34:26 2011
@@ -49,9 +49,7 @@ public class JmxNotificationEventNotifie
String message = event.toString();
Notification notification = new Notification(type, source, counter.getAndIncrement(), message);
- if (LOG.isTraceEnabled()) {
- LOG.trace("Broadcasting JMX notification: " + notification);
- }
+ LOG.trace("Broadcasting JMX notification: {}", notification);
notificationBroadcaster.sendNotification(notification);
}
}
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java Fri Mar 25 22:34:26 2011
@@ -203,9 +203,7 @@ public abstract class ProcessorDefinitio
log.debug("Endpoint interceptor should not be added as an event driven consumer route: " + processor);
}
} else {
- if (log.isTraceEnabled()) {
- log.trace("Adding event driven processor: " + processor);
- }
+ log.trace("Adding event driven processor: {}", processor);
routeContext.addEventDrivenProcessor(processor);
}
@@ -253,9 +251,7 @@ public abstract class ProcessorDefinitio
} else {
// use error handler by default or if configured to do so
if (isInheritErrorHandler() == null || isInheritErrorHandler()) {
- if (log.isTraceEnabled()) {
- log.trace(defn + " is configured to inheritErrorHandler");
- }
+ log.trace("{} is configured to inheritErrorHandler", defn);
// only add error handler if we are configured to do so
// regular definition so add the error handler
Processor output = channel.getOutput();
@@ -269,9 +265,7 @@ public abstract class ProcessorDefinitio
}
}
- if (log.isTraceEnabled()) {
- log.trace(defn + " wrapped in Channel: " + channel);
- }
+ log.trace("{} wrapped in Channel: {}", defn, channel);
return channel;
}
@@ -430,9 +424,7 @@ public abstract class ProcessorDefinitio
* @see org.apache.camel.component.properties.PropertiesComponent
*/
protected void resolvePropertyPlaceholders(RouteContext routeContext, ProcessorDefinition definition) throws Exception {
- if (log.isTraceEnabled()) {
- log.trace("Resolving property placeholders for: " + definition);
- }
+ log.trace("Resolving property placeholders for: {}", definition);
// find all getter/setter which we can use for property placeholders
Map<Object, Object> properties = new HashMap<Object, Object>();
@@ -463,9 +455,7 @@ public abstract class ProcessorDefinitio
}
if (!properties.isEmpty()) {
- if (log.isTraceEnabled()) {
- log.trace("There are " + properties.size() + " properties on: " + definition);
- }
+ log.trace("There are {} properties on: {}", properties.size(), definition);
// lookup and resolve properties for String based properties
for (Map.Entry entry : properties.entrySet()) {
// the name is always a String
@@ -499,18 +489,14 @@ public abstract class ProcessorDefinitio
* @param definition the processor definition
*/
protected void resolveKnownConstantFields(ProcessorDefinition definition) throws Exception {
- if (log.isTraceEnabled()) {
- log.trace("Resolving known fields for: " + definition);
- }
+ log.trace("Resolving known fields for: {}", definition);
// find all String getter/setter
Map<Object, Object> properties = new HashMap<Object, Object>();
IntrospectionSupport.getProperties(definition, properties, null);
if (!properties.isEmpty()) {
- if (log.isTraceEnabled()) {
- log.trace("There are " + properties.size() + " properties on: " + definition);
- }
+ log.trace("There are {} properties on: {}", properties.size(), definition);
// lookup and resolve known constant fields for String based properties
for (Map.Entry entry : properties.entrySet()) {
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/BatchProcessor.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/BatchProcessor.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/BatchProcessor.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/BatchProcessor.java Fri Mar 25 22:34:26 2011
@@ -240,9 +240,7 @@ public class BatchProcessor extends Serv
int size = exchange.getProperty(Exchange.BATCH_SIZE, Integer.class);
if (batchSize != size) {
batchSize = size;
- if (LOG.isTraceEnabled()) {
- LOG.trace("Using batch consumer completion, so setting batch size to: " + batchSize);
- }
+ LOG.trace("Using batch consumer completion, so setting batch size to: {}", batchSize);
}
}
@@ -294,9 +292,7 @@ public class BatchProcessor extends Serv
do {
try {
if (!exchangeEnqueued) {
- if (LOG.isTraceEnabled()) {
- LOG.trace("Waiting for new exchange to arrive or batchTimeout to occur after " + batchTimeout + " ms.");
- }
+ LOG.trace("Waiting for new exchange to arrive or batchTimeout to occur after {} ms.", batchTimeout);
exchangeEnqueuedCondition.await(batchTimeout, TimeUnit.MILLISECONDS);
}
@@ -307,12 +303,10 @@ public class BatchProcessor extends Serv
}
if (id != null || !exchangeEnqueued) {
- if (LOG.isTraceEnabled()) {
- if (id != null) {
- LOG.trace("Collecting exchanges to be aggregated triggered by completion predicate");
- } else {
- LOG.trace("Collecting exchanges to be aggregated triggered by batch timeout");
- }
+ if (id != null) {
+ LOG.trace("Collecting exchanges to be aggregated triggered by completion predicate");
+ } else {
+ LOG.trace("Collecting exchanges to be aggregated triggered by batch timeout");
}
drainQueueTo(collection, batchSize, id);
} else {
@@ -392,9 +386,7 @@ public class BatchProcessor extends Serv
if (completionPredicate != null) {
boolean matches = completionPredicate.matches(exchange);
if (matches) {
- if (LOG.isTraceEnabled()) {
- LOG.trace("Exchange matched completion predicate: " + exchange);
- }
+ LOG.trace("Exchange matched completion predicate: {}", exchange);
// add this exchange to the list of exchanges which marks the batch as complete
completionPredicateMatched.add(exchange.getExchangeId());
}
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/DelayProcessorSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/DelayProcessorSupport.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/DelayProcessorSupport.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/DelayProcessorSupport.java Fri Mar 25 22:34:26 2011
@@ -53,9 +53,7 @@ public abstract class DelayProcessorSupp
}
public void run() {
- if (log.isTraceEnabled()) {
- log.trace("Delayed task woke up and continues routing for exchangeId: " + exchange.getExchangeId());
- }
+ log.trace("Delayed task woke up and continues routing for exchangeId: {}", exchange.getExchangeId());
if (!isRunAllowed()) {
exchange.setException(new RejectedExecutionException("Run is not allowed"));
}
@@ -105,9 +103,8 @@ public abstract class DelayProcessorSupp
// asynchronous delay so schedule a process call task
ProcessCall call = new ProcessCall(exchange, callback);
try {
- if (log.isTraceEnabled()) {
- log.trace("Scheduling delayed task to run in " + delay + " millis for exchangeId: " + exchange.getExchangeId());
- }
+ log.trace("Scheduling delayed task to run in {} millis for exchangeId: {}",
+ delay, exchange.getExchangeId());
executorService.schedule(call, delay, TimeUnit.MILLISECONDS);
// tell Camel routing engine we continue routing asynchronous
return false;
@@ -197,9 +194,7 @@ public abstract class DelayProcessorSupp
if (delay <= 0) {
return;
}
- if (log.isTraceEnabled()) {
- log.trace("Sleeping for: " + delay + " millis");
- }
+ log.trace("Sleeping for: {} millis", delay);
Thread.sleep(delay);
}
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Enricher.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Enricher.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Enricher.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Enricher.java Fri Mar 25 22:34:26 2011
@@ -137,17 +137,13 @@ public class Enricher extends ServiceSup
});
if (!sync) {
- 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 slip 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());
if (resourceExchange.isFailed()) {
// copy resource exchange onto original exchange (preserving pattern)
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/LoopProcessor.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/LoopProcessor.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/LoopProcessor.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/LoopProcessor.java Fri Mar 25 22:34:26 2011
@@ -71,17 +71,13 @@ public class LoopProcessor extends Deleg
boolean sync = process(exchange, callback, index, count);
if (!sync) {
- 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 slip 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());
// increment counter before next loop
index.getAndIncrement();
@@ -89,9 +85,7 @@ public class LoopProcessor extends Deleg
// we are done so prepare the result
ExchangeHelper.prepareOutToIn(exchange);
- if (LOG.isTraceEnabled()) {
- LOG.trace("Processing complete for exchangeId: " + exchange.getExchangeId() + " >>> " + exchange);
- }
+ LOG.trace("Processing complete for exchangeId: {} >>> {}", exchange.getExchangeId(), exchange);
callback.done(true);
return true;
}
@@ -124,9 +118,7 @@ public class LoopProcessor extends Deleg
// process again
boolean sync = process(exchange, callback, index, count);
if (!sync) {
- 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 slip 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;
@@ -138,9 +130,7 @@ public class LoopProcessor extends Deleg
// we are done so prepare the result
ExchangeHelper.prepareOutToIn(exchange);
- if (LOG.isTraceEnabled()) {
- LOG.trace("Processing complete for exchangeId: " + exchange.getExchangeId() + " >>> " + exchange);
- }
+ LOG.trace("Processing complete for exchangeId: {} >>> {}", exchange.getExchangeId(), exchange);
callback.done(false);
}
});
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java Fri Mar 25 22:34:26 2011
@@ -297,9 +297,7 @@ public class MulticastProcessor extends
}
}
- if (LOG.isTraceEnabled()) {
- LOG.trace("Parallel processing complete for exchange: " + subExchange);
- }
+ LOG.trace("Parallel processing complete for exchange: {}", subExchange);
return subExchange;
}
});
@@ -308,9 +306,7 @@ public class MulticastProcessor extends
}
// signal all tasks has been submitted
- if (LOG.isTraceEnabled()) {
- LOG.trace("Signaling that all " + total.get() + " tasks has been submitted.");
- }
+ LOG.trace("Signaling that all {} tasks has been submitted.", total.get());
allTasksSubmitted.set(true);
// its to hard to do parallel async routing so we let the caller thread be synchronously
@@ -412,22 +408,16 @@ public class MulticastProcessor extends
// we are timed out but try to grab if some tasks has been completed
// poll will return null if no tasks is present
future = completion.poll();
- if (LOG.isTraceEnabled()) {
- LOG.trace("Polled completion task #" + aggregated + " after timeout to grab already completed tasks: " + future);
- }
+ LOG.trace("Polled completion task #{} after timeout to grab already completed tasks: {}", aggregated, future);
} else if (timeout > 0) {
long left = timeout - watch.taken();
if (left < 0) {
left = 0;
}
- if (LOG.isTraceEnabled()) {
- LOG.trace("Polling completion task #" + aggregated + " using timeout " + left + " millis.");
- }
+ LOG.trace("Polling completion task #{} using timeout {} millis.", aggregated, left);
future = completion.poll(left, TimeUnit.MILLISECONDS);
} else {
- if (LOG.isTraceEnabled()) {
- LOG.trace("Polling completion task #" + aggregated);
- }
+ LOG.trace("Polling completion task #{}", aggregated);
// we must not block so poll every second
future = completion.poll(1, TimeUnit.SECONDS);
if (future == null) {
@@ -511,7 +501,7 @@ public class MulticastProcessor extends
boolean sync = doProcessSequential(original, result, pairs, it, pair, callback, total);
if (!sync) {
if (LOG.isTraceEnabled()) {
- LOG.trace("Processing exchangeId: " + pair.getExchange().getExchangeId() + " is continued being processed asynchronously");
+ LOG.trace("Processing exchangeId: {} is continued being processed asynchronously", pair.getExchange().getExchangeId());
}
// the remainder of the multicast will be completed async
// so we break out now, then the callback will be invoked which then continue routing from where we left here
@@ -519,7 +509,7 @@ public class MulticastProcessor extends
}
if (LOG.isTraceEnabled()) {
- LOG.trace("Processing exchangeId: " + pair.getExchange().getExchangeId() + " is continued being processed synchronously");
+ LOG.trace("Processing exchangeId: {} is continued being processed synchronously", pair.getExchange().getExchangeId());
}
// Decide whether to continue with the multicast or not; similar logic to the Pipeline
@@ -538,9 +528,7 @@ public class MulticastProcessor extends
}
}
- if (LOG.isTraceEnabled()) {
- LOG.trace("Sequential processing complete for number " + total + " exchange: " + subExchange);
- }
+ LOG.trace("Sequential processing complete for number {} exchange: {}", total, subExchange);
doAggregate(getAggregationStrategy(subExchange), result, subExchange);
total.incrementAndGet();
@@ -632,9 +620,7 @@ public class MulticastProcessor extends
boolean sync = doProcessSequential(original, result, pairs, it, pair, callback, total);
if (!sync) {
- if (LOG.isTraceEnabled()) {
- LOG.trace("Processing exchangeId: " + original.getExchangeId() + " is continued being processed asynchronously");
- }
+ LOG.trace("Processing exchangeId: {} is continued being processed asynchronously", original.getExchangeId());
return;
}
@@ -843,15 +829,11 @@ public class MulticastProcessor extends
// lookup cached first to reuse and preserve memory
answer = errorHandlers.get(key);
if (answer != null) {
- if (LOG.isTraceEnabled()) {
- LOG.trace("Using existing error handler for: " + processor);
- }
+ LOG.trace("Using existing error handler for: {}", processor);
return answer;
}
- if (LOG.isTraceEnabled()) {
- LOG.trace("Creating error handler for: " + processor);
- }
+ LOG.trace("Creating error handler for: {}", processor);
ErrorHandlerBuilder builder = routeContext.getRoute().getErrorHandlerBuilder();
// create error handler (create error handler directly to keep it light weight,
// instead of using ProcessorDefinition.wrapInErrorHandler)
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/OnCompletionProcessor.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/OnCompletionProcessor.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/OnCompletionProcessor.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/OnCompletionProcessor.java Fri Mar 25 22:34:26 2011
@@ -121,9 +121,7 @@ public class OnCompletionProcessor exten
answer.setPattern(ExchangePattern.InOnly);
if (useOriginalBody) {
- if (LOG.isTraceEnabled()) {
- LOG.trace("Using the original IN message instead of current");
- }
+ LOG.trace("Using the original IN message instead of current");
Message original = exchange.getUnitOfWork().getOriginalInMessage();
answer.setIn(original);
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Pipeline.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Pipeline.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Pipeline.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Pipeline.java Fri Mar 25 22:34:26 2011
@@ -81,17 +81,13 @@ public class Pipeline extends MulticastP
// continue as long its being processed synchronously
if (!sync) {
- 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 pipeline 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());
// check for error if so we should break out
if (!continueProcessing(nextExchange, "so breaking out of pipeline", LOG)) {
@@ -99,12 +95,10 @@ public class Pipeline extends MulticastP
}
}
- if (LOG.isTraceEnabled()) {
- // logging nextExchange as it contains the exchange that might have altered the payload and since
- // we are logging the completion if will be confusing if we log the original instead
- // we could also consider logging the original and the nextExchange then we have *before* and *after* snapshots
- LOG.trace("Processing complete for exchangeId: " + exchange.getExchangeId() + " >>> " + nextExchange);
- }
+ // logging nextExchange as it contains the exchange that might have altered the payload and since
+ // we are logging the completion if will be confusing if we log the original instead
+ // we could also consider logging the original and the nextExchange then we have *before* and *after* snapshots
+ LOG.trace("Processing complete for exchangeId: {} >>> {}", exchange.getExchangeId(), nextExchange);
// copy results back to the original exchange
ExchangeHelper.copyResults(exchange, nextExchange);
@@ -115,10 +109,8 @@ public class Pipeline extends MulticastP
private boolean process(final Exchange original, final Exchange exchange, final AsyncCallback callback,
final Iterator<Processor> processors, final AsyncProcessor asyncProcessor) {
- if (LOG.isTraceEnabled()) {
- // this does the actual processing so log at trace level
- LOG.trace("Processing exchangeId: " + exchange.getExchangeId() + " >>> " + exchange);
- }
+ // this does the actual processing so log at trace level
+ LOG.trace("Processing exchangeId: {} >>> {}", exchange.getExchangeId(), exchange);
// implement asynchronous routing logic in callback so we can have the callback being
// triggered and then continue routing where we left
@@ -142,17 +134,13 @@ public class Pipeline extends MulticastP
nextExchange = createNextExchange(nextExchange);
doneSync = process(original, nextExchange, callback, processors, processor);
if (!doneSync) {
- 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());
return;
}
}
ExchangeHelper.copyResults(original, nextExchange);
- if (LOG.isTraceEnabled()) {
- LOG.trace("Processing complete for exchangeId: " + original.getExchangeId() + " >>> " + original);
- }
+ LOG.trace("Processing complete for exchangeId: {} >>> {}", original.getExchangeId(), original);
callback.done(false);
}
});
@@ -203,9 +191,7 @@ public class Pipeline extends MulticastP
answer = it.hasNext();
}
- if (LOG.isTraceEnabled()) {
- LOG.trace("ExchangeId: " + exchange.getExchangeId() + " should continue routing: " + answer);
- }
+ LOG.trace("ExchangeId: {} should continue routing: {}", exchange.getExchangeId(), answer);
return answer;
}
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RecipientListProcessor.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RecipientListProcessor.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RecipientListProcessor.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RecipientListProcessor.java Fri Mar 25 22:34:26 2011
@@ -98,15 +98,11 @@ public class RecipientListProcessor exte
public void begin() {
// we have already acquired and prepare the producer so we
- if (LOG.isTraceEnabled()) {
- LOG.trace("RecipientProcessorExchangePair #" + index + " begin: " + exchange);
- }
+ LOG.trace("RecipientProcessorExchangePair #{} begin: {}", index, exchange);
}
public void done() {
- if (LOG.isTraceEnabled()) {
- LOG.trace("RecipientProcessorExchangePair #" + index + " done: " + exchange);
- }
+ LOG.trace("RecipientProcessorExchangePair #{} done: {}", index, exchange);
// when we are done we should release back in pool
try {
producerCache.releaseProducer(endpoint, producer);
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=1085587&r1=1085586&r2=1085587&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 Fri Mar 25 22:34:26 2011
@@ -107,9 +107,7 @@ public abstract class RedeliveryErrorHan
// letting onRedeliver be executed at first
deliverToOnRedeliveryProcessor(exchange, data);
- if (log.isTraceEnabled()) {
- log.trace("Redelivering exchangeId: " + exchange.getExchangeId() + " -> " + outputAsync + " for Exchange: " + exchange);
- }
+ 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);
@@ -122,9 +120,7 @@ public abstract class RedeliveryErrorHan
// be notified when we are done
sync = AsyncProcessorHelper.process(outputAsync, exchange, new AsyncCallback() {
public void done(boolean doneSync) {
- if (log.isTraceEnabled()) {
- log.trace("Redelivering exchangeId: " + exchange.getExchangeId() + " done sync: " + doneSync);
- }
+ log.trace("Redelivering exchangeId: {} done sync: {}", exchange.getExchangeId(), doneSync);
// mark we are in sync mode now
data.sync = false;
@@ -145,9 +141,7 @@ public abstract class RedeliveryErrorHan
// handle when the asynchronous task was done
sync = AsyncProcessorHelper.process(outputAsync, exchange, new AsyncCallback() {
public void done(boolean doneSync) {
- if (log.isTraceEnabled()) {
- log.trace("Redelivering exchangeId: " + exchange.getExchangeId() + " done sync: " + doneSync);
- }
+ log.trace("Redelivering exchangeId: {} done sync: {}", exchange.getExchangeId(), doneSync);
// this callback should only handle the async case
if (doneSync) {
@@ -263,7 +257,7 @@ public abstract class RedeliveryErrorHan
// schedule the redelivery task
if (log.isTraceEnabled()) {
- log.trace("Scheduling redelivery task to run in " + data.redeliveryDelay + " millis for exchangeId: " + exchange.getExchangeId());
+ log.trace("Scheduling redelivery task to run in {} millis for exchangeId: {}", data.redeliveryDelay, exchange.getExchangeId());
}
executorService.schedule(task, data.redeliveryDelay, TimeUnit.MILLISECONDS);
@@ -382,7 +376,7 @@ public abstract class RedeliveryErrorHan
if (data.redeliveryDelay > 0) {
// schedule the redelivery task
if (log.isTraceEnabled()) {
- log.trace("Scheduling redelivery task to run in " + data.redeliveryDelay + " millis for exchangeId: " + exchange.getExchangeId());
+ log.trace("Scheduling redelivery task to run in {} millis for exchangeId: {}", data.redeliveryDelay, exchange.getExchangeId());
}
executorService.schedule(task, data.redeliveryDelay, TimeUnit.MILLISECONDS);
} else {
@@ -416,9 +410,7 @@ public abstract class RedeliveryErrorHan
|| ExchangeHelper.isRedeliveryExhausted(exchange);
}
- if (log.isTraceEnabled()) {
- log.trace("Is exchangeId: " + exchange.getExchangeId() + " done? " + answer);
- }
+ log.trace("Is exchangeId: {} done? {}", exchange.getExchangeId(), answer);
return answer;
}
@@ -435,9 +427,7 @@ public abstract class RedeliveryErrorHan
answer = true;
}
- if (log.isTraceEnabled()) {
- log.trace("Is exchangeId: " + exchange.getExchangeId() + " interrupted? " + answer);
- }
+ log.trace("Is exchangeId: {} interrupted? {}", exchange.getExchangeId(), answer);
return answer;
}
@@ -548,8 +538,8 @@ public abstract class RedeliveryErrorHan
}
if (log.isTraceEnabled()) {
- log.trace("Redelivery processor " + data.onRedeliveryProcessor + " is processing Exchange: " + exchange
- + " before its redelivered");
+ log.trace("Redelivery processor {} is processing Exchange: {} before its redelivered",
+ data.onRedeliveryProcessor, exchange);
}
// run this synchronously as its just a Processor
@@ -593,15 +583,11 @@ public abstract class RedeliveryErrorHan
// prepare original IN body if it should be moved instead of current body
if (data.useOriginalInMessage) {
- if (log.isTraceEnabled()) {
- log.trace("Using the original IN message instead of current");
- }
+ log.trace("Using the original IN message instead of current");
Message original = exchange.getUnitOfWork().getOriginalInMessage();
exchange.setIn(original);
if (exchange.hasOut()) {
- if (log.isTraceEnabled()) {
- log.trace("Removing the out message to avoid some uncertain behavior");
- }
+ log.trace("Removing the out message to avoid some uncertain behavior");
exchange.setOut(null);
}
}
@@ -609,9 +595,7 @@ public abstract class RedeliveryErrorHan
// reset cached streams so they can be read again
MessageHelper.resetStreamCache(exchange.getIn());
- if (log.isTraceEnabled()) {
- log.trace("Failure processor " + processor + " is processing Exchange: " + exchange);
- }
+ log.trace("Failure processor {} is processing Exchange: {}", processor, exchange);
// store the last to endpoint as the failure endpoint
exchange.setProperty(Exchange.FAILURE_ENDPOINT, exchange.getProperty(Exchange.TO_ENDPOINT));
@@ -620,9 +604,7 @@ public abstract class RedeliveryErrorHan
AsyncProcessor afp = AsyncProcessorTypeConverter.convert(processor);
sync = AsyncProcessorHelper.process(afp, exchange, new AsyncCallback() {
public void done(boolean sync) {
- if (log.isTraceEnabled()) {
- log.trace("Failure processor done: " + processor + " processing Exchange: " + exchange);
- }
+ log.trace("Failure processor done: {} processing Exchange: {}", processor, exchange);
try {
prepareExchangeAfterFailure(exchange, data);
// fire event as we had a failure processor to handle it, which there is a event for
@@ -666,9 +648,7 @@ public abstract class RedeliveryErrorHan
boolean alreadySet = exchange.getProperty(Exchange.ERRORHANDLER_HANDLED) != null;
if (alreadySet) {
boolean handled = exchange.getProperty(Exchange.ERRORHANDLER_HANDLED, Boolean.class);
- if (log.isTraceEnabled()) {
- log.trace("This exchange has already been marked for handling: " + handled);
- }
+ log.trace("This exchange has already been marked for handling: {}", handled);
if (handled) {
exchange.setException(null);
} else {
@@ -681,20 +661,14 @@ public abstract class RedeliveryErrorHan
}
if (shouldHandled(exchange, data)) {
- if (log.isTraceEnabled()) {
- log.trace("This exchange is handled so its marked as not failed: " + exchange);
- }
+ log.trace("This exchange is handled so its marked as not failed: {}", exchange);
exchange.setProperty(Exchange.ERRORHANDLER_HANDLED, Boolean.TRUE);
} else if (shouldContinue(exchange, data)) {
- if (log.isTraceEnabled()) {
- log.trace("This exchange is continued: " + exchange);
- }
+ log.trace("This exchange is continued: {}", exchange);
// okay we want to continue then prepare the exchange for that as well
prepareExchangeForContinue(exchange, data);
} else {
- if (log.isTraceEnabled()) {
- log.trace("This exchange is not handled or continued so its marked as failed: " + exchange);
- }
+ log.trace("This exchange is not handled or continued so its marked as failed: {}", exchange);
// exception not handled, put exception back in the exchange
exchange.setProperty(Exchange.ERRORHANDLER_HANDLED, Boolean.FALSE);
exchange.setException(exchange.getProperty(Exchange.EXCEPTION_CAUGHT, Exception.class));
@@ -771,9 +745,7 @@ public abstract class RedeliveryErrorHan
// if marked as rollback only then do not redeliver
boolean rollbackOnly = exchange.getProperty(Exchange.ROLLBACK_ONLY, false, Boolean.class);
if (rollbackOnly) {
- if (log.isTraceEnabled()) {
- log.trace("This exchange is marked as rollback only, should not be redelivered: " + exchange);
- }
+ log.trace("This exchange is marked as rollback only, should not be redelivered: {}", exchange);
return false;
}
return data.currentRedeliveryPolicy.shouldRedeliver(exchange, data.redeliveryCounter, data.retryWhilePredicate);
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java Fri Mar 25 22:34:26 2011
@@ -191,17 +191,13 @@ public class RoutingSlip extends Service
current = copy;
if (!sync) {
- 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 slip 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());
// we ignore some kind of exceptions and allow us to continue
if (isIgnoreInvalidEndpoints()) {
@@ -221,12 +217,10 @@ public class RoutingSlip extends Service
}
}
- if (log.isTraceEnabled()) {
- // logging nextExchange as it contains the exchange that might have altered the payload and since
- // we are logging the completion if will be confusing if we log the original instead
- // we could also consider logging the original and the nextExchange then we have *before* and *after* snapshots
- log.trace("Processing complete for exchangeId: " + exchange.getExchangeId() + " >>> " + current);
- }
+ // logging nextExchange as it contains the exchange that might have altered the payload and since
+ // we are logging the completion if will be confusing if we log the original instead
+ // we could also consider logging the original and the nextExchange then we have *before* and *after* snapshots
+ log.trace("Processing complete for exchangeId: {} >>> {}", exchange.getExchangeId(), current);
// copy results back to the original exchange
ExchangeHelper.copyResults(exchange, current);
@@ -265,10 +259,8 @@ public class RoutingSlip extends Service
protected boolean processExchange(final Endpoint endpoint, final Exchange exchange, final Exchange original,
final AsyncCallback callback, final RoutingSlipIterator iter) {
- if (log.isTraceEnabled()) {
- // this does the actual processing so log at trace level
- log.trace("Processing exchangeId: " + exchange.getExchangeId() + " >>> " + exchange);
- }
+ // this does the actual processing so log at trace level
+ log.trace("Processing exchangeId: {} >>> {}", exchange.getExchangeId(), exchange);
boolean sync = producerCache.doInAsyncProducer(endpoint, exchange, null, callback, new AsyncProducerCallback() {
public boolean doInAsyncProducer(Producer producer, AsyncProcessor asyncProducer, final Exchange exchange,
@@ -325,19 +317,15 @@ public class RoutingSlip extends Service
current = copy;
if (!sync) {
- if (log.isTraceEnabled()) {
- log.trace("Processing exchangeId: " + original.getExchangeId() + " is continued being processed asynchronously");
- }
+ log.trace("Processing exchangeId: {} is continued being processed asynchronously", original.getExchangeId());
return;
}
}
- if (log.isTraceEnabled()) {
- // logging nextExchange as it contains the exchange that might have altered the payload and since
- // we are logging the completion if will be confusing if we log the original instead
- // we could also consider logging the original and the nextExchange then we have *before* and *after* snapshots
- log.trace("Processing complete for exchangeId: " + original.getExchangeId() + " >>> " + current);
- }
+ // logging nextExchange as it contains the exchange that might have altered the payload and since
+ // we are logging the completion if will be confusing if we log the original instead
+ // we could also consider logging the original and the nextExchange then we have *before* and *after* snapshots
+ log.trace("Processing complete for exchangeId: {} >>> {}", original.getExchangeId(), current);
// copy results back to the original exchange
ExchangeHelper.copyResults(original, current);
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/ThroughputLogger.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/ThroughputLogger.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/ThroughputLogger.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/ThroughputLogger.java Fri Mar 25 22:34:26 2011
@@ -217,9 +217,7 @@ public class ThroughputLogger extends Ca
public void run() {
// only run if CamelContext has been fully started
if (!camelContext.getStatus().isStarted()) {
- if (LOG.isTraceEnabled()) {
- LOG.trace("ThroughputLogger cannot start because CamelContext(" + camelContext.getName() + ") has not been started yet");
- }
+ LOG.trace("ThroughputLogger cannot start because CamelContext({}) has not been started yet", camelContext.getName());
return;
}
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/TryProcessor.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/TryProcessor.java?rev=1085587&r1=1085586&r2=1085587&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/TryProcessor.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/TryProcessor.java Fri Mar 25 22:34:26 2011
@@ -78,33 +78,25 @@ public class TryProcessor extends Servic
// continue as long its being processed synchronously
if (!sync) {
- 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 try .. catch .. finally 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());
}
ExchangeHelper.prepareOutToIn(exchange);
- if (LOG.isTraceEnabled()) {
- LOG.trace("Processing complete for exchangeId: " + exchange.getExchangeId() + " >>> " + exchange);
- }
+ LOG.trace("Processing complete for exchangeId: {} >>> {}", exchange.getExchangeId(), exchange);
callback.done(true);
return true;
}
protected boolean process(final Exchange exchange, final AsyncCallback callback,
final AsyncProcessor processor, final Iterator<AsyncProcessor> processors) {
- if (LOG.isTraceEnabled()) {
- // this does the actual processing so log at trace level
- LOG.trace("Processing exchangeId: " + exchange.getExchangeId() + " >>> " + exchange);
- }
+ // this does the actual processing so log at trace level
+ LOG.trace("Processing exchangeId: {} >>> {}", exchange.getExchangeId(), exchange);
// implement asynchronous routing logic in callback so we can have the callback being
// triggered and then continue routing where we left
@@ -124,9 +116,7 @@ public class TryProcessor extends Servic
doneSync = process(exchange, callback, processor, processors);
if (!doneSync) {
- 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 try .. catch .. finally 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;
@@ -134,9 +124,7 @@ public class TryProcessor extends Servic
}
ExchangeHelper.prepareOutToIn(exchange);
- if (LOG.isTraceEnabled()) {
- LOG.trace("Processing complete for exchangeId: " + exchange.getExchangeId() + " >>> " + exchange);
- }
+ LOG.trace("Processing complete for exchangeId: {} >>> {}", exchange.getExchangeId(), exchange);
callback.done(false);
}
});
@@ -226,7 +214,7 @@ public class TryProcessor extends Servic
Throwable caught = catchClause.catches(exchange, e);
if (caught != null) {
if (LOG.isTraceEnabled()) {
- LOG.trace("This TryProcessor catches the exception: " + caught.getClass().getName() + " caused by: " + e.getMessage());
+ LOG.trace("This TryProcessor catches the exception: {} caused by: {}", caught.getClass().getName(), e.getMessage());
}
processor = catchClause;
break;
@@ -241,7 +229,7 @@ public class TryProcessor extends Servic
return AsyncProcessorHelper.process(cool, exchange, callback);
} else {
if (LOG.isTraceEnabled()) {
- LOG.trace("This TryProcessor does not catch the exception: " + e.getClass().getName() + " caused by: " + e.getMessage());
+ LOG.trace("This TryProcessor does not catch the exception: {} caused by: {}", e.getClass().getName(), e.getMessage());
}
}
@@ -310,9 +298,7 @@ public class TryProcessor extends Servic
// signal callback to continue routing async
ExchangeHelper.prepareOutToIn(exchange);
- if (LOG.isTraceEnabled()) {
- LOG.trace("Processing complete for exchangeId: " + exchange.getExchangeId() + " >>> " + exchange);
- }
+ LOG.trace("Processing complete for exchangeId: {} >>> {}", exchange.getExchangeId(), exchange);
callback.done(false);
}
});