|
13 | 13 | package com.amazonaws.serverless.proxy; |
14 | 14 |
|
15 | 15 | import com.amazonaws.serverless.exceptions.ContainerInitializationException; |
16 | | -import com.amazonaws.serverless.proxy.internal.LambdaContainerHandler; |
| 16 | +import com.amazonaws.serverless.proxy.internal.InitializableLambdaContainerHandler; |
17 | 17 | import com.amazonaws.services.lambda.runtime.Context; |
18 | 18 | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; |
19 | 19 | import org.slf4j.Logger; |
|
26 | 26 |
|
27 | 27 | /** |
28 | 28 | * An async implementation of the <code>InitializationWrapper</code> interface. This initializer calls the |
29 | | - * {@link LambdaContainerHandler#initialize()} in a separate thread. Then uses a latch to wait for the maximum Lambda |
| 29 | + * {@link InitializableLambdaContainerHandler#initialize()} in a separate thread. Then uses a latch to wait for the maximum Lambda |
30 | 30 | * initialization time of 10 seconds, if the <code>initialize</code> method takes longer than 10 seconds to return, the |
31 | | - * {@link #start(LambdaContainerHandler)} returns control to the caller and lets the initialization thread continue in |
32 | | - * the background. The {@link LambdaContainerHandler#proxy(Object, Context)} automatically waits for the latch of the |
| 31 | + * {@link #start(InitializableLambdaContainerHandler)} returns control to the caller and lets the initialization thread continue in |
| 32 | + * the background. The {@link com.amazonaws.serverless.proxy.internal.LambdaContainerHandler#proxy(Object, Context)} automatically waits for the latch of the |
33 | 33 | * initializer to be released. |
34 | 34 | * |
35 | 35 | * The constructor of this class expects an epoch long. This is meant to be as close as possible to the time the Lambda |
@@ -72,7 +72,7 @@ public AsyncInitializationWrapper() { |
72 | 72 | } |
73 | 73 |
|
74 | 74 | @Override |
75 | | - public void start(LambdaContainerHandler handler) throws ContainerInitializationException { |
| 75 | + public void start(InitializableLambdaContainerHandler handler) throws ContainerInitializationException { |
76 | 76 | if(ASYNC_INIT_DISABLED){ |
77 | 77 | log.info("Async init disabled due to \"{}\" initialization", INITIALIZATION_TYPE); |
78 | 78 | super.start(handler); |
@@ -107,18 +107,18 @@ public long getActualStartTimeMs() { |
107 | 107 |
|
108 | 108 | @Override |
109 | 109 | public CountDownLatch getInitializationLatch() { |
110 | | - if(ASYNC_INIT_DISABLED){ |
| 110 | + if (ASYNC_INIT_DISABLED){ |
111 | 111 | return super.getInitializationLatch(); |
112 | 112 | } |
113 | 113 | return initializationLatch; |
114 | 114 | } |
115 | 115 |
|
116 | 116 | private static class AsyncInitializer implements Runnable { |
117 | | - private LambdaContainerHandler handler; |
| 117 | + private final InitializableLambdaContainerHandler handler; |
118 | 118 | private CountDownLatch initLatch; |
119 | 119 | private Logger log = LoggerFactory.getLogger(AsyncInitializationWrapper.class); |
120 | 120 |
|
121 | | - AsyncInitializer(CountDownLatch latch, LambdaContainerHandler h) { |
| 121 | + AsyncInitializer(CountDownLatch latch, InitializableLambdaContainerHandler h) { |
122 | 122 | initLatch = latch; |
123 | 123 | handler = h; |
124 | 124 | } |
|
0 commit comments