Package org.aksw.commons.util.ref
Interface RefDelegate<T,R extends Ref<T>>
-
- All Superinterfaces:
AutoCloseable,Ref<T>
- All Known Subinterfaces:
RefFuture<T>
- All Known Implementing Classes:
RefDelegateBase,RefFutureImpl
public interface RefDelegate<T,R extends Ref<T>> extends Ref<T>
Interface with default methods that delegate Ref's methods
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Ref<T>acquire(Object purpose)Acquire 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[]getAcquisitionStackTrace()Optional operation.default StackTraceElement[]getCloseStackTrace()default StackTraceElement[]getCloseTriggerStackTrace()RgetDelegate()default Ref<T>getRootRef()Get the root referencedefault ObjectgetSynchronizer()Return 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 closed-
Methods inherited from interface org.aksw.commons.util.ref.Ref
acquire, acquireMapped
-
-
-
-
Method Detail
-
getDelegate
R getDelegate()
-
getRootRef
default Ref<T> getRootRef()
Description copied from interface:RefGet the root reference- Specified by:
getRootRefin interfaceRef<T>
-
get
default T 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
default Ref<T> acquire(Object purpose)
Description copied from interface:RefAcquire a new reference with a given comment object Acquiration fails if isAlive() returns false
-
isAlive
default boolean isAlive()
Description copied from interface:RefA reference may itself be closed, but references to it may keep it alive
-
isClosed
default boolean isClosed()
Description copied from interface:RefCheck whether this reference is closed
-
close
default void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceRef<T>
-
getSynchronizer
default Object 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
default StackTraceElement[] getAcquisitionStackTrace()
Description copied from interface:RefOptional operation. References may expose where they were acquired- Specified by:
getAcquisitionStackTracein interfaceRef<T>- Returns:
-
getCloseStackTrace
default StackTraceElement[] getCloseStackTrace()
- Specified by:
getCloseStackTracein interfaceRef<T>
-
getCloseTriggerStackTrace
default StackTraceElement[] getCloseTriggerStackTrace()
- Specified by:
getCloseTriggerStackTracein interfaceRef<T>
-
-