Package io.deephaven.server.session
Class SessionState.ExportObject<T>
java.lang.Object
io.deephaven.util.referencecounting.ReferenceCounted
io.deephaven.engine.liveness.ReferenceCountedLivenessReferent
io.deephaven.engine.liveness.ReferenceCountedLivenessNode
io.deephaven.engine.liveness.LivenessArtifact
io.deephaven.server.session.SessionState.ExportObject<T>
- Type Parameters:
T- Is context-sensitive depending on the export.
- All Implemented Interfaces:
LogOutputAppendable,LivenessManager,LivenessNode,LivenessReferent,Serializable
- Enclosing class:
- SessionState
This class represents one unit of content exported in the session.
Note: we reuse ExportObject for non-exporting tasks that have export dependencies.
- See Also:
- ApiNote:
- ExportId may be 0, if this is a task that has exported dependencies, but does not export anything itself. Non-exports do not publish state changes.
-
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()Releases this export; it will cancel the work and dependent exports proactively when possible.protected voiddestroy()Attempt to release (destructively when necessary) resources held by this object.get()WARNING! This method call is only safe to use in the following patterns:intgetState()booleanvoidrelease()Releases this export; it will wait for the work to complete before releasing.Methods inherited from class io.deephaven.engine.liveness.LivenessArtifact
manageWithCurrentScopeMethods inherited from class io.deephaven.engine.liveness.ReferenceCountedLivenessNode
getWeakReference, initializeTransientFieldsForLiveness, onReferenceCountAtZero, tryManage, tryUnmanage, tryUnmanageMethods inherited from class io.deephaven.engine.liveness.ReferenceCountedLivenessReferent
dropReference, 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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.deephaven.engine.liveness.LivenessManager
manage, unmanage, unmanageMethods inherited from interface io.deephaven.engine.liveness.LivenessReferent
dropReference, getReferentDescription, retainReference, tryRetainReference
-
Method Details
-
isNonExport
public boolean isNonExport()- Returns:
- if this export is a session-less non-export
-
get
WARNING! This method call is only safe to use in the following patterns:1) If an export (or non-export)
SessionState.ExportBuilder.require(io.deephaven.server.session.SessionState.ExportObject<?>...)'d this export then the method is valid from within the Callable/Runnable passed toSessionState.ExportBuilder.submit(java.util.concurrent.Callable<T>).2) By first obtaining a reference to the
SessionState.ExportObject, and then observing its state asExportNotification.State.EXPORTED. The caller must abide by the Liveness API and dropReference.Example:
<T> T getFromExport(ExportObject<T> export) { if (export.tryRetainReference()) { try { if (export.getState() == ExportNotification.State.EXPORTED) { return export.get(); } } finally { export.dropReference(); } } return null; }- Returns:
- the result of the computed export
-
getState
- Returns:
- the current state of this export
-
getExportId
- Returns:
- the ticket for this export; note if this is a non-export the returned ticket will not resolve to anything and is considered an invalid ticket
-
getExportIdInt
public int getExportIdInt()- Returns:
- the export id for this export
-
release
public void release()Releases this export; it will wait for the work to complete before releasing. -
cancel
public void cancel()Releases this export; it will cancel the work and dependent exports proactively when possible. -
destroy
@OverridingMethodsMustInvokeSuper protected void destroy()Description copied from class:ReferenceCountedLivenessReferentAttempt to release (destructively when necessary) resources held by this object. This may render the object unusable for subsequent operations. Implementations should be sure to call super.destroy().This is intended to only ever be used as a side effect of decreasing the reference count to 0.
- Overrides:
destroyin classReferenceCountedLivenessReferent
-