Class StepContextImpl

java.lang.Object
software.amazon.lambda.durable.context.BaseContextImpl
software.amazon.lambda.durable.context.StepContextImpl
All Implemented Interfaces:
AutoCloseable, BaseContext, StepContext

public class StepContextImpl extends BaseContextImpl implements StepContext
Context available inside a step operation's user function.

Provides access to the current retry attempt number and a logger that includes execution metadata. Extends BaseContext for thread lifecycle management.

  • Constructor Details

    • StepContextImpl

      protected StepContextImpl(ExecutionManager executionManager, DurableConfig durableConfig, com.amazonaws.services.lambda.runtime.Context lambdaContext, String stepOperationId, String stepOperationName, int attempt)
      Creates a new StepContext instance for use in step operations.
      Parameters:
      executionManager - Manages durable execution state and operations
      durableConfig - Configuration for durable execution behavior
      lambdaContext - AWS Lambda runtime context
      stepOperationId - Unique identifier for this context instance that equals to step operation id
      stepOperationName - the name of the step operation
      attempt - the current retry attempt number (0-based)
  • Method Details

    • getAttempt

      public int getAttempt()
      Returns the current retry attempt number (0-based).
      Specified by:
      getAttempt in interface StepContext
    • getLogger

      public DurableLogger getLogger()
      Description copied from interface: BaseContext
      Gets a logger with additional information of the current execution context.
      Specified by:
      getLogger in interface BaseContext
      Returns:
      a DurableLogger instance
    • close

      public void close()
      Closes the logger for this context.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface BaseContext