Interface DurableExecutionPluginFactory
- All Known Subinterfaces:
DurableExecutionPluginProvider
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
DurableExecutionPlugin instance per Lambda invocation.
The SDK builds the InvocationInfo for an invocation, calls this factory with it, dispatches that
invocation's hooks to the returned instance, and drops the instance when the invocation returns. A plugin instance
therefore serves exactly one invocation and can hold per-invocation state in plain fields — no keying by execution
ARN is needed, even when the execution environment runs several executions concurrently.
The InvocationInfo handed to the factory is the same instance the plugin's
DurableExecutionPlugin.onInvocationStart(InvocationInfo) hook then receives.
Non-fatal factory failures are contained like non-fatal hook failures: the factory is logged and skipped for that
invocation. A null result is also logged and skipped. VirtualMachineError and ThreadDeath
propagate, including when wrapped by asynchronous completion/future exceptions.
DurableConfig.builder()
.withPlugins(info -> new MyPlugin(info.durableExecutionArn()))
.build();
-
Method Summary
Modifier and TypeMethodDescriptioncreatePlugin(InvocationInfo invocationInfo) Creates the plugin instance that serves the described invocation.default StringOptional exclusive instrumentation group, validated before any invocation instance is created.
-
Method Details
-
createPlugin
Creates the plugin instance that serves the described invocation.- Parameters:
invocationInfo- the invocation the plugin instance will observe, including its immutableruntime header snapshotbefore any plugin spans are created- Returns:
- the plugin instance for this invocation
-
getExclusiveGroup
Optional exclusive instrumentation group, validated before any invocation instance is created.
-