Package com.azure.core.util
Interface ReferenceManager
-
public interface ReferenceManager
-
-
Field Summary
Fields Modifier and Type Field Description static ReferenceManagerINSTANCEThe global instance ofReferenceManagerthat should be used to maintain object references.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidregister(Object object, Runnable cleanupAction)Registers theobjectand the cleaning action to run once the object becomes phantom reachable.
-
-
-
Field Detail
-
INSTANCE
static final ReferenceManager INSTANCE
The global instance ofReferenceManagerthat should be used to maintain object references.
-
-
Method Detail
-
register
void register(Object object, Runnable cleanupAction)
Registers theobjectand the cleaning action to run once the object becomes phantom reachable.The
cleanupActioncannot have a reference to theobject, otherwise the object will never be able to become phantom reachable.Exceptions thrown by
cleanupActionare ignored.- Parameters:
object- The object to monitor.cleanupAction- The cleanup action to perform when theobjectbecomes phantom reachable.- Throws:
NullPointerException- If eitherobjectorcleanupActionare null.
-
-