RequestType - The incoming event typeResponseType - The expected return typepublic class SpringBootLambdaContainerHandler<RequestType,ResponseType> extends AwsLambdaServletContainerHandler<RequestType,ResponseType,AwsProxyHttpServletRequest,AwsHttpServletResponse>
LambdaFlushResponseListener in your SpringBootServletInitializer subclass configure().AwsLambdaServletContainerHandler.StartupHandlerservletContext, startupHandlerlambdaContext, SERVER_INFO| Constructor and Description |
|---|
SpringBootLambdaContainerHandler(java.lang.Class<RequestType> requestTypeClass,
java.lang.Class<ResponseType> responseTypeClass,
RequestReader<RequestType,AwsProxyHttpServletRequest> requestReader,
ResponseWriter<AwsHttpServletResponse,ResponseType> responseWriter,
SecurityContextWriter<RequestType> securityContextWriter,
ExceptionHandler<ResponseType> exceptionHandler,
java.lang.Class<?> springBootInitializer,
InitializationWrapper init)
Creates a new container handler with the given reader and writer objects
|
| Modifier and Type | Method and Description |
|---|---|
void |
activateSpringProfiles(java.lang.String... profiles) |
static SpringBootLambdaContainerHandler<AwsProxyRequest,AwsProxyResponse> |
getAwsProxyHandler(java.lang.Class<?> springBootInitializer,
java.lang.String... profiles)
Creates a default SpringLambdaContainerHandler initialized with the `AwsProxyRequest` and `AwsProxyResponse` objects and the given Spring profiles
|
protected AwsHttpServletResponse |
getContainerResponse(AwsProxyHttpServletRequest request,
java.util.concurrent.CountDownLatch latch) |
static SpringBootLambdaContainerHandler |
getInstance()
We need to rely on the static instance of this for SpringBoot because we need it to access the ServletContext.
|
protected void |
handleRequest(AwsProxyHttpServletRequest containerRequest,
AwsHttpServletResponse containerResponse,
com.amazonaws.services.lambda.runtime.Context lambdaContext) |
void |
initialize() |
doFilter, getFilterChain, getServletContext, onStartup, setServletContextgetContainerConfig, getInitializationWrapper, getObjectMapper, proxy, proxyStream, setInitializationWrapper, setLogFormatter, stripBasePathpublic SpringBootLambdaContainerHandler(java.lang.Class<RequestType> requestTypeClass, java.lang.Class<ResponseType> responseTypeClass, RequestReader<RequestType,AwsProxyHttpServletRequest> requestReader, ResponseWriter<AwsHttpServletResponse,ResponseType> responseWriter, SecurityContextWriter<RequestType> securityContextWriter, ExceptionHandler<ResponseType> exceptionHandler, java.lang.Class<?> springBootInitializer, InitializationWrapper init)
requestTypeClass - The class for the incoming Lambda eventresponseTypeClass - The class for the Lambda function outputrequestReader - An implementation of `RequestReader`responseWriter - An implementation of `ResponseWriter`securityContextWriter - An implementation of `SecurityContextWriter`exceptionHandler - An implementation of `ExceptionHandler`springBootInitializer - SpringBootServletInitializer classinit - The initialization Wrapper that will be used to start Spring Bootpublic static SpringBootLambdaContainerHandler getInstance()
SpringApplication.run()
method. However, in our case we need to rely on the pre-initialized handler and need to fetch information from it
for our mock ServerlessReactiveServletEmbeddedServerFactory.public static SpringBootLambdaContainerHandler<AwsProxyRequest,AwsProxyResponse> getAwsProxyHandler(java.lang.Class<?> springBootInitializer, java.lang.String... profiles) throws ContainerInitializationException
springBootInitializer - SpringBootServletInitializer classprofiles - A list of Spring profiles to activateContainerInitializationException - If an error occurs while initializing the Spring frameworkpublic void activateSpringProfiles(java.lang.String... profiles)
protected AwsHttpServletResponse getContainerResponse(AwsProxyHttpServletRequest request, java.util.concurrent.CountDownLatch latch)
getContainerResponse in class LambdaContainerHandler<RequestType,ResponseType,AwsProxyHttpServletRequest,AwsHttpServletResponse>protected void handleRequest(AwsProxyHttpServletRequest containerRequest, AwsHttpServletResponse containerResponse, com.amazonaws.services.lambda.runtime.Context lambdaContext) throws java.lang.Exception
handleRequest in class LambdaContainerHandler<RequestType,ResponseType,AwsProxyHttpServletRequest,AwsHttpServletResponse>java.lang.Exceptionpublic void initialize()
throws ContainerInitializationException
initialize in class LambdaContainerHandler<RequestType,ResponseType,AwsProxyHttpServletRequest,AwsHttpServletResponse>ContainerInitializationExceptionCopyright © 2019. All Rights Reserved.