Class JerseyLambdaContainerHandler<RequestType,ResponseType>

java.lang.Object
com.amazonaws.serverless.proxy.internal.LambdaContainerHandler<RequestType,ResponseType,ContainerRequestType,ContainerResponseType>
com.amazonaws.serverless.proxy.internal.servlet.AwsLambdaServletContainerHandler<RequestType,ResponseType,jakarta.servlet.http.HttpServletRequest,AwsHttpServletResponse>
com.amazonaws.serverless.proxy.jersey.JerseyLambdaContainerHandler<RequestType,ResponseType>
Type Parameters:
RequestType - The type for the incoming Lambda event
ResponseType - The type for Lambda's return value
All Implemented Interfaces:
InitializableLambdaContainerHandler

public class JerseyLambdaContainerHandler<RequestType,ResponseType> extends AwsLambdaServletContainerHandler<RequestType,ResponseType,jakarta.servlet.http.HttpServletRequest,AwsHttpServletResponse>
Jersey-specific implementation of the LambdaContainerHandler interface. Given a Jax-Rs application starts Jersey's ApplicationHandler and proxies requests and responses using the RequestReader and ResponseWriter objects. The reader and writer objects are inherited from the BaseLambdaContainerHandler object.
 
   public class LambdaHandler implements RequestHandler<AwsProxyRequest, AwsProxyResponse> {
     private ResourceConfig jerseyApplication = new ResourceConfig().packages("your.app.package");
     private JerseyLambdaContainerHandler<AwsProxyRequest, AwsProxyResponse> container = JerseyLambdaContainerHandler.getAwsProxyHandler(jerseyApplication);

     public AwsProxyResponse handleRequest(AwsProxyRequest awsProxyRequest, Context context) {
       return container.proxy(awsProxyRequest, context);
     }
   }
 
 
See Also: