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>
Enclosing class:
DualState<T>

public abstract static class DualState.SingleMemContextDelete<T> extends DualState<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.

  • Constructor Details

  • Method Details

    • toString

      public String toString(Object o)
      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 class DualState<T>
      Parameters:
      o - An object whose class name (abbreviated by stripping the package prefix) will be used at the start of the string. Passing null is the same as passing this.
      Returns:
      Description of this state object, prefixed with the abbreviated class name of the passed object.
    • formatString

      public String formatString()
    • memoryContext

      protected final MemoryContext memoryContext()
    • javaStateUnreachable

      protected void javaStateUnreachable(boolean nativeStateLive)
      When the Java state is released or unreachable, a MemoryContextDelete call is made so the native memory is released without having to wait for release of its parent context.
      Overrides:
      javaStateUnreachable in class DualState<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").