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)
Housekeeper
setLogLeakedReferences
in interface Housekeeper
public void emptyQueue()
Housekeeper
emptyQueue
in interface Housekeeper
public <T> Object add(T referent, Housekeeper.CleanupRunnable cleanup)
Housekeeper
add
in interface Housekeeper
referent
- Reference to trackcleanup
- Runnable to run when referent is phantom-edpublic void remove(Object cleanupKey)
Housekeeper
remove
in interface Housekeeper
cleanupKey
- Key to reference to stop trackingpublic boolean testCheckCleaned(int referentId)
public void testClear()
Copyright © 2013–2017 impossibl.com. All rights reserved.