Package org.postgresql.pljava.internal
Class DualState.SingleDeleteGlobalRefP<T>
java.lang.Object
java.lang.ref.Reference<T>
java.lang.ref.WeakReference<T>
org.postgresql.pljava.internal.DualState<T>
org.postgresql.pljava.internal.DualState.SingleGuardedLong<T>
org.postgresql.pljava.internal.DualState.SingleDeleteGlobalRefP<T>
public abstract static class DualState.SingleDeleteGlobalRefP<T>
extends DualState.SingleGuardedLong<T>
A
DualState
subclass whose only native resource releasing action
needed is a JNI DeleteGlobalRef
of a single pointer.-
Nested Class Summary
Nested classes/interfaces inherited from class org.postgresql.pljava.internal.DualState
DualState.BBHeapFreeTuple<T>, DualState.ListHead, DualState.Pinned, DualState.SingleDeleteGlobalRefP<T>, DualState.SingleFreeErrorData<T>, DualState.SingleFreeTupleDesc<T>, DualState.SingleGuardedBB<T>, DualState.SingleGuardedLong<T>, DualState.SingleHeapFreeTuple<T>, DualState.SingleMemContextDelete<T>, DualState.SinglePfree<T>, DualState.SingleSPIcursorClose<T>, DualState.SingleSPIfreeplan<T>, DualState.SingleSPIfreetuptable<T>
-
Constructor Summary
ModifierConstructorDescriptionprotected
SingleDeleteGlobalRefP
(T referent, Lifespan span, long dgrTarget) -
Method Summary
Modifier and TypeMethodDescriptionReturn aprintf
format string resembling"%s something(%x)"
where the%x
will be the value being guarded; the "something" should indicate what the value represents, or what will be done with it when released by Java.protected void
javaStateReleased
(boolean nativeStateLive) When the Java state is released (it won't normally go unreachable, because of the global ref), a JNIDeleteGlobalRef
call is made so the instance can be collected without having to wait for release of its containing context.protected void
nativeStateReleased
(boolean javaStateLive) When the native state is released, a JNIDeleteGlobalRef
call is made so the global ref stored in that to-be-released memory isn't leaked (left permanently live).Methods inherited from class org.postgresql.pljava.internal.DualState.SingleGuardedLong
guardedLong, toString
Methods inherited from class org.postgresql.pljava.internal.DualState
adoptionLock, adoptionUnlock, clear, enqueue, get, identifierForMessage, invalidMessage, invalidSqlState, javaStateUnreachable, lock, m, pin, pinned, pinnedByCurrentThread, pinnedNoChecked, pinUnlessReleased, referent, releasedMessage, releasedSqlState, releaseFromJava, toString, unlessReleased, unlock, unlock, unpin
Methods inherited from class java.lang.ref.Reference
clone, isEnqueued, reachabilityFence, refersTo
-
Constructor Details
-
SingleDeleteGlobalRefP
-
-
Method Details
-
formatString
Description copied from class:DualState.SingleGuardedLong
Return aprintf
format string resembling"%s something(%x)"
where the%x
will be the value being guarded; the "something" should indicate what the value represents, or what will be done with it when released by Java.- Overrides:
formatString
in classDualState.SingleGuardedLong<T>
-
javaStateReleased
protected void javaStateReleased(boolean nativeStateLive) When the Java state is released (it won't normally go unreachable, because of the global ref), a JNIDeleteGlobalRef
call is made so the instance can be collected without having to wait for release of its containing context.- Overrides:
javaStateReleased
in classDualState<T>
- Parameters:
nativeStateLive
- true is passed if the instance's "native state" is still considered live, that is, no lifespan callback has been invoked to stamp it invalid (nor has it been "adopted").
-
nativeStateReleased
protected void nativeStateReleased(boolean javaStateLive) When the native state is released, a JNIDeleteGlobalRef
call is made so the global ref stored in that to-be-released memory isn't leaked (left permanently live).- Overrides:
nativeStateReleased
in classDualState<T>
- Parameters:
javaStateLive
- true is passed if the instance's "Java state" is still considered live, that is,releaseFromJava
has not been called, and the garbage collector has not determined the referent to be unreachable.
-