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 java.lang.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 java.lang.Class<RequestType> |
requestTypeClass |
protected java.lang.Class<ResponseType> |
responseTypeClass |
protected ResponseWriter<AwsHttpServletResponse,ResponseType> |
responseWriter |
protected SecurityContextWriter<RequestType> |
securityContextWriter |
| Constructor and Description |
|---|
ServletLambdaContainerHandlerBuilder() |
| Modifier and Type | Method and Description |
|---|---|
Builder |
asyncInit(long actualStartTime) |
abstract HandlerType |
build() |
abstract HandlerType |
buildAndInitialize() |
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(java.lang.Class<RequestType> requestType) |
Builder |
responseTypeClass(java.lang.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 java.lang.Class<RequestType> requestTypeClass
protected java.lang.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 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(java.lang.Class<RequestType> requestType)
public Builder responseTypeClass(java.lang.Class<ResponseType> responseType)
public Builder asyncInit(long actualStartTime)
protected abstract Builder self()
public abstract HandlerType build() throws ContainerInitializationException
ContainerInitializationExceptionpublic abstract HandlerType buildAndInitialize() throws ContainerInitializationException
ContainerInitializationExceptionCopyright © 2019. All Rights Reserved.