Package com.amazonaws.serverless.proxy
Class InitializationWrapper
java.lang.Object
com.amazonaws.serverless.proxy.InitializationWrapper
- Direct Known Subclasses:
AsyncInitializationWrapper
This class is in charge of initializing a
InitializableLambdaContainerHandler.
In most cases, this means calling the InitializableLambdaContainerHandler.initialize() method. Some implementations may
require additional initialization steps, in this case implementations should provide their own
InitializationWrapper. This library includes an async implementation of this class
AsyncInitializationWrapper for frameworks that are likely to take longer than 10 seconds to start.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAsynchronous implementations of the framework should return a latch that the container handler can use to decide whether it can start handling events.voidstart(InitializableLambdaContainerHandler handler) This is the main entry point.
-
Constructor Details
-
InitializationWrapper
public InitializationWrapper()
-
-
Method Details
-
start
public void start(InitializableLambdaContainerHandler handler) throws ContainerInitializationException This is the main entry point. Container handler builder and the staticgetAwsProxyHandler()methods of the various implementations will call this to initialize the underlying framework- Parameters:
handler- The container handler to be initializer- Throws:
ContainerInitializationException- If anything goes wrong during container initialization.
-
getInitializationLatch
Asynchronous implementations of the framework should return a latch that the container handler can use to decide whether it can start handling events. Synchronous implementations of this interface should returnnull.- Returns:
- An initialized latch if the underlying container is starting in a separate thread, null otherwise.
-