Class BaseContext

java.lang.Object
software.amazon.lambda.durable.BaseContext
All Implemented Interfaces:
AutoCloseable
Direct Known Subclasses:
DurableContext, StepContext

public abstract class BaseContext extends Object implements AutoCloseable
  • 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

      public abstract DurableLogger 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

      public ExecutionContext 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

      public DurableConfig getDurableConfig()
      Returns the configuration for durable execution behavior.
      Returns:
      the durable configuration
    • getContextId

      public String getContextId()
      Gets the context ID for this context. Null for root context, set for child contexts.
    • getContextName

      public String getContextName()
    • getExecutionManager

      public ExecutionManager getExecutionManager()
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable