Class BaseContextImpl
java.lang.Object
software.amazon.lambda.durable.context.BaseContextImpl
- All Implemented Interfaces:
AutoCloseable,BaseContext
- Direct Known Subclasses:
DurableContextImpl,StepContextImpl
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseContextImpl(ExecutionManager executionManager, DurableConfig durableConfig, com.amazonaws.services.lambda.runtime.Context lambdaContext, String contextId, String contextName, ThreadType threadType) Creates a new BaseContext instance. -
Method Summary
Modifier and TypeMethodDescriptionGets the context ID for this context.Gets the context name for this context.Returns the configuration for durable execution behavior.Returns metadata about the current durable execution.com.amazonaws.services.lambda.runtime.ContextReturns the AWS Lambda runtime context.booleanReturns whether this context is currently in replay mode.voidTransitions this context from replay to execution mode.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.lambda.durable.context.BaseContext
close, getLogger
-
Constructor Details
-
BaseContextImpl
protected BaseContextImpl(ExecutionManager executionManager, DurableConfig durableConfig, com.amazonaws.services.lambda.runtime.Context lambdaContext, String contextId, String contextName, ThreadType threadType) Creates a new BaseContext instance.- Parameters:
executionManager- the execution manager for thread coordination and state managementdurableConfig- the durable execution configurationlambdaContext- the AWS Lambda runtime contextcontextId- the context ID, null for root context, set for child contextscontextName- the human-readable name for this contextthreadType- the type of thread this context runs on
-
-
Method Details
-
getLambdaContext
public com.amazonaws.services.lambda.runtime.Context getLambdaContext()Returns the AWS Lambda runtime context.- Specified by:
getLambdaContextin interfaceBaseContext- Returns:
- the Lambda context
-
getExecutionArn
Returns metadata about the current durable execution.The execution context provides information that remains constant throughout the execution lifecycle, such as the durable execution ARN. This is useful for tracking execution progress, correlating logs, and referencing this execution in external systems.
- Specified by:
getExecutionArnin interfaceBaseContext- Returns:
- the execution context
-
getDurableConfig
Returns the configuration for durable execution behavior.- Specified by:
getDurableConfigin interfaceBaseContext- Returns:
- the durable configuration
-
getContextId
Gets the context ID for this context. Null for root context, set for child contexts.- Specified by:
getContextIdin interfaceBaseContext
-
getContextName
Gets the context name for this context. Null for root context.- Specified by:
getContextNamein interfaceBaseContext
-
getExecutionManager
-
isReplaying
public boolean isReplaying()Returns whether this context is currently in replay mode.- Specified by:
isReplayingin interfaceBaseContext
-
setExecutionMode
public void setExecutionMode()Transitions this context from replay to execution mode. Called when the first un-cached operation is encountered.
-