camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1439475 - in /camel/branches/camel-2.10.x: ./ components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintComponentResolver.java
Date Mon, 28 Jan 2013 16:19:04 GMT
Author: davsclaus
Date: Mon Jan 28 16:19:03 2013
New Revision: 1439475

URL: http://svn.apache.org/viewvc?rev=1439475&view=rev
Log:
Improved TRACE logging with camel-blueprint to not log stacktraces for expected situations
during component lookup.

Modified:
    camel/branches/camel-2.10.x/   (props changed)
    camel/branches/camel-2.10.x/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintComponentResolver.java

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
  Merged /camel/trunk:r1439473

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-2.10.x/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintComponentResolver.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintComponentResolver.java?rev=1439475&r1=1439474&r2=1439475&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintComponentResolver.java
(original)
+++ camel/branches/camel-2.10.x/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintComponentResolver.java
Mon Jan 28 16:19:03 2013
@@ -26,6 +26,8 @@ import org.osgi.service.blueprint.contai
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import static org.apache.camel.util.ObjectHelper.getException;
+
 public class BlueprintComponentResolver extends OsgiComponentResolver {
 
     private static final transient Logger LOG = LoggerFactory.getLogger(BlueprintComponentResolver.class);
@@ -49,11 +51,12 @@ public class BlueprintComponentResolver 
                     return component;
                 }
             }
-        } catch (NoSuchComponentException e) {
-            // can be expected so ignore
-            LOG.trace("Component: {} not found in registry.", name);
         } catch (Exception e) {
-            LOG.trace("Ignored error looking up bean: " + name + " due: " + e.getMessage(),
e);
+            if (getException(NoSuchComponentException.class, e) != null) {
+                // if the caused error is NoSuchComponentException then that can be expected
so ignore
+            } else {
+                LOG.trace("Ignored error looking up bean: " + name + " due: " + e.getMessage(),
e);
+            }
         }
         try {
             Object bean = context.getRegistry().lookup(".camelBlueprint.componentResolver."
+ name);



Mime
View raw message