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 Details

    • getDelegate

      R getDelegate()
    • getRootRef

      default Ref<T> getRootRef()
      Description copied from interface: Ref
      Get the root reference
      Specified by:
      getRootRef in interface Ref<T>
    • get

      default T get()
      Description copied from interface: Ref
      Get 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.
      Specified by:
      get in interface Ref<T>
      Returns:
      The referent
    • acquire

      default Ref<T> acquire(Object purpose)
      Description copied from interface: Ref
      Acquire a new reference with a given comment object Acquiration fails if isAlive() returns false
      Specified by:
      acquire in interface Ref<T>
    • isAlive

      default boolean isAlive()
      Description copied from interface: Ref
      A reference may itself be closed, but references to it may keep it alive
      Specified by:
      isAlive in interface Ref<T>
      Returns:
      true iff either this reference is not closed or there exists any acquired reference.
    • isClosed

      default boolean isClosed()
      Description copied from interface: Ref
      Check whether this reference is closed
      Specified by:
      isClosed in interface Ref<T>
    • close

      default void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Ref<T>
    • getSynchronizer

      default Object getSynchronizer()
      Description copied from interface: Ref
      Return the object on which reference acquisition, release and the close action are synchronized on.
      Specified by:
      getSynchronizer in interface Ref<T>
    • getAcquisitionStackTrace

      default StackTraceElement[] getAcquisitionStackTrace()
      Description copied from interface: Ref
      Optional operation. References may expose where they were acquired.
      Specified by:
      getAcquisitionStackTrace in interface Ref<T>
    • getCloseStackTrace

      default StackTraceElement[] getCloseStackTrace()
      Description copied from interface: Ref
      Optional operation. References may expose where they were closed was called.
      Specified by:
      getCloseStackTrace in interface Ref<T>
    • getCloseTriggerStackTrace

      default StackTraceElement[] getCloseTriggerStackTrace()
      Description copied from interface: Ref
      Optional operation. References may expose where they were close was triggered upon release.
      Specified by:
      getCloseTriggerStackTrace in interface Ref<T>