RequestType - The incoming event typeResponseType - The expected return typepublic class SpringLambdaContainerHandler<RequestType,ResponseType> extends AwsLambdaServletContainerHandler<RequestType,ResponseType,AwsProxyHttpServletRequest,AwsHttpServletResponse>
AwsLambdaServletContainerHandler.StartupHandlerservletContext, startupHandlerlambdaContext, SERVER_INFO| Constructor and Description |
|---|
SpringLambdaContainerHandler(java.lang.Class<RequestType> requestTypeClass,
java.lang.Class<ResponseType> responseTypeClass,
RequestReader<RequestType,AwsProxyHttpServletRequest> requestReader,
ResponseWriter<AwsHttpServletResponse,ResponseType> responseWriter,
SecurityContextWriter<RequestType> securityContextWriter,
ExceptionHandler<ResponseType> exceptionHandler,
org.springframework.web.context.ConfigurableWebApplicationContext applicationContext)
Creates a new container handler with the given reader and writer objects
|
| Modifier and Type | Method and Description |
|---|---|
void |
activateSpringProfiles(java.lang.String... profiles)
Activates the given Spring profiles in the application.
|
LambdaSpringApplicationInitializer |
getApplicationInitializer()
Returns the custom web application initializer used by the object.
|
static SpringLambdaContainerHandler<AwsProxyRequest,AwsProxyResponse> |
getAwsProxyHandler(java.lang.Class... config)
Creates a default SpringLambdaContainerHandler initialized with the `AwsProxyRequest` and `AwsProxyResponse` objects
|
static SpringLambdaContainerHandler<AwsProxyRequest,AwsProxyResponse> |
getAwsProxyHandler(org.springframework.web.context.ConfigurableWebApplicationContext applicationContext)
Creates a default SpringLambdaContainerHandler initialized with the `AwsProxyRequest` and `AwsProxyResponse` objects
|
static SpringLambdaContainerHandler<AwsProxyRequest,AwsProxyResponse> |
getAwsProxyHandler(org.springframework.web.context.ConfigurableWebApplicationContext applicationContext,
java.lang.String... profiles)
Creates a default SpringLambdaContainerHandler initialized with the `AwsProxyRequest` and `AwsProxyResponse` objects and sets the given profiles as active
|
protected AwsHttpServletResponse |
getContainerResponse(AwsProxyHttpServletRequest request,
java.util.concurrent.CountDownLatch latch) |
protected void |
handleRequest(AwsProxyHttpServletRequest containerRequest,
AwsHttpServletResponse containerResponse,
com.amazonaws.services.lambda.runtime.Context lambdaContext) |
void |
initialize() |
void |
setRefreshContext(boolean refreshContext)
Asks the custom web application initializer to refresh the Spring context.
|
doFilter, forward, getFilterChain, getServletContext, include, onStartup, setServletContextgetContainerConfig, getObjectMapper, proxy, proxyStream, setLogFormatter, stripBasePathpublic SpringLambdaContainerHandler(java.lang.Class<RequestType> requestTypeClass, java.lang.Class<ResponseType> responseTypeClass, RequestReader<RequestType,AwsProxyHttpServletRequest> requestReader, ResponseWriter<AwsHttpServletResponse,ResponseType> responseWriter, SecurityContextWriter<RequestType> securityContextWriter, ExceptionHandler<ResponseType> exceptionHandler, org.springframework.web.context.ConfigurableWebApplicationContext applicationContext) 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`ContainerInitializationExceptionpublic static SpringLambdaContainerHandler<AwsProxyRequest,AwsProxyResponse> getAwsProxyHandler(java.lang.Class... config) throws ContainerInitializationException
config - A set of classes annotated with the Spring @Configuration annotationContainerInitializationExceptionpublic static SpringLambdaContainerHandler<AwsProxyRequest,AwsProxyResponse> getAwsProxyHandler(org.springframework.web.context.ConfigurableWebApplicationContext applicationContext) throws ContainerInitializationException
applicationContext - A custom ConfigurableWebApplicationContext to be usedContainerInitializationExceptionpublic static SpringLambdaContainerHandler<AwsProxyRequest,AwsProxyResponse> getAwsProxyHandler(org.springframework.web.context.ConfigurableWebApplicationContext applicationContext, java.lang.String... profiles) throws ContainerInitializationException
applicationContext - A custom ConfigurableWebApplicationContext to be usedprofiles - The spring profiles to activateContainerInitializationExceptionpublic void setRefreshContext(boolean refreshContext)
refreshContext - true if the context should be refreshedpublic LambdaSpringApplicationInitializer getApplicationInitializer()
WebApplicationInitializerprotected AwsHttpServletResponse getContainerResponse(AwsProxyHttpServletRequest request, java.util.concurrent.CountDownLatch latch)
getContainerResponse in class LambdaContainerHandler<RequestType,ResponseType,AwsProxyHttpServletRequest,AwsHttpServletResponse>public void activateSpringProfiles(java.lang.String... profiles)
throws ContainerInitializationException
getAwsProxyHandler(ConfigurableWebApplicationContext, String...)profiles - A number of spring profilesContainerInitializationException - if the initializer is not set yet.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 © 2018. All Rights Reserved.