01: package jsint;
02:
03: import java.util.Enumeration;
04: import java.util.Vector;
05:
06: /** A Reflector contains one or more Java metaobjects that are cached.
07: They need to be reset() when the classpath is reset.
08: **/
09:
10: public abstract class Reflector extends Procedure {
11: public static final Vector reflectors = new Vector(100);
12:
13: /** Reset all know reflectors **/
14: public static void resetAll() {
15: Enumeration i = reflectors.elements();
16: while (i.hasMoreElements())
17: ((Reflector) i.nextElement()).reset();
18: }
19:
20: public boolean isPrivileged = false;
21:
22: /** Add yourself to the reflectors **/
23: public Reflector() {
24: reflectors.addElement(this );
25: }
26:
27: /** Reset your classpath dependent state. This method can't be
28: abstract.
29: **/
30: protected synchronized void reset() {
31: }
32:
33: protected Object readResolve() {
34: reset();
35: return this;
36: }
37:
38: }
|