@ Override public void destroy ( ) { Thread thread = Thread . currentThread ( ) ; ClassLoader oldLoader = thread . getContextClassLoader ( ) ; try { thread . setContextClassLoader ( this ) ; WeakStopListener stopListener = _stopListener ; _stopListener = null ; super . destroy ( ) ; thread . setContextClassLoader ( oldLoader ) ; ClassLoader parent = getParent ( ) ; for ( ; parent != null ; parent = parent . getParent ( ) ) { if ( parent instanceof EnvironmentClassLoader ) { EnvironmentClassLoader loader = ( EnvironmentClassLoader ) parent ; loader . removeListener ( stopListener ) ; } } } finally { thread . setContextClassLoader ( oldLoader ) ; //_owner = null; _attributes = null ; _listeners = null ; //_scanListeners = null; //_stopListener = null; /* EnvironmentAdmin admin = _admin; _admin = null; if (admin != null) admin.unregister(); */ } }
Destroys the class loader .