public final class TracingReferenceCounted extends Object implements MonitorReferenceCounted
INIT, TMP| Modifier and Type | Method and Description |
|---|---|
StackTrace |
createdHere() |
int |
refCount()
Returns the reference count for this resource.
|
@NotNull List<String> |
referencesAsString() |
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.
|
boolean |
reservedBy(ReferenceOwner owner)
Best effort check the owner has reserved it.
|
void |
throwExceptionIfNotReleased() |
void |
throwExceptionIfReleased() |
@NotNull String |
toString() |
boolean |
tryReserve(ReferenceOwner id)
Tries to reserve a resource and returns if the resource could
be successfully reserved.
|
boolean |
unmonitored() |
void |
unmonitored(boolean unmonitored) |
void |
warnAndReleaseIfNotReleased() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitonReleasedreleaseLast, reserveTransferreferenceId, referenceName, temporarypublic StackTrace createdHere()
createdHere in interface ReferenceCountedTracerpublic boolean reservedBy(ReferenceOwner owner) throws IllegalStateException
ReferenceCountedtrue if not sure.reservedBy in interface ReferenceCountedowner - to checkIllegalStateExceptionpublic void reserve(ReferenceOwner id) throws IllegalStateException
ReferenceCountedEach invocation of this method increases the reference count by one.
reserve in interface ReferenceCountedid - unique id for this reserveIllegalStateException - 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, IllegalArgumentException
ReferenceCountedEach invocation of this method increases the reference count by one.
tryReserve in interface ReferenceCountedid - unique id for this reserveIllegalStateException - if the resource has already been freed.
I.e. its reference counter has as some point reached zero.IllegalArgumentExceptionpublic void release(ReferenceOwner id) throws IllegalStateException
ReferenceCountedEach invocation of this method decreases the reference count by one.
release in interface ReferenceCountedid - 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 ReferenceCountedid - 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 int refCount()
ReferenceCountedrefCount in interface ReferenceCountedpublic void throwExceptionIfNotReleased()
throws IllegalStateException
throwExceptionIfNotReleased in interface ReferenceCountedTracerIllegalStateExceptionpublic void throwExceptionIfReleased()
throws ClosedIllegalStateException
throwExceptionIfReleased in interface ReferenceCountedTracerClosedIllegalStateExceptionpublic void warnAndReleaseIfNotReleased()
warnAndReleaseIfNotReleased in interface ReferenceCountedTracerpublic void unmonitored(boolean unmonitored)
unmonitored in interface MonitorReferenceCountedpublic boolean unmonitored()
unmonitored in interface MonitorReferenceCountedCopyright © 2022. All rights reserved.