Class PhantomReferenceCleanup
java.lang.Object
de.sfuhrm.openssl4j.PhantomReferenceCleanup
Frees native AbstractNative objects.
The ByteBuffer objects are allocated in OpenSSLMessageDigestNative(String) ()}
and are not used any longer.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ReferenceQueue<Object> The reference queue of unused AbstractNative objects.private static final Set<PhantomReferenceCleanup.NativePhantomReference> private static booleanIs the thread running? -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static voidenqueueForCleanup(Object ref, Consumer<ByteBuffer> freeFunction, ByteBuffer context) Enqueues a AbstractNative for later cleanup.(package private) static voidChecks whether the queue thread is already running and starts it if not.
-
Field Details
-
BYTE_BUFFER_REFERENCE_QUEUE
The reference queue of unused AbstractNative objects. -
running
private static boolean runningIs the thread running? -
nativePhantomReferenceList
-
-
Constructor Details
-
PhantomReferenceCleanup
PhantomReferenceCleanup()
-
-
Method Details
-
enqueueForCleanup
Enqueues a AbstractNative for later cleanup. -
startIfNeeded
static void startIfNeeded()Checks whether the queue thread is already running and starts it if not.
-