Package org.postgresql.util
Interface LazyCleaner
- All Known Implementing Classes:
LazyCleanerImpl
public interface LazyCleaner
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceLazyCleaner.Cleanable<T extends Throwable>Cleanable interface for objects that can be manually cleaned.static interfaceLazyCleaner.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 TypeMethodDescription<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
-