Class BaseContextImpl

java.lang.Object
software.amazon.lambda.durable.context.BaseContextImpl
All Implemented Interfaces:
AutoCloseable, BaseContext
Direct Known Subclasses:
DurableContextImpl, StepContextImpl

public abstract class BaseContextImpl extends Object implements AutoCloseable, BaseContext
  • 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 management
      durableConfig - the durable execution configuration
      lambdaContext - the AWS Lambda runtime context
      contextId - the context ID, null for root context, set for child contexts
      contextName - the human-readable name for this context
      threadType - 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:
      getLambdaContext in interface BaseContext
      Returns:
      the Lambda context
    • getExecutionArn

      public String 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:
      getExecutionArn in interface BaseContext
      Returns:
      the execution context
    • getDurableConfig

      public DurableConfig getDurableConfig()
      Returns the configuration for durable execution behavior.
      Specified by:
      getDurableConfig in interface BaseContext
      Returns:
      the durable configuration
    • getContextId

      public String getContextId()
      Gets the context ID for this context. Null for root context, set for child contexts.
      Specified by:
      getContextId in interface BaseContext
    • getContextName

      public String getContextName()
      Gets the context name for this context. Null for root context.
      Specified by:
      getContextName in interface BaseContext
    • getExecutionManager

      public ExecutionManager getExecutionManager()
    • isReplaying

      public boolean isReplaying()
      Returns whether this context is currently in replay mode.
      Specified by:
      isReplaying in interface BaseContext
    • setExecutionMode

      public void setExecutionMode()
      Transitions this context from replay to execution mode. Called when the first un-cached operation is encountered.