home *** CD-ROM | disk | FTP | other *** search
- package sun.misc;
-
- public abstract class Ref {
- static int lruclock;
- private Object thing;
- private long priority;
-
- public Object get() {
- Object p = this.thing;
- if (p == null) {
- synchronized(this){}
-
- try {
- if (this.thing == null) {
- p = this.reconstitute();
- this.thing = p;
- }
- } catch (Throwable var4) {
- throw var4;
- }
- }
-
- this.priority = (long)(++lruclock);
- return this.thing;
- }
-
- public abstract Object reconstitute();
-
- public void flush() {
- this.thing = null;
- }
-
- public void setThing(Object thing) {
- this.thing = thing;
- }
-
- public Object check() {
- return this.thing;
- }
-
- public Ref() {
- this.priority = (long)(++lruclock);
- }
- }
-