servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r486638 - /incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ComponentMBeanImpl.java
Date Wed, 13 Dec 2006 13:18:43 GMT
Author: gnodet
Date: Wed Dec 13 05:18:43 2006
New Revision: 486638

URL: http://svn.apache.org/viewvc?view=rev&rev=486638
Log:
SM-410: Classloader not destroyed when component is uninstalled

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

Modified: incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ComponentMBeanImpl.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ComponentMBeanImpl.java?view=diff&rev=486638&r1=486637&r2=486638
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ComponentMBeanImpl.java
(original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/ComponentMBeanImpl.java
Wed Dec 13 05:18:43 2006
@@ -43,6 +43,7 @@
 import org.apache.servicemix.jbi.management.OperationInfoHelper;
 import org.apache.servicemix.jbi.messaging.DeliveryChannelImpl;
 import org.apache.servicemix.jbi.util.XmlPersistenceSupport;
+import org.apache.xbean.classloader.DestroyableClassLoader;
 
 /**
  * Defines basic statistics on the Component
@@ -96,6 +97,16 @@
         this.service = service;
         this.sharedLibraries = sharedLibraries;
     }
+    
+    public void dispose() {
+        ClassLoader cl = component.getClass().getClassLoader();
+        lifeCycle = null;
+        suManager = null;
+        component = null;
+        if (cl instanceof DestroyableClassLoader) {
+            ((DestroyableClassLoader) cl).destroy();
+        }
+    }
 
     /**
      * Register the MBeans for this Component
@@ -333,6 +344,8 @@
                 getDeliveryChannel().close();
                 setDeliveryChannel(null);
             }
+            lifeCycle = null;
+            suManager = null;
         }
         super.shutDown();
         fireEvent(ComponentEvent.COMPONENT_SHUTDOWN);



Mime
View raw message