com.fireflysource.common.ref.CleanerImpl Maven / Gradle / Ivy
The newest version!
package com.fireflysource.common.ref;
import com.fireflysource.common.ref.Cleaner.Cleanable;
import java.lang.ref.ReferenceQueue;
import java.util.concurrent.ThreadFactory;
import java.util.function.Function;
/**
* CleanerImpl manages a set of object references and corresponding cleaning actions.
* CleanerImpl provides the functionality of {@link com.fireflysource.common.ref.Cleaner}.
*/
public final class CleanerImpl implements Runnable {
/**
* An object to access the CleanerImpl from a Cleaner; set by Cleaner init.
*/
private static Function cleanerImplAccess = null;
/**
* Heads of a CleanableList for each reference type.
*/
final PhantomCleanable> phantomCleanableList;
// The ReferenceQueue of pending cleaning actions
final ReferenceQueue