public interface LivenessReferent
LivenessManager
.Modifier and Type | Method and Description |
---|---|
void |
dropReference()
Drop a previously-retained reference to this referent.
|
default String |
getReferentDescription()
Get a name that is suitable for uniquely identifying this
LivenessReferent in debug and error messages. |
WeakReference<? extends LivenessReferent> |
getWeakReference()
Get a
WeakReference to this referent. |
default void |
retainReference()
Record a reference to this
LivenessReferent , which must later be dropped. |
boolean |
tryRetainReference()
If this referent is "live", behave as
LivenessReferent.retainReference() and return true. |
default void retainReference()
LivenessReferent
, which must later be dropped.LivenessStateException
- If this referent is no longer "live"boolean tryRetainReference()
LivenessReferent.retainReference()
and return true.
Otherwise, returns false rather than throwing an exception.void dropReference()
WeakReference<? extends LivenessReferent> getWeakReference()
WeakReference
to this referent. This may be cached, or newly created.default String getReferentDescription()
LivenessReferent
in debug and error messages.
This is usually not the same as Object.toString()
.