java.lang.Object
java.lang.ref.Reference<String>
java.lang.ref.WeakReference<String>
org.postgresql.pljava.internal.DualState<String>
org.postgresql.pljava.internal.DualState.ListHead
org.postgresql.pljava.internal.LifespanImpl
- All Implemented Interfaces:
Lifespan
- Direct Known Subclasses:
Invocation
,MemoryContextImpl
,ResourceOwnerImpl
Implements PL/Java's generalized notion of lifespans.
Subclasses are likely to maintain cache mappings from addresses of PostgreSQL
native objects to instances. Such mappings must hold strong references to the
instances, because any LifespanImpl
instance can serve as the
head of a list of DualState
objects, which are
Reference
instances, and the Java runtime will cease
tracking those if they themselves are not kept strongly reachable. This
requirement is acceptable, because all instances represent bounded lifespans
that end with explicit invalidation and decaching; that's what they're for,
after all.
-
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
-
Method Summary
Modifier and TypeMethodDescriptiontoString()
Produce a string describing this state object in a way useful for debugging, with such information as the associatedLifespan
and whether the state is fresh or stale.Overrides the version provided byDualState
to simply call the niladictoString
, as a resource owner isn't directly associated with another object the way aDualState
instance generally is.Methods inherited from class org.postgresql.pljava.internal.DualState.ListHead
lifespanRelease
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, unlessReleased, unlock, unlock, unpin
Methods inherited from class java.lang.ref.Reference
clone, isEnqueued, reachabilityFence, refersTo
-
Constructor Details
-
LifespanImpl
public LifespanImpl()
-
-
Method Details
-
toString
Overrides the version provided byDualState
to simply call the niladictoString
, as a resource owner isn't directly associated with another object the way aDualState
instance generally is.- Overrides:
toString
in classDualState<String>
- 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.
-
toString
Description copied from class:DualState
Produce a string describing this state object in a way useful for debugging, with such information as the associatedLifespan
and whether the state is fresh or stale.This method calls
DualState.toString(Object)
passingthis
. Subclasses are encouraged to override that method with versions that add subclass-specific details.
-