public void run() { try { while (true) { Object obj = referenceQueue.remove(); if (obj instanceof Ref.State) { ((Ref.State) obj).release(true); } } } catch (InterruptedException e) { } finally { EXEC.execute(this); } } }
public void run() { try { while (true) { Object obj = referenceQueue.remove(); if (obj instanceof Ref.State) { ((Ref.State) obj).release(true); } } } catch (InterruptedException e) { } finally { EXEC.execute(this); } } });
public void run() { try { while (true) { Object obj = referenceQueue.remove(); if (obj instanceof Ref.State) { ((Ref.State) obj).release(true); } } } catch (InterruptedException e) { } finally { EXEC.execute(this); } } }
public void run() { try { while (true) { Object obj = referenceQueue.remove(); if (obj instanceof Ref.State) { ((Ref.State) obj).release(true); } } } catch (InterruptedException e) { } finally { EXEC.execute(this); } } }
public void run() { try { while (true) { Object obj = referenceQueue.remove(); if (obj instanceof Ref.State) { ((Ref.State) obj).release(true); } } } catch (InterruptedException e) { } finally { EXEC.execute(this); } } }
public Throwable ensureReleased(Throwable accumulate) { return state.ensureReleased(accumulate); }
public void close() { state.ensureReleased(); }
public void ensureReleased() { state.ensureReleased(); }
public Throwable ensureReleased(Throwable accumulate) { return state.ensureReleased(accumulate); }
public void ensureReleased() { maybeFail(state.ensureReleased(null)); }
/** * Must be called exactly once, when the logical operation for which this Ref was created has terminated. * Failure to abide by this contract will result in an error (eventually) being reported, assuming a * hard reference to the resource it managed is not leaked. */ public void release() { state.release(false); }
Ref(T referent, GlobalState state) { this.state = new State(state, this, referenceQueue); this.referent = referent; }
public Ref<T> ref() { Ref<T> ref = tryRef(); // TODO: print the last release as well as the release here if (ref == null) state.assertNotReleased(); return ref; }
public void ensureReleased() { maybeFail(state.ensureReleased(null)); }
public void ensureReleased() { maybeFail(state.ensureReleased(null)); }
Ref(T referent, GlobalState state) { this.state = new State(state, this, referenceQueue); this.referent = referent; }
public Ref(T referent, Tidy tidy) { this.state = new State(new GlobalState(tidy), this, referenceQueue); this.referent = referent; }
/** * Must be called exactly once, when the logical operation for which this Ref was created has terminated. * Failure to abide by this contract will result in an error (eventually) being reported, assuming a * hard reference to the resource it managed is not leaked. */ public void release() { state.release(false); }
public T get() { state.assertNotReleased(); return referent; }
Ref(T referent, GlobalState state) { this.state = new State(state, this, referenceQueue); this.referent = referent; }