RequestType - The incoming event typeResponseType - The expected return typepublic class SpringLambdaContainerHandler<RequestType,ResponseType> extends AwsLambdaServletContainerHandler<RequestType,ResponseType,javax.servlet.http.HttpServletRequest,AwsHttpServletResponse>
AwsLambdaServletContainerHandler.StartupHandler| Modifier and Type | Field and Description |
|---|---|
protected org.springframework.web.context.ConfigurableWebApplicationContext |
appContext |
servletContext, startupHandlerlambdaContext, SERVER_INFO| Constructor and Description |
|---|
SpringLambdaContainerHandler(Class<RequestType> requestTypeClass,
Class<ResponseType> responseTypeClass,
RequestReader<RequestType,javax.servlet.http.HttpServletRequest> requestReader,
ResponseWriter<AwsHttpServletResponse,ResponseType> responseWriter,
SecurityContextWriter<RequestType> securityContextWriter,
ExceptionHandler<ResponseType> exceptionHandler,
org.springframework.web.context.ConfigurableWebApplicationContext applicationContext,
InitializationWrapper init)
Creates a new container handler with the given reader and writer objects
|
| Modifier and Type | Method and Description |
|---|---|
void |
activateSpringProfiles(String... p)
Activates the given Spring profiles in the application.
|
static SpringLambdaContainerHandler<AwsProxyRequest,AwsProxyResponse> |
getAwsProxyHandler(Class<?>... config)
Creates a default SpringLambdaContainerHandler initialized with the `AwsProxyRequest` and `AwsProxyResponse` objects
|
static SpringLambdaContainerHandler<AwsProxyRequest,AwsProxyResponse> |
getAwsProxyHandler(org.springframework.web.context.ConfigurableWebApplicationContext applicationContext,
String... profiles)
Creates a default SpringLambdaContainerHandler initialized with the `AwsProxyRequest` and `AwsProxyResponse` objects and sets the given profiles as active
|
protected AwsHttpServletResponse |
getContainerResponse(javax.servlet.http.HttpServletRequest request,
CountDownLatch latch) |
static SpringLambdaContainerHandler<HttpApiV2ProxyRequest,AwsProxyResponse> |
getHttpApiV2ProxyHandler(Class<?>... config)
Creates a default SpringLambdaContainerHandler initialized with the `HttpApiV2ProxyRequest` and `AwsProxyResponse` objects
|
protected void |
handleRequest(javax.servlet.http.HttpServletRequest containerRequest,
AwsHttpServletResponse containerResponse,
com.amazonaws.services.lambda.runtime.Context lambdaContext) |
void |
initialize() |
protected void |
registerServlets()
Overriding this method allows to customize the standard Spring DispatcherServlet
or to register additional servlets
|
void |
setRefreshContext(boolean refresh)
Asks the custom web application initializer to refresh the Spring context.
|
doFilter, getFilterChain, getServletContext, onStartup, setServletContextgetContainerConfig, getInitializationWrapper, getObjectMapper, proxy, proxyStream, setInitializationWrapper, setLogFormatter, stripBasePathprotected final org.springframework.web.context.ConfigurableWebApplicationContext appContext
public SpringLambdaContainerHandler(Class<RequestType> requestTypeClass, Class<ResponseType> responseTypeClass, RequestReader<RequestType,javax.servlet.http.HttpServletRequest> requestReader, ResponseWriter<AwsHttpServletResponse,ResponseType> responseWriter, SecurityContextWriter<RequestType> securityContextWriter, ExceptionHandler<ResponseType> exceptionHandler, org.springframework.web.context.ConfigurableWebApplicationContext applicationContext, InitializationWrapper init)
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`public static SpringLambdaContainerHandler<AwsProxyRequest,AwsProxyResponse> getAwsProxyHandler(Class<?>... config) throws ContainerInitializationException
config - A set of classes annotated with the Spring @Configuration annotationContainerInitializationException - When the Spring framework fails to start.public static SpringLambdaContainerHandler<AwsProxyRequest,AwsProxyResponse> getAwsProxyHandler(org.springframework.web.context.ConfigurableWebApplicationContext applicationContext, String... profiles) throws ContainerInitializationException
applicationContext - A custom ConfigurableWebApplicationContext to be usedprofiles - The spring profiles to activateContainerInitializationException - When the Spring framework fails to start.public static SpringLambdaContainerHandler<HttpApiV2ProxyRequest,AwsProxyResponse> getHttpApiV2ProxyHandler(Class<?>... config) throws ContainerInitializationException
config - A set of classes annotated with the Spring @Configuration annotationContainerInitializationException - When the Spring framework fails to start.public void setRefreshContext(boolean refresh)
refresh - true if the context should be refreshedprotected AwsHttpServletResponse getContainerResponse(javax.servlet.http.HttpServletRequest request, CountDownLatch latch)
getContainerResponse in class LambdaContainerHandler<RequestType,ResponseType,javax.servlet.http.HttpServletRequest,AwsHttpServletResponse>public void activateSpringProfiles(String... p) throws ContainerInitializationException
getAwsProxyHandler(ConfigurableWebApplicationContext, String...)p - A number of spring profilesContainerInitializationException - if the initializer is not set yet.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>ContainerInitializationExceptionprotected void registerServlets()
Copyright © 2022. All rights reserved.