private void cleanup ( ) { final String methodName = "cleanup(): " ; try { final Bundle b = bundle . getAndSet ( null ) ; if ( b != null ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName + "Uninstalling bundle location: " + b . getLocation ( ) + ", bundle id: " + b . getBundleId ( ) ) ; } SecurityManager sm = System . getSecurityManager ( ) ; if ( sm != null ) { AccessController . doPrivileged ( new PrivilegedAction < Void > ( ) { @ Override public Void run ( ) { try { b . uninstall ( ) ; return null ; } catch ( BundleException ignored ) { return null ; } } } ) ; } else { b . uninstall ( ) ; } } } catch ( BundleException ignored ) { } catch ( IllegalStateException ignored ) { } }
Cleans up the TCCL instance . Once called this TCCL is effectively disabled . It s associated gateway bundle will have been removed .