Package io.deephaven.engine.liveness
Class StandaloneLivenessManager
java.lang.Object
io.deephaven.engine.liveness.StandaloneLivenessManager
- All Implemented Interfaces:
LogOutputAppendable
,LivenessManager
public class StandaloneLivenessManager
extends Object
implements LivenessManager, LogOutputAppendable
Simple
LivenessManager
implementation.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
Package-private forSerializable
sub-classes to use inreadObject
only.final boolean
tryManage
(@NotNull LivenessReferent referent) Attempt to addreferent
to this manager.final boolean
tryUnmanage
(@NotNull LivenessReferent referent) If this manager manages referent one or more times, drop one such reference.final 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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.deephaven.engine.liveness.LivenessManager
manage, unmanage, unmanage
-
Constructor Details
-
StandaloneLivenessManager
public StandaloneLivenessManager(boolean enforceStrongReachability) - Parameters:
enforceStrongReachability
- Whether thisLivenessManager
should maintain strong references to its referents
-
-
Method Details
-
initializeTransientFieldsForLiveness
Package-private forSerializable
sub-classes to use inreadObject
only. Public to allow unit tests in another package to work around mock issues where the constructor is never invoked. -
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.
-
append
- Specified by:
append
in interfaceLogOutputAppendable
-