Package org.postgresql.pljava.internal
Class DualState.SingleGuardedLong<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>
- Direct Known Subclasses:
DualState.SingleDeleteGlobalRefP
,DualState.SingleFreeErrorData
,DualState.SingleFreeTupleDesc
,DualState.SingleHeapFreeTuple
,DualState.SinglePfree
,DualState.SingleSPIcursorClose
,DualState.SingleSPIfreeplan
,DualState.SingleSPIfreetuptable
A
DualState
subclass serving only to guard access to a single
nonzero long
value (typically a native pointer).
Nothing in particular is done to the native resource at the time of
javaStateReleased
or javaStateUnreachable
; if it is
subject to reclamation, this class assumes it will be shortly, in the
normal operation of the native code. This can be appropriate for native
state that was set up by a native caller for a short lifetime, such as a
single function invocation.
-
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
SingleGuardedLong
(T referent, Lifespan span, long guardedLong) -
Method Summary
Modifier and TypeMethodDescriptionprotected String
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.protected final long
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, javaStateUnreachable, 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
-
SingleGuardedLong
-
-
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
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. -
guardedLong
protected final long guardedLong()
-