Class SingletonLivenessManager
java.lang.Object
com.illumon.iris.db.util.liveness.SingletonLivenessManager
- All Implemented Interfaces:
LivenessManager
,ReleasableLivenessManager
public class SingletonLivenessManager extends Object implements ReleasableLivenessManager
ReleasableLivenessManager
to manage exactly one object, passed at construction time or managed later.-
Constructor Summary
Constructors Constructor Description SingletonLivenessManager()
SingletonLivenessManager(LivenessReferent referent)
-
Method Summary
Modifier and Type Method Description void
release()
Release ownership of thisReleasableLivenessManager
, allowing any retainedLivenessReferent
s to cleanup if they no longer have outstanding references.boolean
tryManage(LivenessReferent referent)
Attempt to add the specified referent to this manager.
-
Constructor Details
-
SingletonLivenessManager
public SingletonLivenessManager() -
SingletonLivenessManager
-
-
Method Details
-
tryManage
Description copied from interface:LivenessManager
Attempt to add the specified referent to this manager.- Specified by:
tryManage
in interfaceLivenessManager
- Parameters:
referent
- The referent to add- Returns:
- Whether the referent was in fact added
-
release
public final void release()Description copied from interface:ReleasableLivenessManager
Release ownership of thisReleasableLivenessManager
, allowing any retainedLivenessReferent
s to cleanup if they no longer have outstanding references.- Specified by:
release
in interfaceReleasableLivenessManager
-