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.SingleFreeErrorData,DualState.SingleFreeTupleDesc,DualState.SingleHeapFreeTuple,DualState.SingleMemContextDelete,DualState.SinglePfree,DualState.SingleSPIcursorClose,DualState.SingleSPIfreeplan
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.Key, DualState.SingleFreeErrorData<T>, DualState.SingleFreeTupleDesc<T>, DualState.SingleGuardedLong<T>, DualState.SingleHeapFreeTuple<T>, DualState.SingleMemContextDelete<T>, DualState.SinglePfree<T>, DualState.SingleSPIcursorClose<T>, DualState.SingleSPIfreeplan<T> -
Field Summary
Fields inherited from class org.postgresql.pljava.internal.DualState
m_resourceOwner -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSingleGuardedLong(DualState.Key cookie, T referent, long resourceOwner, long guardedLong) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringReturn aprintfformat string resembling"%s something(%x)"where the%xwill 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 longProduce 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, checkCookie, clear, enqueue, get, identifierForMessage, invalidMessage, invalidSqlState, javaStateReleased, javaStateUnreachable, lock, nativeStateReleased, pin, pinnedByCurrentThread, pinUnlessReleased, referent, releasedMessage, releasedSqlState, releaseFromJava, toString, unlock, unlock, unpinMethods inherited from class java.lang.ref.Reference
clone, isEnqueued, reachabilityFence, refersTo
-
Constructor Details
-
SingleGuardedLong
-
-
Method Details
-
toString
Description copied from class:DualStateProduce 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:
toStringin classDualState<T>- Parameters:
o- An object whose class name (abbreviated by stripping the package prefix) will be used at the start of the string. Passingnullis the same as passingthis.- Returns:
- Description of this state object, prefixed with the abbreviated class name of the passed object.
-
formatString
Return aprintfformat string resembling"%s something(%x)"where the%xwill 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()
-