Class LivePyObjectWrapper

java.lang.Object
io.deephaven.util.referencecounting.ReferenceCounted
io.deephaven.engine.liveness.ReferenceCountedLivenessReferent
io.deephaven.server.plugin.python.LivePyObjectWrapper
All Implemented Interfaces:
io.deephaven.base.log.LogOutputAppendable, io.deephaven.engine.liveness.LivenessReferent

public final class LivePyObjectWrapper extends io.deephaven.engine.liveness.ReferenceCountedLivenessReferent
Provides a mapping between Python refcount and Deephaven's liveness mechanism, allowing liveness scopes to manage the single strong reference that the PyObject instance represents. This way, as long as PyObjectRefCountedNode instances are managed correctly by their parent scope, the PyObject strong reference will be correctly released when the object is no longer used.

This class is experimental, and may be changed or moved in a future release to a new package.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    LivePyObjectWrapper(@NotNull org.jpy.PyObject pythonObject)
    Constructs a PyObjectRefCountedNode instance by wrapping a PyObject.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    boolean
     
    org.jpy.PyObject
    Returns the PyObject instance tracked by this object.
    int
     

    Methods inherited from class io.deephaven.engine.liveness.ReferenceCountedLivenessReferent

    dropReference, getWeakReference, onReferenceCountAtZero, tryRetainReference

    Methods inherited from class io.deephaven.util.referencecounting.ReferenceCounted

    append, decrementReferenceCount, forceReferenceCountToZero, getReferenceCountDebug, incrementReferenceCount, resetReferenceCount, toString, tryDecrementReferenceCount, tryIncrementReferenceCount

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface io.deephaven.engine.liveness.LivenessReferent

    getReferentDescription, retainReference
  • Constructor Details

    • LivePyObjectWrapper

      @ScriptApi public LivePyObjectWrapper(@NotNull @NotNull org.jpy.PyObject pythonObject)
      Constructs a PyObjectRefCountedNode instance by wrapping a PyObject. The caller should ensure that an appropriate liveness scope is open to retain this instance.
  • Method Details

    • destroy

      @OverridingMethodsMustInvokeSuper protected void destroy()
      Overrides:
      destroy in class io.deephaven.engine.liveness.ReferenceCountedLivenessReferent
    • getPythonObject

      @ScriptApi public org.jpy.PyObject getPythonObject()
      Returns the PyObject instance tracked by this object.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object