Package de.sfuhrm.openssl4j
Class PhantomReferenceCleanup
- java.lang.Object
-
- de.sfuhrm.openssl4j.PhantomReferenceCleanup
-
class PhantomReferenceCleanup extends java.lang.ObjectFrees native AbstractNative objects. The ByteBuffer objects are allocated in OpenSSLMessageDigestNative(String) ()} and are not used any longer.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classPhantomReferenceCleanup.NativePhantomReference
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.ref.ReferenceQueue<java.lang.Object>BYTE_BUFFER_REFERENCE_QUEUEThe reference queue of unused AbstractNative objects.private static java.util.Set<PhantomReferenceCleanup.NativePhantomReference>nativePhantomReferenceListprivate static booleanrunningIs the thread running?
-
Constructor Summary
Constructors Constructor Description PhantomReferenceCleanup()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static voidenqueueForCleanup(java.lang.Object ref, java.util.function.Consumer<java.nio.ByteBuffer> freeFunction, java.nio.ByteBuffer context)Enqueues a AbstractNative for later cleanup.(package private) static voidstartIfNeeded()Checks whether the queue thread is already running and starts it if not.
-
-
-
Field Detail
-
BYTE_BUFFER_REFERENCE_QUEUE
private static final java.lang.ref.ReferenceQueue<java.lang.Object> BYTE_BUFFER_REFERENCE_QUEUE
The reference queue of unused AbstractNative objects.
-
running
private static boolean running
Is the thread running?
-
nativePhantomReferenceList
private static final java.util.Set<PhantomReferenceCleanup.NativePhantomReference> nativePhantomReferenceList
-
-
Method Detail
-
enqueueForCleanup
static void enqueueForCleanup(java.lang.Object ref, java.util.function.Consumer<java.nio.ByteBuffer> freeFunction, java.nio.ByteBuffer context)Enqueues a AbstractNative for later cleanup.
-
startIfNeeded
static void startIfNeeded()
Checks whether the queue thread is already running and starts it if not.
-
-