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
ConstructorsConstructorDescriptionLivePyObjectWrapper(@NotNull org.jpy.PyObject pythonObject) Constructs a PyObjectRefCountedNode instance by wrapping a PyObject. -
Method Summary
Methods inherited from class io.deephaven.engine.liveness.ReferenceCountedLivenessReferent
dropReference, getWeakReference, onReferenceCountAtZero, tryRetainReferenceMethods inherited from class io.deephaven.util.referencecounting.ReferenceCounted
append, decrementReferenceCount, forceReferenceCountToZero, getReferenceCountDebug, incrementReferenceCount, resetReferenceCount, toString, tryDecrementReferenceCount, tryIncrementReferenceCountMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:
destroyin classio.deephaven.engine.liveness.ReferenceCountedLivenessReferent
-
getPythonObject
@ScriptApi public org.jpy.PyObject getPythonObject()Returns the PyObject instance tracked by this object. -
equals
-
hashCode
public int hashCode()
-