re OpenHFT/Chronicle-Map#134 Reflection based access to Cleaner compatible with 8 and 9+ JDKs.

This commit is contained in:
Paweł Dąbrowski
2018-04-23 17:33:43 +02:00
parent e7c7dd8975
commit f2064f4db4
4 changed files with 78 additions and 2 deletions
@@ -25,6 +25,8 @@ import net.openhft.chronicle.core.Maths;
import net.openhft.chronicle.core.OS;
import net.openhft.chronicle.hash.*;
import net.openhft.chronicle.hash.impl.util.BuildVersion;
import net.openhft.chronicle.hash.impl.util.Cleaner;
import net.openhft.chronicle.hash.impl.util.CleanerUtils;
import net.openhft.chronicle.hash.impl.util.jna.PosixMsync;
import net.openhft.chronicle.hash.impl.util.jna.WindowsMsync;
import net.openhft.chronicle.hash.serialization.DataAccess;
@@ -38,7 +40,6 @@ import net.openhft.chronicle.wire.Marshallable;
import net.openhft.chronicle.wire.WireIn;
import net.openhft.chronicle.wire.WireOut;
import org.jetbrains.annotations.NotNull;
import sun.misc.Cleaner;
import java.io.Closeable;
import java.io.File;
@@ -465,7 +466,7 @@ public abstract class VanillaChronicleHash<K,
}
public void registerCleaner() {
this.cleaner = Cleaner.create(this, resources);
this.cleaner = CleanerUtils.createCleaner(this, resources);
}
public void addToOnExitHook() {