RequestType - The incoming event typeResponseType - The expected return typeaws-serverless-java-container-springboot2 module.@Deprecated public class SpringBootLambdaContainerHandler<RequestType,ResponseType> extends AwsLambdaServletContainerHandler<RequestType,ResponseType,javax.servlet.http.HttpServletRequest,AwsHttpServletResponse>
LambdaFlushResponseListener in your SpringBootServletInitializer subclass configure().AwsLambdaServletContainerHandler.StartupHandlerservletContext, startupHandlerlambdaContext, SERVER_INFO| Constructor and Description |
|---|
SpringBootLambdaContainerHandler(Class<RequestType> requestTypeClass,
Class<ResponseType> responseTypeClass,
RequestReader<RequestType,javax.servlet.http.HttpServletRequest> requestReader,
ResponseWriter<AwsHttpServletResponse,ResponseType> responseWriter,
SecurityContextWriter<RequestType> securityContextWriter,
ExceptionHandler<ResponseType> exceptionHandler,
Class<? extends org.springframework.web.WebApplicationInitializer> springBootInitializer,
InitializationWrapper init)
Deprecated.
Creates a new container handler with the given reader and writer objects
|
| Modifier and Type | Method and Description |
|---|---|
void |
activateSpringProfiles(String... profiles)
Deprecated.
|
static SpringBootLambdaContainerHandler<AwsProxyRequest,AwsProxyResponse> |
getAwsProxyHandler(Class<? extends org.springframework.web.WebApplicationInitializer> springBootInitializer,
String... profiles)
Deprecated.
Creates a default SpringLambdaContainerHandler initialized with the `AwsProxyRequest` and `AwsProxyResponse` objects and the given Spring profiles
|
protected AwsHttpServletResponse |
getContainerResponse(javax.servlet.http.HttpServletRequest request,
CountDownLatch latch)
Deprecated.
|
static SpringBootLambdaContainerHandler<HttpApiV2ProxyRequest,AwsProxyResponse> |
getHttpApiV2ProxyHandler(Class<? extends org.springframework.web.WebApplicationInitializer> springBootInitializer,
String... profiles)
Deprecated.
Creates a default SpringLambdaContainerHandler initialized with the `HttpApiV2ProxyRequest` and `AwsProxyResponse` objects and the given Spring profiles
|
static SpringBootLambdaContainerHandler |
getInstance()
Deprecated.
We need to rely on the static instance of this for SpringBoot because we need it to access the ServletContext.
|
protected void |
handleRequest(javax.servlet.http.HttpServletRequest containerRequest,
AwsHttpServletResponse containerResponse,
com.amazonaws.services.lambda.runtime.Context lambdaContext)
Deprecated.
|
void |
initialize()
Deprecated.
|
doFilter, getFilterChain, getServletContext, onStartup, setServletContextgetContainerConfig, getInitializationWrapper, getObjectMapper, proxy, proxyStream, setInitializationWrapper, setLogFormatter, stripBasePathpublic SpringBootLambdaContainerHandler(Class<RequestType> requestTypeClass, Class<ResponseType> responseTypeClass, RequestReader<RequestType,javax.servlet.http.HttpServletRequest> requestReader, ResponseWriter<AwsHttpServletResponse,ResponseType> responseWriter, SecurityContextWriter<RequestType> securityContextWriter, ExceptionHandler<ResponseType> exceptionHandler, Class<? extends org.springframework.web.WebApplicationInitializer> springBootInitializer, InitializationWrapper init) throws ContainerInitializationException
requestTypeClass - The class for the incoming Lambda eventrequestReader - An implementation of `RequestReader`responseWriter - An implementation of `ResponseWriter`securityContextWriter - An implementation of `SecurityContextWriter`exceptionHandler - An implementation of `ExceptionHandler`springBootInitializer - SpringBootServletInitializer classContainerInitializationException - If an error occurs while initializing the Spring frameworkpublic 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 ServerlessServletEmbeddedServerFactory.public static SpringBootLambdaContainerHandler<AwsProxyRequest,AwsProxyResponse> getAwsProxyHandler(Class<? extends org.springframework.web.WebApplicationInitializer> springBootInitializer, String... profiles) throws ContainerInitializationException
springBootInitializer - SpringBootServletInitializer classprofiles - A list of Spring profiles to activateContainerInitializationException - If an error occurs while initializing the Spring frameworkpublic static SpringBootLambdaContainerHandler<HttpApiV2ProxyRequest,AwsProxyResponse> getHttpApiV2ProxyHandler(Class<? extends org.springframework.web.WebApplicationInitializer> springBootInitializer, 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(String... profiles)
protected AwsHttpServletResponse getContainerResponse(javax.servlet.http.HttpServletRequest request, CountDownLatch latch)
getContainerResponse in class LambdaContainerHandler<RequestType,ResponseType,javax.servlet.http.HttpServletRequest,AwsHttpServletResponse>protected void handleRequest(javax.servlet.http.HttpServletRequest containerRequest,
AwsHttpServletResponse containerResponse,
com.amazonaws.services.lambda.runtime.Context lambdaContext)
throws Exception
handleRequest in class LambdaContainerHandler<RequestType,ResponseType,javax.servlet.http.HttpServletRequest,AwsHttpServletResponse>Exceptionpublic void initialize()
throws ContainerInitializationException
initialize in class AwsLambdaServletContainerHandler<RequestType,ResponseType,javax.servlet.http.HttpServletRequest,AwsHttpServletResponse>ContainerInitializationExceptionCopyright © 2020. All rights reserved.