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 voidrelease()Release ownership of thisReleasableLivenessManager, allowing any retainedLivenessReferents to cleanup if they no longer have outstanding references.booleantryManage(LivenessReferent referent)Attempt to add the specified referent to this manager.
-
Constructor Details
-
SingletonLivenessManager
public SingletonLivenessManager() -
SingletonLivenessManager
-
-
Method Details
-
tryManage
Description copied from interface:LivenessManagerAttempt to add the specified referent to this manager.- Specified by:
tryManagein interfaceLivenessManager- Parameters:
referent- The referent to add- Returns:
- Whether the referent was in fact added
-
release
public final void release()Description copied from interface:ReleasableLivenessManagerRelease ownership of thisReleasableLivenessManager, allowing any retainedLivenessReferents to cleanup if they no longer have outstanding references.- Specified by:
releasein interfaceReleasableLivenessManager
-