public class ThreadedHousekeeper extends Object implements Housekeeper
| Modifier and Type | Class and Description |
|---|---|
class |
ThreadedHousekeeper.Ref |
Housekeeper.CleanupRunnable| Modifier and Type | Method and Description |
|---|---|
static ThreadedHousekeeper.Ref |
acquire() |
<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 immediately
|
void |
remove(Object cleanupKey)
Removes cleanup runnable for the given referent
|
void |
setLogLeakedReferences(boolean value)
Enable/Disable leaked reference logging
|
boolean |
testCheckCleaned(int referentId)
Test only
|
void |
testClear()
Test only
|
public static ThreadedHousekeeper.Ref acquire()
public void setLogLeakedReferences(boolean value)
HousekeepersetLogLeakedReferences in interface Housekeeperpublic void emptyQueue()
HousekeeperemptyQueue in interface Housekeeperpublic <T> Object add(T referent, Housekeeper.CleanupRunnable cleanup)
Housekeeperadd in interface Housekeeperreferent - Reference to trackcleanup - Runnable to run when referent is phantom-edpublic void remove(Object cleanupKey)
Housekeeperremove in interface HousekeepercleanupKey - Key to reference to stop trackingpublic boolean testCheckCleaned(int referentId)
public void testClear()
Copyright © 2013-2015 impossibl.com. All Rights Reserved.