Package io.deephaven.engine.util
Class NoLanguageDeephavenSession
- All Implemented Interfaces:
LogOutputAppendable,LivenessManager,LivenessNode,LivenessReferent,ReleasableLivenessManager,ScriptSession,VariableProvider,Serializable
public class NoLanguageDeephavenSession
extends AbstractScriptSession<AbstractScriptSession.Snapshot>
ScriptSession implementation that simply allows variables to be exported. This is not intended for use in user
scripts.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class io.deephaven.engine.util.AbstractScriptSession
AbstractScriptSession.ScriptSessionQueryScope, AbstractScriptSession.Snapshot, AbstractScriptSession.SynchronizedScriptSessionQueryScope, AbstractScriptSession.UnsynchronizedScriptSessionQueryScopeNested classes/interfaces inherited from interface io.deephaven.engine.util.ScriptSession
ScriptSession.Changes, ScriptSession.Listener -
Field Summary
Fields inherited from class io.deephaven.engine.util.AbstractScriptSession
executionContext -
Constructor Summary
ConstructorsConstructorDescriptionNoLanguageDeephavenSession(UpdateGraph updateGraph, OperationInitializer operationInitializer) NoLanguageDeephavenSession(UpdateGraph updateGraph, OperationInitializer operationInitializer, String scriptType) -
Method Summary
Modifier and TypeMethodDescriptionprotected ScriptSession.ChangescreateDiff(AbstractScriptSession.Snapshot from, AbstractScriptSession.Snapshot to, RuntimeException e) protected AbstractScriptSession.Snapshotprotected voidEvaluates command in the context of the current ScriptSession.@NotNull ObjectgetVariable(String name) Retrieve a variable from the script session's bindings.<T> TgetVariable(String name, T defaultValue) Retrieve a variable from the script session's bindings.Retrieves all of the variable names present in the session's scopeRetrieves all of the variables present in the session's scope (e.g., Groovy binding, Python globals()).booleanhasVariableName(String name) Check if the scope has the given variable namevoidsetVariable(String name, @Nullable Object newValue) Inserts a value into the script's scope.protected AbstractScriptSession.SnapshotMethods inherited from class io.deephaven.engine.util.AbstractScriptSession
applyVariableChangeToDiff, createScriptCache, destroy, evaluateScript, evaluateScript, getExecutionContext, getTableDefinition, getVariableProvider, getVariableType, observeScopeChanges, publishInitialMethods inherited from class io.deephaven.engine.liveness.LivenessScope
release, transferToMethods 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, tryManageMethods inherited from interface io.deephaven.engine.liveness.LivenessNode
tryUnmanage, tryUnmanage, unmanage, unmanageMethods inherited from interface io.deephaven.engine.liveness.LivenessReferent
dropReference, getReferentDescription, getWeakReference, retainReference, tryRetainReferenceMethods inherited from interface io.deephaven.engine.liveness.ReleasableLivenessManager
releaseMethods inherited from interface io.deephaven.engine.util.ScriptSession
evaluateScript, sanitizeThrowable, unwrapObject
-
Constructor Details
-
NoLanguageDeephavenSession
public NoLanguageDeephavenSession(UpdateGraph updateGraph, OperationInitializer operationInitializer) -
NoLanguageDeephavenSession
public NoLanguageDeephavenSession(UpdateGraph updateGraph, OperationInitializer operationInitializer, String scriptType)
-
-
Method Details
-
newQueryScope
- Specified by:
newQueryScopein classAbstractScriptSession<AbstractScriptSession.Snapshot>- Returns:
- a query scope for this session; only invoked during construction
-
getVariable
Description copied from interface:ScriptSessionRetrieve a variable from the script session's bindings. Please useScriptSession.getVariable(String, Object)if you expect the variable may not exist.- Parameters:
name- the variable to retrieve- Returns:
- the variable
- Throws:
QueryScope.MissingVariableException- if the variable does not exist
-
getVariable
Description copied from interface:ScriptSessionRetrieve a variable from the script session's bindings. If the variable is not present, return defaultValue. If the variable is present, but is not of type (T), a ClassCastException may result.- Type Parameters:
T- the type of the variable- Parameters:
name- the variable to retrievedefaultValue- the value to use when no value is present in the session's scope- Returns:
- the value of the variable, or defaultValue if not present
-
emptySnapshot
- Specified by:
emptySnapshotin classAbstractScriptSession<AbstractScriptSession.Snapshot>
-
takeSnapshot
- Specified by:
takeSnapshotin classAbstractScriptSession<AbstractScriptSession.Snapshot>
-
createDiff
protected ScriptSession.Changes createDiff(AbstractScriptSession.Snapshot from, AbstractScriptSession.Snapshot to, RuntimeException e) - Specified by:
createDiffin classAbstractScriptSession<AbstractScriptSession.Snapshot>
-
evaluate
Description copied from class:AbstractScriptSessionEvaluates command in the context of the current ScriptSession.- Specified by:
evaluatein classAbstractScriptSession<AbstractScriptSession.Snapshot>- Parameters:
command- the command to evaluatescriptName- an optional script name, which may be ignored by the implementation, or used improve error messages or for other internal purposes
-
getVariables
Description copied from interface:ScriptSessionRetrieves all of the variables present in the session's scope (e.g., Groovy binding, Python globals()).- Returns:
- an unmodifiable map with variable names as the keys, and the Objects as the result
-
getVariableNames
Description copied from interface:ScriptSessionRetrieves all of the variable names present in the session's scope- Returns:
- an unmodifiable set of variable names
-
hasVariableName
Description copied from interface:ScriptSessionCheck if the scope has the given variable name- Parameters:
name- the variable name- Returns:
- True iff the scope has the given variable name
-
setVariable
Description copied from interface:ScriptSessionInserts a value into the script's scope.- Parameters:
name- the variable name to setnewValue- the new value of the variable
-
scriptType
- Returns:
- a textual description of this script session's language for use in messages.
-