Package com.azure.core.util
Interface ReferenceManager
public interface ReferenceManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ReferenceManagerThe global instance ofReferenceManagerthat should be used to maintain object references. -
Method Summary
-
Field Details
-
INSTANCE
The global instance ofReferenceManagerthat should be used to maintain object references.
-
-
Method Details
-
register
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.
-