1 28 29 package com.caucho.loader; 30 31 import com.caucho.log.Log; 32 import com.caucho.util.L10N; 33 34 import java.lang.ref.WeakReference ; 35 import java.util.logging.Logger ; 36 37 40 public class WeakLoaderListener implements ClassLoaderListener { 41 private static final L10N L = new L10N(CloseListener.class); 42 private static final Logger log = Log.open(CloseListener.class); 43 44 private WeakReference <ClassLoaderListener> _listenerRef; 45 46 51 public WeakLoaderListener(ClassLoaderListener listener) 52 { 53 _listenerRef = new WeakReference <ClassLoaderListener>(listener); 54 } 55 56 59 public void classLoaderInit(DynamicClassLoader loader) 60 { 61 ClassLoaderListener listener = _listenerRef.get(); 62 63 if (listener != null) 64 listener.classLoaderInit(loader); 65 } 66 67 70 public void classLoaderDestroy(DynamicClassLoader loader) 71 { 72 ClassLoaderListener listener = _listenerRef.get(); 73 74 if (listener != null) 75 listener.classLoaderDestroy(loader); 76 } 77 } 78 79 | Popular Tags |