Interface DestructorRegistry
- All Known Subinterfaces:
DestructorTree
- All Known Implementing Classes:
DefaultDestructorTree,Request
public interface DestructorRegistry
An interface whose implementations can register contextual instances for idempotent destruction at some later point.
This interface is often used by implementors of systems of dependent object destruction, and normally by no other kinds of users.
Laird Nelson- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceAn interface indicating that an implementation is capable of destroying an object that it opaquely references such that the destroyed object will no longer be suitable for use. -
Method Summary
Modifier and TypeMethodDescriptionbooleanregister(Object instance, DestructorRegistry.Destructor destructor) Registers the supplied contextual instance such that at some future moment, or perhaps not at all, the suppliedDestructorRegistry.Destructorwill be run to destroy it idempotently, and returnstrueif and only if the registration was successful.
-
Method Details
-
register
Registers the supplied contextual instance such that at some future moment, or perhaps not at all, the suppliedDestructorRegistry.Destructorwill be run to destroy it idempotently, and returnstrueif and only if the registration was successful.- Parameters:
instance- a contextual instance; may benullin which case no action will be taken andfalsewill be returneddestructor- aDestructorRegistry.Destructor; may benullin which case no action will be taken andfalsewill be returned- Returns:
trueif and only if registration was successful;falseotherwise- See Also:
-