public void dispose() { if (classLoader instanceof DestroyableClassLoader) { ((DestroyableClassLoader) classLoader).destroy(); } classLoader = null; }
public void dispose() { ClassLoader cl = component.getClass().getClassLoader(); lifeCycle = null; suManager = null; component = null; if (cl instanceof DestroyableClassLoader) { ((DestroyableClassLoader) cl).destroy(); } fireEvent(ComponentEvent.COMPONENT_UNINSTALLED); }
/** * Uninstall a BC or SE. This completely removes the component from the JBI system. * * @throws javax.jbi.JBIException if the uninstallation fails. */ public void uninstall() throws javax.jbi.JBIException { // TODO: check component status // the component must not be started and not have any SUs deployed if (!isInstalled()) { throw new DeploymentException("Component is not installed"); } String componentName = context.getComponentName(); try { container.deactivateComponent(componentName); //keep tck happy. bootstrap.init(this.context); bootstrap.getExtensionMBeanName(); bootstrap.onUninstall(); } finally { cleanUpBootstrap(); context.setInstall(true); // If it was found by a destroyable classloader destroy it // XXX Should we be holding the classloader as a member as always destroying it? if (bootstrap.getClass().getClassLoader() instanceof DestroyableClassLoader) { ((DestroyableClassLoader) bootstrap.getClass().getClassLoader()).destroy(); } System.gc(); container.getEnvironmentContext().removeComponentRootDirectory(componentName); } }