![JAR search and dependency download from the Maven repository](/logo.png)
xdean.jex.util.lang.FinalizeSupport Maven / Gradle / Ivy
The newest version!
package xdean.jex.util.lang;
import java.lang.ref.PhantomReference;
import java.lang.ref.Reference;
import java.lang.ref.ReferenceQueue;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
import io.reactivex.Scheduler;
import io.reactivex.schedulers.Schedulers;
/**
* Provide a convenient way to do something on the moment when an object be collected by gc.
*
* @author Dean Xu ([email protected])
*
*/
public class FinalizeSupport {
private static final Map, Runnable> FINALIZE_TASK_MAP = new ConcurrentHashMap<>();
private static final ReferenceQueue
© 2015 - 2025 Weber Informatics LLC | Privacy Policy