camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject svn commit: r1450777 - /camel/branches/camel-2.10.x/platforms/karaf/commands/src/main/java/org/apache/camel/karaf/commands/AbstractRouteCommand.java
Date Wed, 27 Feb 2013 13:58:58 GMT
Author: cschneider
Date: Wed Feb 27 13:58:58 2013
New Revision: 1450777

URL: http://svn.apache.org/r1450777
Log:
CAMEL-5968 Consolidate route commands using actract command, solve classnotfound exception
with websphere jms

Modified:
    camel/branches/camel-2.10.x/platforms/karaf/commands/src/main/java/org/apache/camel/karaf/commands/AbstractRouteCommand.java

Modified: camel/branches/camel-2.10.x/platforms/karaf/commands/src/main/java/org/apache/camel/karaf/commands/AbstractRouteCommand.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/platforms/karaf/commands/src/main/java/org/apache/camel/karaf/commands/AbstractRouteCommand.java?rev=1450777&r1=1450776&r2=1450777&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/platforms/karaf/commands/src/main/java/org/apache/camel/karaf/commands/AbstractRouteCommand.java
(original)
+++ camel/branches/camel-2.10.x/platforms/karaf/commands/src/main/java/org/apache/camel/karaf/commands/AbstractRouteCommand.java
Wed Feb 27 13:58:58 2013
@@ -47,7 +47,15 @@ public abstract class AbstractRouteComma
         }
         for (Route camelRoute : camelRoutes) {
             CamelContext camelContext = camelRoute.getRouteContext().getCamelContext();
-            executeOnRoute(camelContext, camelRoute);
+            // Setting thread context classloader to the bundle classloader to enable
+            // legacy code that relies on it
+            ClassLoader oldClassloader = Thread.currentThread().getContextClassLoader();
+            Thread.currentThread().setContextClassLoader(camelContext.getApplicationContextClassLoader());
+            try {
+                executeOnRoute(camelContext, camelRoute);
+            } finally {
+                Thread.currentThread().setContextClassLoader(oldClassloader);
+            }
         }
 
         return null;



Mime
View raw message