You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2006/05/02 12:16:21 UTC
svn commit: r398889 -
/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/InstallerMBeanImpl.java
Author: gnodet
Date: Tue May 2 03:16:07 2006
New Revision: 398889
URL: http://svn.apache.org/viewcvs?rev=398889&view=rev
Log:
Set the current thread class loader to the component classloader when the component is created
Modified:
incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/InstallerMBeanImpl.java
Modified: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/InstallerMBeanImpl.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/InstallerMBeanImpl.java?rev=398889&r1=398888&r2=398889&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/InstallerMBeanImpl.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/InstallerMBeanImpl.java Tue May 2 03:16:07 2006
@@ -147,7 +147,9 @@
public ObjectName activateComponent() throws JBIException {
ObjectName result = null;
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
try {
+ Thread.currentThread().setContextClassLoader(componentClassLoader);
Class componentClass = componentClassLoader.loadClass(context.getComponentClassName());
if (componentClass != null){
Component component = (Component) componentClass.newInstance();
@@ -169,6 +171,8 @@
}
catch (IllegalAccessException e) {
throw new DeploymentException(e);
+ } finally {
+ Thread.currentThread().setContextClassLoader(cl);
}
return result;
}