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 Classes
    Modifier and Type
    Interface
    Description
    static interface 
    An 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 Type
    Method
    Description
    boolean
    Registers the supplied contextual instance such that at some future moment, or perhaps not at all, the supplied DestructorRegistry.Destructor will be run to destroy it idempotently, and returns true if and only if the registration was successful.
  • Method Details

    • register

      boolean register(Object instance, DestructorRegistry.Destructor destructor)
      Registers the supplied contextual instance such that at some future moment, or perhaps not at all, the supplied DestructorRegistry.Destructor will be run to destroy it idempotently, and returns true if and only if the registration was successful.
      Parameters:
      instance - a contextual instance; may be null in which case no action will be taken and false will be returned
      destructor - a DestructorRegistry.Destructor; may be null in which case no action will be taken and false will be returned
      Returns:
      true if and only if registration was successful; false otherwise
      See Also: