servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r701374 - /servicemix/components/shared-libraries/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/AsyncBaseLifeCycle.java
Date Fri, 03 Oct 2008 13:23:04 GMT
Author: gnodet
Date: Fri Oct  3 06:23:04 2008
New Revision: 701374

URL: http://svn.apache.org/viewvc?rev=701374&view=rev
Log:
SM-1609: Make sure the component classloader is used by the lifecycle when calling operations
for init / start / stop / shutdown

Modified:
    servicemix/components/shared-libraries/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/AsyncBaseLifeCycle.java

Modified: servicemix/components/shared-libraries/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/AsyncBaseLifeCycle.java
URL: http://svn.apache.org/viewvc/servicemix/components/shared-libraries/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/AsyncBaseLifeCycle.java?rev=701374&r1=701373&r2=701374&view=diff
==============================================================================
--- servicemix/components/shared-libraries/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/AsyncBaseLifeCycle.java
(original)
+++ servicemix/components/shared-libraries/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/AsyncBaseLifeCycle.java
Fri Oct  3 06:23:04 2008
@@ -183,6 +183,7 @@
             if (logger.isDebugEnabled()) {
                 logger.debug("Initializing component");
             }
+            Thread.currentThread().setContextClassLoader(component.getClass().getClassLoader());
             this.context = context;
             this.channel = context.getDeliveryChannel();
             try {
@@ -248,6 +249,7 @@
             if (logger.isDebugEnabled()) {
                 logger.debug("Shutting down component");
             }
+            Thread.currentThread().setContextClassLoader(component.getClass().getClassLoader());
             doShutDown();
             setCurrentState(LifeCycleMBean.SHUTDOWN);
             this.context = null;
@@ -287,6 +289,7 @@
             if (logger.isDebugEnabled()) {
                 logger.debug("Starting component");
             }
+            Thread.currentThread().setContextClassLoader(component.getClass().getClassLoader());
             if (this.running.compareAndSet(false, true)) {
                 doStart();
                 setCurrentState(LifeCycleMBean.STARTED);
@@ -366,6 +369,7 @@
             if (logger.isDebugEnabled()) {
                 logger.debug("Stopping component");
             }
+            Thread.currentThread().setContextClassLoader(component.getClass().getClassLoader());
             if (this.running.compareAndSet(true, false)) {
                 doStop();
                 setCurrentState(LifeCycleMBean.STOPPED);



Mime
View raw message