Package io.deephaven.engine.liveness
Interface DelegatingLivenessNode
- All Superinterfaces:
DelegatingLivenessReferent,LivenessManager,LivenessNode,LivenessReferent
- All Known Implementing Classes:
FigureWidget,RegionedColumnSourceManager
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 Summary
Modifier and TypeMethodDescriptionReturns the "real"LivenessNodeinstance.default LivenessReferentReturns the "real"LivenessReferentinstance.default booleantryManage(@NotNull LivenessReferent referent) Attempt to addreferentto this manager.default booleantryUnmanage(@NotNull LivenessReferent referent) If this manager manages referent one or more times, drop one such reference.default booleantryUnmanage(@NotNull Stream<? extends LivenessReferent> referents) For each referent in referents, if this manager manages referent one or more times, drop one such reference.Methods inherited from interface io.deephaven.engine.liveness.DelegatingLivenessReferent
dropReference, getWeakReference, tryRetainReferenceMethods inherited from interface io.deephaven.engine.liveness.LivenessManager
manage, unmanage, unmanageMethods inherited from interface io.deephaven.engine.liveness.LivenessReferent
getReferentDescription, retainReference
-
Method Details
-
asLivenessNode
LivenessNode asLivenessNode()Returns the "real"LivenessNodeinstance. When implementing this, care should be taken to match lifecycle of theDelegatingLivenessNodeinstance with this instance, as the returnedLivenessNodebehaves as a proxy forthis.- Returns:
- a LivenessNode to use to manage this object's liveness.
-
asLivenessReferent
Description copied from interface:DelegatingLivenessReferentReturns the "real"LivenessReferentinstance. When implementing this, care should be taken to match lifecycle of theDelegatingLivenessReferentinstance with this instance, as the returnedLivenessReferentbehaves as a proxy forthis.- Specified by:
asLivenessReferentin interfaceDelegatingLivenessReferent- Returns:
- a LivenessReferent to use to manage this object's liveness.
-
tryManage
Description copied from interface:LivenessManagerAttempt to addreferentto this manager. Will succeed ifreferentis live and if this manager is not aLivenessReferentor is live.- Specified by:
tryManagein interfaceLivenessManager- Parameters:
referent- The referent to add- Returns:
- Whether the referent was in fact added
-
tryUnmanage
Description copied from interface:LivenessManagerIf this manager manages referent one or more times, drop one such reference. If this manager is also aLivenessReferent, then this method is a no-op ifthisis not live.Strongly prefer using
LivenessManager.tryUnmanage(Stream)} when multiple referents should be unmanaged.- Specified by:
tryUnmanagein interfaceLivenessManager- 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 returnstrueif dropping a reference via this method is supported by the implementation.
-
tryUnmanage
Description copied from interface:LivenessManagerFor each referent in referents, if this manager manages referent one or more times, drop one such reference. If this manager is also aLivenessReferent, then this method is a no-op ifthisis not live.- Specified by:
tryUnmanagein interfaceLivenessManager- 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 returnstrueif dropping a reference via this method is supported by the implementation.
-