home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1999 April / DPPCPRO0499.ISO / April / Notes / 50b2wic.exe / DATA1.CAB / NotesProgramFilesJavaSupport / rt.jar / sun / misc / Ref.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-04-23  |  750 b   |  45 lines

  1. package sun.misc;
  2.  
  3. public abstract class Ref {
  4.    static long lruclock;
  5.    private Object thing;
  6.    private long priority;
  7.  
  8.    public Object get() {
  9.       Object var1 = this.thing;
  10.       if (var1 == null) {
  11.          synchronized(this){}
  12.  
  13.          try {
  14.             if ((var1 = this.thing) == null) {
  15.                var1 = this.reconstitute();
  16.                this.thing = var1;
  17.             }
  18.          } catch (Throwable var4) {
  19.             throw var4;
  20.          }
  21.       }
  22.  
  23.       this.priority = ++lruclock;
  24.       return var1;
  25.    }
  26.  
  27.    public abstract Object reconstitute();
  28.  
  29.    public void flush() {
  30.       this.thing = null;
  31.    }
  32.  
  33.    public void setThing(Object var1) {
  34.       this.thing = var1;
  35.    }
  36.  
  37.    public Object check() {
  38.       return this.thing;
  39.    }
  40.  
  41.    public Ref() {
  42.       this.priority = ++lruclock;
  43.    }
  44. }
  45.