Package org.postgresql.pljava.internal
Class DualState.SingleMemContextDelete<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.SingleMemContextDelete<T>
A
DualState
subclass whose only native resource releasing action
needed is MemoryContextDelete
of a single context.
This class may get called at the nativeStateReleased
entry, not
only if the native state is actually being released, but if it is being
'claimed' by native code for its own purposes. The effect is the same
as far as Java is concerned; the object is no longer accessible, and the
native code is responsible for whatever happens to it next.
-
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
SingleMemContextDelete
(T referent, Lifespan span, MemoryContext cxt) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
javaStateUnreachable
(boolean nativeStateLive) When the Java state is released or unreachable, aMemoryContextDelete
call is made so the native memory is released without having to wait for release of its parent context.protected final MemoryContext
Produce a string with such details of this object as might be useful for debugging, starting with an abbreviated form of the class name of the supplied object.Methods inherited from class org.postgresql.pljava.internal.DualState
adoptionLock, adoptionUnlock, clear, enqueue, get, identifierForMessage, invalidMessage, invalidSqlState, javaStateReleased, lock, m, nativeStateReleased, 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
-
SingleMemContextDelete
-
-
Method Details
-
toString
Description copied from class:DualState
Produce a string with such details of this object as might be useful for debugging, starting with an abbreviated form of the class name of the supplied object.Subclasses are encouraged to override this and then call it, via super, passing the object unchanged, and then append additional subclass-specific details to the result.
Because the recursion ends here, this one actually does construct the abbreviated form of the class name of the object, and use it at the start of the returned string.
- Overrides:
toString
in classDualState<T>
- Parameters:
o
- An object whose class name (abbreviated by stripping the package prefix) will be used at the start of the string. Passingnull
is the same as passingthis
.- Returns:
- Description of this state object, prefixed with the abbreviated class name of the passed object.
-
formatString
-
memoryContext
-
javaStateUnreachable
protected void javaStateUnreachable(boolean nativeStateLive) When the Java state is released or unreachable, aMemoryContextDelete
call is made so the native memory is released without having to wait for release of its parent context.- Overrides:
javaStateUnreachable
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").
-