Package org.postgresql.util

# Interface LazyCleaner

All Known Implementing Classes:
  `LazyCleanerImpl`

public interface LazyCleaner

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Interface
  Description
  `static interface`
  `LazyCleaner.Cleanable<T extends Throwable>`
  Cleanable interface for objects that can be manually cleaned.
  `static interface`
  `LazyCleaner.CleaningAction<T extends Throwable>`
  CleaningAction interface for cleanup actions that are notified whether cleanup occurred due to a leak (automatic) or manual cleanup.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `<T extends Throwable>
  LazyCleaner.Cleanable<T>`
  `register(Object obj, LazyCleaner.CleaningAction<T> action)`
  Registers an object for cleanup when it becomes phantom reachable.

- ## Method Details

  - ### register

    <T extends Throwable> LazyCleaner.Cleanable<T> register(Object obj, LazyCleaner.CleaningAction<T> action)
    Registers an object for cleanup when it becomes phantom reachable.
    Type Parameters:
      `T` - the type of exception that can be thrown during cleanup
    Parameters:
      `obj` - the object to monitor for cleanup (should not be the same as action)
      `action` - the action to perform when the object becomes unreachable
    Returns:
      a Cleanable that can be used to manually trigger cleanup