Package software.amazon.lambda.durable
Class BaseContext
java.lang.Object
software.amazon.lambda.durable.BaseContext
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
DurableContext,StepContext
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseContext(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 TypeMethodDescriptionvoidclose()Gets the context ID 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.abstract DurableLoggerGets a logger with additional information of the current execution context.
-
Constructor Details
-
BaseContext
protected BaseContext(ExecutionManager executionManager, DurableConfig durableConfig, com.amazonaws.services.lambda.runtime.Context lambdaContext, String contextId, String contextName, ThreadType threadType) Creates a new BaseContext instance.
-
-
Method Details
-
getLogger
Gets a logger with additional information of the current execution context.- Returns:
- a DurableLogger instance
-
getLambdaContext
public com.amazonaws.services.lambda.runtime.Context getLambdaContext()Returns the AWS Lambda runtime context.- Returns:
- the Lambda context
-
getExecutionContext
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.
- Returns:
- the execution context
-
getDurableConfig
Returns the configuration for durable execution behavior.- Returns:
- the durable configuration
-
getContextId
Gets the context ID for this context. Null for root context, set for child contexts. -
getContextName
-
getExecutionManager
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-