Class BaseContextImpl
java.lang.Object
software.amazon.lambda.durable.context.BaseContextImpl
- All Implemented Interfaces:
BaseContext
- Direct Known Subclasses:
DurableContextImpl,StepContextImpl
-
Field Summary
Fields inherited from interface software.amazon.lambda.durable.context.BaseContext
CONTEXT -
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.Returns a durable logger for this context.getLogger(org.slf4j.Logger delegate) Returns a durable logger for this context.static voidsetCurrentContext(BaseContext context)
-
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
-
getLogger
Returns a durable logger for this context.- Specified by:
getLoggerin interfaceBaseContext- Returns:
- a DurableLogger instance
-
getLogger
Returns a durable logger for this context.- Specified by:
getLoggerin interfaceBaseContext- Parameters:
delegate- the logger to wrap- Returns:
- a DurableLogger instance
-
setCurrentContext
-