Class StepContextImpl
java.lang.Object
software.amazon.lambda.durable.context.BaseContextImpl
software.amazon.lambda.durable.context.StepContextImpl
- All Implemented Interfaces:
BaseContext,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.
-
Field Summary
Fields inherited from interface software.amazon.lambda.durable.context.BaseContext
CONTEXT -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedStepContextImpl(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. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the current retry attempt number (0-based).Methods inherited from class software.amazon.lambda.durable.context.BaseContextImpl
getContextId, getContextName, getDurableConfig, getExecutionArn, getExecutionManager, getLambdaContext, getLogger, getLogger, isReplaying, setCurrentContext, setExecutionModeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.lambda.durable.context.BaseContext
getContextId, getContextName, getDurableConfig, getExecutionArn, getLambdaContext, getLogger, getLogger, isReplaying
-
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 operationsdurableConfig- Configuration for durable execution behaviorlambdaContext- AWS Lambda runtime contextstepOperationId- Unique identifier for this context instance that equals to step operation idstepOperationName- the name of the step operationattempt- the current retry attempt number (0-based)
-
-
Method Details
-
getAttempt
public int getAttempt()Returns the current retry attempt number (0-based).- Specified by:
getAttemptin interfaceStepContext
-