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"LivenessNode
instance.default LivenessReferent
Returns the "real"LivenessReferent
instance.default boolean
tryManage
(@NotNull LivenessReferent referent) Attempt to addreferent
to this manager.default boolean
tryUnmanage
(@NotNull LivenessReferent referent) If this manager manages referent one or more times, drop one such reference.default boolean
tryUnmanage
(@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, tryRetainReference
Methods inherited from interface io.deephaven.engine.liveness.LivenessManager
manage, unmanage, unmanage
Methods inherited from interface io.deephaven.engine.liveness.LivenessReferent
getReferentDescription, retainReference
-
Method Details
-
asLivenessNode
LivenessNode asLivenessNode()Returns the "real"LivenessNode
instance. When implementing this, care should be taken to match lifecycle of theDelegatingLivenessNode
instance with this instance, as the returnedLivenessNode
behaves as a proxy forthis
.- Returns:
- a LivenessNode to use to manage this object's liveness.
-
asLivenessReferent
Description copied from interface:DelegatingLivenessReferent
Returns the "real"LivenessReferent
instance. When implementing this, care should be taken to match lifecycle of theDelegatingLivenessReferent
instance with this instance, as the returnedLivenessReferent
behaves as a proxy forthis
.- Specified by:
asLivenessReferent
in interfaceDelegatingLivenessReferent
- Returns:
- a LivenessReferent to use to manage this object's liveness.
-
tryManage
Description copied from interface:LivenessManager
Attempt to addreferent
to this manager. Will succeed ifreferent
is live and if this manager is not aLivenessReferent
or is live.- Specified by:
tryManage
in interfaceLivenessManager
- Parameters:
referent
- The referent to add- Returns:
- Whether the referent was in fact added
-
tryUnmanage
Description copied from interface:LivenessManager
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 ifthis
is not live.Strongly prefer using
LivenessManager.tryUnmanage(Stream)
} when multiple referents should be unmanaged.- Specified by:
tryUnmanage
in 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 returnstrue
if dropping a reference via this method is supported by the implementation.
-
tryUnmanage
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 aLivenessReferent
, then this method is a no-op ifthis
is not live.- Specified by:
tryUnmanage
in 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 returnstrue
if dropping a reference via this method is supported by the implementation.
-