Author: davsclaus Date: Thu May 13 07:12:25 2010 New Revision: 943823 URL: http://svn.apache.org/viewvc?rev=943823&view=rev Log: CAMEL-2710: Polished logging.
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RecipientList.java camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RecipientList.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RecipientList.java?rev=943823&r1=943822&r2=943823&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RecipientList.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RecipientList.java Thu May 13 07:12:25 2010 @@ -97,15 +97,15 @@ public class RecipientList extends Servi throw new IllegalStateException("RecipientList has not been started: " + this); } - Object receipientList = expression.evaluate(exchange, Object.class); - sendToRecipientList(exchange, receipientList); + Object recipientList = expression.evaluate(exchange, Object.class); + sendToRecipientList(exchange, recipientList); } /** * Sends the given exchange to the recipient list */ - public void sendToRecipientList(Exchange exchange, Object receipientList) throws Exception { - Iterator<Object> iter = ObjectHelper.createIterator(receipientList, delimiter); + public void sendToRecipientList(Exchange exchange, Object recipientList) throws Exception { + Iterator<Object> iter = ObjectHelper.createIterator(recipientList, delimiter); // we should acquire and release the producers we need so we can leverage the producer // cache to the fullest @@ -120,11 +120,11 @@ public class RecipientList extends Servi Producer producer = producerCache.acquireProducer(endpoint); processors.add(producer); producers.put(endpoint, producer); - } catch (Exception ex) { + } catch (Exception e) { if (isIgnoreInvalidEndpoints()) { - LOG.warn("Get a invalid endpoint with " + recipient , ex); + LOG.info("Endpoint uri is invalid: " + recipient + ". This exception will be ignored.", e); } else { - throw ex; + throw e; } } } 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=943823&r1=943822&r2=943823&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 Thu May 13 07:12:25 2010 @@ -91,15 +91,15 @@ public class RoutingSlip extends Service Exchange current = exchange; for (String nextRecipient : recipients) { - Endpoint endpoint = null; + Endpoint endpoint; try { endpoint = resolveEndpoint(exchange, nextRecipient.trim()); - } catch (Exception ex) { + } catch (Exception e) { if (isIgnoreInvalidEndpoints()) { - LOG.info("Cannot resolve the endpoint with " + nextRecipient, ex); + LOG.info("Endpoint uri is invalid: " + nextRecipient + ". This exception will be ignored.", e); continue; } else { - throw ex; + throw e; } } @@ -119,7 +119,7 @@ public class RoutingSlip extends Service } catch (Exception e) { // Need to check the if the exception is thrown when camel try to create and start the producer if (e instanceof FailedToCreateProducerException && isIgnoreInvalidEndpoints()) { - LOG.info("An Invalid endpoint with " + nextRecipient, e); + LOG.info("Endpoint uri is invalid: " + nextRecipient + ". This exception will be ignored.", e); continue; } else { // catch exception so we can decide if we want to continue or not