Package io.deephaven.engine.context
Class ExecutionContext
java.lang.Object
io.deephaven.engine.context.ExecutionContext
Container for context-specific objects, that can be activated on a thread or passed to certain operations.
ExecutionContexts are immutable, and support a builder pattern to create new instances and "with" methods to
customize existing ones. Any thread that interacts with the Deephaven engine will need to have an active
ExecutionContext.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Execute runnable within this execution context.<T> T
Executes supplier within this execution context.static ExecutionContext
static ExecutionContext
static ExecutionContext
static ExecutionContext
makeExecutionContext
(boolean isSystemic) static ExecutionContext.Builder
Creates a new builder for an ExecutionContext, capturing the current thread's auth context, update graph, and operation initializer.open()
Installs the executionContext and returns a function that will restore the original executionContext.withAuthContext
(AuthContext authContext) Returns, or creates, an execution context with the given value forauthContext
and existing values for the other members.withOperationInitializer
(OperationInitializer operationInitializer) withQueryScope
(QueryScope queryScope) Returns, or creates, an execution context with the given value forqueryScope
and existing values for the other members.withSystemic
(boolean isSystemic) Returns, or creates, an execution context with the given value forisSystemic
and existing values for the other members.withUpdateGraph
(UpdateGraph updateGraph) Returns, or creates, an execution context with the given value forupdateGraph
and existing values for the other members.
-
Method Details
-
newBuilder
Creates a new builder for an ExecutionContext, capturing the current thread's auth context, update graph, and operation initializer. Typically, this method should be called on a thread that already has an active ExecutionContext, to more easily reuse those.- Returns:
- a new builder to create an ExecutionContext
-
makeExecutionContext
-
getDefaultContext
-
getContextToRecord
- Returns:
- an object representing the current execution context or null if the current context is systemic
-
getContext
- Returns:
- an object representing the current execution context
-
withSystemic
Returns, or creates, an execution context with the given value forisSystemic
and existing values for the other members.- Parameters:
isSystemic
- if the context should be systemic- Returns:
- the execution context
-
withAuthContext
Returns, or creates, an execution context with the given value forauthContext
and existing values for the other members. This is not intended to be used by user code.- Parameters:
authContext
- the auth context to use instead; null values are ignored- Returns:
- the execution context
-
withUpdateGraph
Returns, or creates, an execution context with the given value forupdateGraph
and existing values for the other members. This is not intended to be used by user code.- Parameters:
updateGraph
- the update context to use instead- Returns:
- the execution context
-
withOperationInitializer
-
withQueryScope
Returns, or creates, an execution context with the given value forqueryScope
and existing values for the other members.- Parameters:
queryScope
- the query scope to use instead- Returns:
- the execution context
-
apply
Execute runnable within this execution context. -
apply
Executes supplier within this execution context. -
open
Installs the executionContext and returns a function that will restore the original executionContext.- Returns:
- a closeable to cleanup the execution context
-
getQueryLibrary
-
getQueryScope
-
getQueryCompiler
-
getAuthContext
-
getUpdateGraph
-
getOperationInitializer
-