Class InitializationWrapper

java.lang.Object
com.amazonaws.serverless.proxy.InitializationWrapper
Direct Known Subclasses:
AsyncInitializationWrapper

public class InitializationWrapper extends Object
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 Details

    • InitializationWrapper

      public InitializationWrapper()
  • Method Details

    • start

      This is the main entry point. Container handler builder and the static getAwsProxyHandler() 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

      public CountDownLatch 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 return null.
      Returns:
      An initialized latch if the underlying container is starting in a separate thread, null otherwise.