Interface RefDelegate<T, R extends Ref<T>>
- All Superinterfaces:
AutoCloseable, Ref<T>
- All Known Subinterfaces:
RefFuture<T>
- All Known Implementing Classes:
RefDelegateBase, RefFutureImpl
-
Method Summary
Modifier and TypeMethodDescriptionAcquire a new reference with a given comment object Acquiration fails if isAlive() returns falsedefault voidclose()default Tget()Get the referent only iff this ref instance has not yet been closed.default StackTraceElement[]Optional operation.default StackTraceElement[]default StackTraceElement[]Get the root referencedefault ObjectReturn the object on which reference acquisition, release and the close action are synchronized on.default booleanisAlive()A reference may itself be closed, but references to it may keep it alivedefault booleanisClosed()Check whether this reference is closedMethods inherited from interface Ref
acquire, acquireMapped
-
Method Details
-
getDelegate
R getDelegate() -
getRootRef
-
get
Description copied from interface:RefGet the referent only iff this ref instance has not yet been closed. This method fails for closed alive refs. A closed reference is alive if it has unclosed child references. For most use cases the referent should be accessed using this method. -
acquire
-
isAlive
-
isClosed
-
close
default void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceRef<T>
-
getSynchronizer
Description copied from interface:RefReturn the object on which reference acquisition, release and the close action are synchronized on.- Specified by:
getSynchronizerin interfaceRef<T>
-
getAcquisitionStackTrace
Description copied from interface:RefOptional operation. References may expose where they were acquired- Specified by:
getAcquisitionStackTracein interfaceRef<T>- Returns:
-
getCloseStackTrace
- Specified by:
getCloseStackTracein interfaceRef<T>
-
getCloseTriggerStackTrace
- Specified by:
getCloseTriggerStackTracein interfaceRef<T>
-