Package com.impossibl.postgres.jdbc
Interface Housekeeper
-
- All Known Implementing Classes:
ThreadedHousekeeper
public interface Housekeeper
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
Housekeeper.CleanupRunnable
Cleanup runnable to execute when a reference needs to be cleaned upstatic interface
Housekeeper.Ref
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> Object
add(T referent, Housekeeper.CleanupRunnable cleanup)
Associate a cleanup runnable to be run when a referent is only phantom reference-able.void
emptyQueue()
Ensures the cleanup queue is emptied immediatelyvoid
remove(Object cleanupKey)
Removes cleanup runnable for the given referentvoid
setLogLeakedReferences(boolean value)
Enable/Disable leaked reference logging
-
-
-
Method Detail
-
add
<T> Object add(T referent, Housekeeper.CleanupRunnable cleanup)
Associate a cleanup runnable to be run when a referent is only phantom reference-able.- Parameters:
referent
- Reference to trackcleanup
- Runnable to run when referent is phantom-ed- Returns:
- Key object to use when calling remove
-
remove
void remove(Object cleanupKey)
Removes cleanup runnable for the given referent- Parameters:
cleanupKey
- Key to reference to stop tracking
-
emptyQueue
void emptyQueue()
Ensures the cleanup queue is emptied immediately
-
setLogLeakedReferences
void setLogLeakedReferences(boolean value)
Enable/Disable leaked reference logging
-
-