public class LazyCleaner
extends java.lang.Object
Note: this is a driver-internal class
| Modifier and Type | Class and Description |
|---|---|
static interface |
LazyCleaner.Cleanable<T extends java.lang.Throwable> |
static interface |
LazyCleaner.CleaningAction<T extends java.lang.Throwable> |
private class |
LazyCleaner.Node<T extends java.lang.Throwable> |
| Modifier and Type | Field and Description |
|---|---|
private LazyCleaner.Node<?> |
first |
private static LazyCleaner |
instance |
private static java.util.logging.Logger |
LOGGER |
private java.lang.ref.ReferenceQueue<java.lang.Object> |
queue |
private java.util.concurrent.ThreadFactory |
threadFactory |
private boolean |
threadRunning |
private long |
threadTtl |
private int |
watchedCount |
| Modifier | Constructor and Description |
|---|---|
|
LazyCleaner(java.time.Duration threadTtl,
java.lang.String threadName) |
private |
LazyCleaner(java.time.Duration threadTtl,
java.util.concurrent.ThreadFactory threadFactory) |
| Modifier and Type | Method and Description |
|---|---|
private <T extends java.lang.Throwable> |
add(LazyCleaner.Node<T> node) |
private boolean |
checkEmpty() |
static LazyCleaner |
getInstance()
Returns a default cleaner instance.
|
int |
getWatchedCount() |
boolean |
isThreadRunning() |
<T extends java.lang.Throwable> |
register(java.lang.Object obj,
LazyCleaner.CleaningAction<T> action) |
private boolean |
remove(LazyCleaner.Node<?> node) |
private boolean |
startThread() |
private static final java.util.logging.Logger LOGGER
private static final LazyCleaner instance
private final java.lang.ref.ReferenceQueue<java.lang.Object> queue
private final long threadTtl
private final java.util.concurrent.ThreadFactory threadFactory
private boolean threadRunning
private int watchedCount
private LazyCleaner.Node<?> first
public LazyCleaner(java.time.Duration threadTtl,
java.lang.String threadName)
private LazyCleaner(java.time.Duration threadTtl,
java.util.concurrent.ThreadFactory threadFactory)
public static LazyCleaner getInstance()
Note: this is driver-internal API.
public <T extends java.lang.Throwable> LazyCleaner.Cleanable<T> register(java.lang.Object obj, LazyCleaner.CleaningAction<T> action)
public int getWatchedCount()
public boolean isThreadRunning()
private boolean checkEmpty()
private <T extends java.lang.Throwable> LazyCleaner.Node<T> add(LazyCleaner.Node<T> node)
private boolean startThread()
private boolean remove(LazyCleaner.Node<?> node)