-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathBaseContext.java
More file actions
65 lines (56 loc) · 1.78 KB
/
Copy pathBaseContext.java
File metadata and controls
65 lines (56 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package software.amazon.lambda.durable.context;
import com.amazonaws.services.lambda.runtime.Context;
import org.slf4j.Logger;
import software.amazon.lambda.durable.DurableConfig;
import software.amazon.lambda.durable.logging.DurableLogger;
public interface BaseContext {
ThreadLocal<BaseContext> CONTEXT = new ThreadLocal<>();
/**
* Gets the current context (DurableContext or StepContext) for this thread.
*
* @return the current context or null if not set
*/
static BaseContext getCurrentContext() {
return CONTEXT.get();
}
/**
* Gets a logger with additional information of the current execution context.
*
* @return a DurableLogger instance
*/
DurableLogger getLogger();
/**
* Gets a logger with additional information of the current execution context.
*
* @param delegate the logger to wrap
* @return a DurableLogger instance
*/
DurableLogger getLogger(Logger delegate);
/**
* Returns the AWS Lambda runtime context.
*
* @return the Lambda context
*/
Context getLambdaContext();
/**
* Returns the current durable execution arn
*
* @return the execution arn
*/
String getExecutionArn();
/**
* Returns the configuration for durable execution behavior.
*
* @return the durable configuration
*/
DurableConfig getDurableConfig();
/**
* Gets the context ID for this context. Null for root context, operationId of the context operation for child
* contexts.
*/
String getContextId();
/** Gets the context name for this context. Null for root context. */
String getContextName();
}