@ Override protected void classLoaderChanged ( ) { Vector toRemove = new Vector ( ) ; // safely remove for ( Enumeration e = listeners . elements ( ) ; e . hasMoreElements ( ) ; ) { WeakReference wr = ( WeakReference ) e . nextElement ( ) ; Listener l = ( Listener ) wr . get ( ) ; if ( l == null ) // garbage collected toRemove . add ( wr ) ; else l . classLoaderChanged ( ) ; } for ( Enumeration e = toRemove . elements ( ) ; e . hasMoreElements ( ) ; ) listeners . removeElement ( . nextElement ( ) ) ; }
Clear global class cache and notify namespaces to clear their class caches .