RequestType - The event object classResponseType - The output object classContainerRequestType - The container request type. For proxy implementations, this is AwsProxyHttpServletRequest.
The response type is hardcoded to AwsHttpServletResponse since it is a generic
servlet response implementation.HandlerType - The type of the handler we are buildingBuilder - The builder object itself. This is used to allow implementations to re-use the setter method from this
abstract class through
"curiously recurring generic patterns"public abstract class ServletLambdaContainerHandlerBuilder<RequestType,ResponseType,ContainerRequestType extends javax.servlet.http.HttpServletRequest,HandlerType extends AwsLambdaServletContainerHandler<RequestType,ResponseType,ContainerRequestType,AwsHttpServletResponse>,Builder extends ServletLambdaContainerHandlerBuilder<RequestType,ResponseType,ContainerRequestType,HandlerType,Builder>> extends Object
AwsLambdaServletContainerHandler. Implmentations can extend this class to have setters
for the basic parameters.| Modifier and Type | Field and Description |
|---|---|
protected ExceptionHandler<ResponseType> |
exceptionHandler |
protected InitializationWrapper |
initializationWrapper |
protected RequestReader<RequestType,ContainerRequestType> |
requestReader |
protected Class<RequestType> |
requestTypeClass |
protected Class<ResponseType> |
responseTypeClass |
protected ResponseWriter<AwsHttpServletResponse,ResponseType> |
responseWriter |
protected SecurityContextWriter<RequestType> |
securityContextWriter |
| Constructor and Description |
|---|
ServletLambdaContainerHandlerBuilder() |
| Modifier and Type | Method and Description |
|---|---|
Builder |
asyncInit()
Uses a new
AsyncInitializationWrapper with the no-parameter constructor that takes the actual JVM
start time |
Builder |
asyncInit(long actualStartTime)
Deprecated.
As of release 1.5 this method is deprecated in favor of the parameters-less one
asyncInit(). |
abstract HandlerType |
build() |
abstract HandlerType |
buildAndInitialize() |
Builder |
defaultHttpApiV2Proxy()
Sets all of the required fields in the builder to the default settings for a Servlet-compatible framework that wants
to support HTTP API's v2 proxy event
|
Builder |
defaultProxy()
Sets all of the required fields in the builder to the default settings for a Servlet-compatible framework that wants
to support AWS proxy event and output types.
|
Builder |
exceptionHandler(ExceptionHandler<ResponseType> exceptionHandler) |
Builder |
initializationWrapper(InitializationWrapper initializationWrapper)
Sets the initialization wrapper to be used by the
buildAndInitialize()
method to start the framework implementations |
Builder |
requestReader(RequestReader<RequestType,ContainerRequestType> requestReader) |
Builder |
requestTypeClass(Class<RequestType> requestType) |
Builder |
responseTypeClass(Class<ResponseType> responseType) |
Builder |
responseWriter(ResponseWriter<AwsHttpServletResponse,ResponseType> responseWriter) |
Builder |
securityContextWriter(SecurityContextWriter<RequestType> securityContextWriter) |
protected abstract Builder |
self()
Implementations should implement this method to return their type.
|
protected void |
validate()
Validates that all of the required fields are populated.
|
protected InitializationWrapper initializationWrapper
protected RequestReader<RequestType,ContainerRequestType extends javax.servlet.http.HttpServletRequest> requestReader
protected ResponseWriter<AwsHttpServletResponse,ResponseType> responseWriter
protected SecurityContextWriter<RequestType> securityContextWriter
protected ExceptionHandler<ResponseType> exceptionHandler
protected Class<RequestType> requestTypeClass
protected Class<ResponseType> responseTypeClass
public ServletLambdaContainerHandlerBuilder()
protected void validate()
throws ContainerInitializationException
ContainerInitializationException - If values have not been set on the builder. The message in the exception
contains a standard error message MISSING_FIELD_ERROR populated with
the list of missing fields.public Builder defaultProxy()
public Builder defaultHttpApiV2Proxy()
public Builder initializationWrapper(InitializationWrapper initializationWrapper)
buildAndInitialize()
method to start the framework implementationsinitializationWrapper - An implementation of InitializationWrapper. In most cases, this will be
set to InitializationWrapper. The asyncInit(long)
method sets this to AsyncInitializationWrapper.public Builder requestReader(RequestReader<RequestType,ContainerRequestType> requestReader)
public Builder responseWriter(ResponseWriter<AwsHttpServletResponse,ResponseType> responseWriter)
public Builder securityContextWriter(SecurityContextWriter<RequestType> securityContextWriter)
public Builder exceptionHandler(ExceptionHandler<ResponseType> exceptionHandler)
public Builder requestTypeClass(Class<RequestType> requestType)
public Builder responseTypeClass(Class<ResponseType> responseType)
@Deprecated public Builder asyncInit(long actualStartTime)
asyncInit().actualStartTime - An epoch in milliseconds that should be used to calculate the 10 seconds timeout since the start of the applicationpublic Builder asyncInit()
AsyncInitializationWrapper with the no-parameter constructor that takes the actual JVM
start timeprotected abstract Builder self()
public abstract HandlerType build() throws ContainerInitializationException
ContainerInitializationExceptionpublic abstract HandlerType buildAndInitialize() throws ContainerInitializationException
ContainerInitializationExceptionCopyright © 2022. All rights reserved.