All Implemented Interfaces:
Lifespan
Direct Known Subclasses:
Invocation, MemoryContextImpl, ResourceOwnerImpl

public class LifespanImpl extends DualState.ListHead implements Lifespan
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.

  • Constructor Details

    • LifespanImpl

      public LifespanImpl()
  • Method Details

    • toString

      public String toString(Object o)
      Overrides the version provided by DualState to simply call the niladic toString, as a resource owner isn't directly associated with another object the way a DualState instance generally is.
      Overrides:
      toString in class DualState<String>
      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.
    • toString

      public String toString()
      Description copied from class: DualState
      Produce a string describing this state object in a way useful for debugging, with such information as the associated Lifespan and whether the state is fresh or stale.

      This method calls DualState.toString(Object) passing this. Subclasses are encouraged to override that method with versions that add subclass-specific details.

      Overrides:
      toString in class DualState<String>
      Returns:
      Description of this state object.