public abstract class AbstractCloseableReferenceCounted extends AbstractReferenceCounted implements CloseableTracer
WARN_COUNT, WARN_NSINIT| Constructor and Description |
|---|
AbstractCloseableReferenceCounted() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Doesn't throw a checked exception.
|
boolean |
isClosed() |
void |
release(ReferenceOwner id)
Releases a resource.
|
void |
releaseLast(ReferenceOwner id)
Releases a resource and checks this is the last usage.
|
void |
reserve(ReferenceOwner id)
Reserves a resource or throws an Exception.
|
void |
reserveTransfer(ReferenceOwner from,
ReferenceOwner to) |
protected void |
setClosed() |
void |
throwExceptionIfClosed() |
protected void |
throwExceptionIfClosedInSetter() |
boolean |
tryReserve(ReferenceOwner id)
Tries to reserve a resource and returns if the resource could
be successfully reserved.
|
assertReferencesReleased, createdHere, disableReferenceTracing, enableReferenceTracing, performRelease, performReleaseInBackground, refCount, referenceId, reservedBy, threadSafetyCheck, throwExceptionIfNotReleased, throwExceptionIfReleased, toString, unmonitor, warnAndReleaseIfNotReleasedclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcreatedHerecloseQuietly, closeQuietly, notifyClosingisClosingonReleased, onReleasedreleaseLastreferenceName, temporarypublic void reserve(ReferenceOwner id) throws IllegalStateException
ReferenceCountedEach invocation of this method increases the reference count by one.
reserve in interface ReferenceCountedreserve in class AbstractReferenceCountedid - unique id for this reserveIllegalStateException - if the resource has already been freed.
I.e. its reference counter has as some point reached zero.public void reserveTransfer(ReferenceOwner from, ReferenceOwner to) throws IllegalStateException
reserveTransfer in interface ReferenceCountedreserveTransfer in class AbstractReferenceCountedIllegalStateExceptionpublic void release(ReferenceOwner id) throws IllegalStateException
ReferenceCountedEach invocation of this method decreases the reference count by one.
release in interface ReferenceCountedrelease in class AbstractReferenceCountedid - unique id for the reserve to be releasedIllegalStateException - if the resource has already been freed.
I.e. its reference counter has as some point reached zero.public void releaseLast(ReferenceOwner id) throws IllegalStateException
ReferenceCountedEach invocation of this method decreases the reference count by one.
releaseLast in interface ReferenceCountedreleaseLast in class AbstractReferenceCountedid - unique id for the reserve to be releasedIllegalStateException - if the resource has already been freed.
I.e. its reference counter has as some point reached zero.public boolean tryReserve(ReferenceOwner id) throws IllegalStateException
ReferenceCountedEach invocation of this method increases the reference count by one.
tryReserve in interface ReferenceCountedtryReserve in class AbstractReferenceCountedid - unique id for this reserveIllegalStateException - if the resource has already been freed.
I.e. its reference counter has as some point reached zero.public void close()
Closeableclose in interface Closeableclose in interface AutoCloseableprotected void setClosed()
public void throwExceptionIfClosed()
throws IllegalStateException
throwExceptionIfClosed in interface QueryCloseableIllegalStateExceptionprotected void throwExceptionIfClosedInSetter()
throws IllegalStateException
IllegalStateExceptionpublic boolean isClosed()
isClosed in interface QueryCloseableCopyright © 2020. All rights reserved.