servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r393508 - /incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ComponentMBeanImpl.java
Date Wed, 12 Apr 2006 16:49:02 GMT
Author: gnodet
Date: Wed Apr 12 09:48:52 2006
New Revision: 393508

URL: http://svn.apache.org/viewcvs?rev=393508&view=rev
Log:
Thread context class loader must be set when calling component lifecycle methods

Modified:
    incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ComponentMBeanImpl.java

Modified: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ComponentMBeanImpl.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ComponentMBeanImpl.java?rev=393508&r1=393507&r2=393508&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ComponentMBeanImpl.java
(original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ComponentMBeanImpl.java
Wed Apr 12 09:48:52 2006
@@ -279,7 +279,13 @@
             init();
         }
         if (!isStarted()) {
-            getLifeCycle().start();
+            ClassLoader loader = Thread.currentThread().getContextClassLoader();
+            try {
+                Thread.currentThread().setContextClassLoader(getLifeCycle().getClass().getClassLoader());
+                getLifeCycle().start();
+            } finally {
+                Thread.currentThread().setContextClassLoader(loader);
+            }
             super.start();
             initServiceAssemblies();
             startServiceAssemblies();
@@ -296,7 +302,13 @@
     public void doStop() throws javax.jbi.JBIException {
         if (isUnknown() || isStarted()) {
             stopServiceAssemblies();
-	        getLifeCycle().stop();
+            ClassLoader loader = Thread.currentThread().getContextClassLoader();
+            try {
+                Thread.currentThread().setContextClassLoader(getLifeCycle().getClass().getClassLoader());
+                getLifeCycle().stop();
+            } finally {
+                Thread.currentThread().setContextClassLoader(loader);
+            }
 	        super.stop();
         }
         fireEvent(ComponentEvent.COMPONENT_STOPPED);
@@ -313,7 +325,13 @@
         if (!isUnknown() && !isShutDown()) {
             doStop();
             shutDownServiceAssemblies();
-            getLifeCycle().shutDown();
+            ClassLoader loader = Thread.currentThread().getContextClassLoader();
+            try {
+                Thread.currentThread().setContextClassLoader(getLifeCycle().getClass().getClassLoader());
+                getLifeCycle().shutDown();
+            } finally {
+                Thread.currentThread().setContextClassLoader(loader);
+            }
             if (getDeliveryChannel() != null) {
                 getDeliveryChannel().close();
                 setDeliveryChannel(null);



Mime
View raw message