Interface DelegatingLivenessNode

All Superinterfaces:
DelegatingLivenessReferent, LivenessManager, LivenessNode, LivenessReferent
All Known Implementing Classes:
FigureWidget, RegionedColumnSourceManager

public interface DelegatingLivenessNode extends DelegatingLivenessReferent, LivenessNode
Indicates that this class implements LivenessNode via a member rather than implementing it directly. The real LivenessNode is exposed via asLivenessNode(), all other methods delegate to this instance.
  • Method Details

    • asLivenessNode

      LivenessNode asLivenessNode()
      Returns the "real" LivenessNode instance. When implementing this, care should be taken to match lifecycle of the DelegatingLivenessNode instance with this instance, as the returned LivenessNode behaves as a proxy for this.
      Returns:
      a LivenessNode to use to manage this object's liveness.
    • asLivenessReferent

      default LivenessReferent asLivenessReferent()
      Description copied from interface: DelegatingLivenessReferent
      Returns the "real" LivenessReferent instance. When implementing this, care should be taken to match lifecycle of the DelegatingLivenessReferent instance with this instance, as the returned LivenessReferent behaves as a proxy for this.
      Specified by:
      asLivenessReferent in interface DelegatingLivenessReferent
      Returns:
      a LivenessReferent to use to manage this object's liveness.
    • tryManage

      default boolean tryManage(@NotNull @NotNull LivenessReferent referent)
      Description copied from interface: LivenessManager
      Attempt to add referent to this manager. Will succeed if referent is live and if this manager is not a LivenessReferent or is live.
      Specified by:
      tryManage in interface LivenessManager
      Parameters:
      referent - The referent to add
      Returns:
      Whether the referent was in fact added
    • tryUnmanage

      default boolean tryUnmanage(@NotNull @NotNull LivenessReferent referent)
      Description copied from interface: LivenessManager
      If this manager manages referent one or more times, drop one such reference. If this manager is also a LivenessReferent, then this method is a no-op if this is not live.

      Strongly prefer using LivenessManager.tryUnmanage(Stream)} when multiple referents should be unmanaged.

      Specified by:
      tryUnmanage in interface LivenessManager
      Parameters:
      referent - The referent to drop
      Returns:
      If this node is also a LivenessReferent, whether this node was live and thus in fact tried to drop a reference. Else always returns true if dropping a reference via this method is supported by the implementation.
    • tryUnmanage

      default boolean tryUnmanage(@NotNull @NotNull Stream<? extends LivenessReferent> referents)
      Description copied from interface: LivenessManager
      For each referent in referents, if this manager manages referent one or more times, drop one such reference. If this manager is also a LivenessReferent, then this method is a no-op if this is not live.
      Specified by:
      tryUnmanage in interface LivenessManager
      Parameters:
      referents - The referents to drop
      Returns:
      If this node is also a LivenessReferent, whether this node was live and thus in fact tried to drop the references. Else always returns true if dropping a reference via this method is supported by the implementation.