Package com.azure.core.util
Interface ReferenceManager
public interface ReferenceManager
-
Field Summary
Modifier and TypeFieldDescriptionstatic final ReferenceManager
The global instance ofReferenceManager
that should be used to maintain object references. -
Method Summary
-
Field Details
-
INSTANCE
The global instance ofReferenceManager
that should be used to maintain object references.
-
-
Method Details
-
register
Registers theobject
and the cleaning action to run once the object becomes phantom reachable.The
cleanupAction
cannot have a reference to theobject
, otherwise the object will never be able to become phantom reachable.Exceptions thrown by
cleanupAction
are ignored.- Parameters:
object
- The object to monitor.cleanupAction
- The cleanup action to perform when theobject
becomes phantom reachable.- Throws:
NullPointerException
- If eitherobject
orcleanupAction
are null.
-