Package io.deephaven.engine.util
Interface ScriptSession
- All Superinterfaces:
LivenessManager
,LivenessNode
,LivenessReferent
- All Known Implementing Classes:
AbstractScriptSession
,DelegatingScriptSession
,GroovyDeephavenSession
,NoLanguageDeephavenSession
,PythonDeephavenSession
Interface for interactive console script sessions.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
static interface
-
Method Summary
Modifier and TypeMethodDescriptiondefault ScriptSession.Changes
evaluateScript
(String script) Evaluates the script and manages liveness of objects that are exported to the user.evaluateScript
(String script, @Nullable String scriptName) Evaluates the script and manages liveness of objects that are exported to the user.evaluateScript
(Path scriptPath) Evaluates the script and manages liveness of objects that are exported to the user.Obtain anExecutionContext
instance for the current script session.Provides access to the query scope defined by the state in this script session.void
Observe (and report viaonScopeChanges
) any changes to this ScriptSession'sQueryScope
that may have been made externally, rather than duringscript evaluation
.default Throwable
If this script session can throw unserializable exceptions, this method is responsible for turning those exceptions into something suitable for sending back to a client.default Object
unwrapObject
(@Nullable Object object) Asks the session to remove any wrapping that exists on scoped objects so that clients can fetch them.Methods inherited from interface io.deephaven.engine.liveness.LivenessManager
manage, tryManage
Methods inherited from interface io.deephaven.engine.liveness.LivenessNode
tryUnmanage, tryUnmanage, unmanage, unmanage
Methods inherited from interface io.deephaven.engine.liveness.LivenessReferent
dropReference, getReferentDescription, getWeakReference, retainReference, tryRetainReference
-
Method Details
-
getQueryScope
QueryScope getQueryScope()Provides access to the query scope defined by the state in this script session.- Returns:
- an implementation defined QueryScope, allowing access to state in the script session
-
getExecutionContext
ExecutionContext getExecutionContext()Obtain anExecutionContext
instance for the current script session. This is the execution context that is used when executing scripts. -
observeScopeChanges
void observeScopeChanges()Observe (and report viaonScopeChanges
) any changes to this ScriptSession'sQueryScope
that may have been made externally, rather than duringscript evaluation
.- ApiNote:
- This method should be regarded as an unstable API
-
evaluateScript
Evaluates the script and manages liveness of objects that are exported to the user. This method should be called from the serial executor as it manipulates static state.- Parameters:
script
- the code to execute- Returns:
- the changes made to the exportable objects
-
evaluateScript
Evaluates the script and manages liveness of objects that are exported to the user. This method should be called from the serial executor as it manipulates static state.- Parameters:
script
- the code to executescriptName
- an optional script name, which may be ignored by the implementation, or used improve error messages or for other internal purposes- Returns:
- the changes made to the exportable objects
-
evaluateScript
Evaluates the script and manages liveness of objects that are exported to the user. This method should be called from the serial executor as it manipulates static state.- Parameters:
scriptPath
- the path to the script to execute- Returns:
- the changes made to the exportable objects
-
scriptType
String scriptType()- Returns:
- a textual description of this script session's language for use in messages.
-
sanitizeThrowable
If this script session can throw unserializable exceptions, this method is responsible for turning those exceptions into something suitable for sending back to a client.- Parameters:
e
- the exception to (possibly) sanitize- Returns:
- the sanitized exception
-
unwrapObject
Asks the session to remove any wrapping that exists on scoped objects so that clients can fetch them. Defaults to returning the object itself.- Parameters:
object
- the scoped object- Returns:
- an obj which can be consumed by a client
-