public class AwsApiGatewayLambdaRequestStreamHandler
extends java.lang.Object
implements com.amazonaws.services.lambda.runtime.RequestStreamHandler
| Modifier and Type | Field and Description |
|---|---|
protected io.inversion.Api |
api |
protected io.inversion.Engine |
engine |
| Constructor and Description |
|---|
AwsApiGatewayLambdaRequestStreamHandler() |
| Modifier and Type | Method and Description |
|---|---|
protected io.inversion.Api |
buildApi(io.inversion.Engine engine)
Optional subclass override hook to supply your own custom wired up Api.
|
protected io.inversion.Engine |
buildEngine(java.lang.String configProfile,
java.lang.String servletPath)
Optional subclass override hook to allow for advanced Engine configuration.
|
void |
debug(java.lang.String msg) |
io.inversion.Api |
getApi() |
io.inversion.Engine |
getEngine() |
void |
handleRequest(java.io.InputStream inputStream,
java.io.OutputStream outputStream,
com.amazonaws.services.lambda.runtime.Context context) |
boolean |
isDebug() |
void |
setApi(io.inversion.Api api) |
void |
setDebug(boolean debug) |
void |
setEngine(io.inversion.Engine engine) |
protected void |
writeResponse(io.inversion.Response res,
java.io.OutputStream outputStream) |
public AwsApiGatewayLambdaRequestStreamHandler()
public void handleRequest(java.io.InputStream inputStream,
java.io.OutputStream outputStream,
com.amazonaws.services.lambda.runtime.Context context)
throws java.io.IOException
handleRequest in interface com.amazonaws.services.lambda.runtime.RequestStreamHandlerjava.io.IOExceptionprotected io.inversion.Engine buildEngine(java.lang.String configProfile,
java.lang.String servletPath)
Simple embeddings can leave this alone. Complex embeddings can either set the engine via setEngine() or override this method to construct/configure as needed.
This default implementation constructs an Engine with the supplied configProfile and adds api to it if api is not null.
If api is null, it calls buildApi() which by default does nothing and is itself designed as an override hook.
configProfile - the configuration runtime profileservletPath - the servlet pathbuildApi(io.inversion.Engine)protected io.inversion.Api buildApi(io.inversion.Engine engine)
If you don't set your api via setApi() and you don't override buildApi() to supply an Api
or otherwise wire your custom Api and Engine in an overridden buildEngine() method, you will need to define your Api in inversion.properties files for autowiring via Config/Configurator.
engine - the engine that will host the ApibuildEngine(java.lang.String, java.lang.String)protected void writeResponse(io.inversion.Response res,
java.io.OutputStream outputStream)
throws java.io.IOException
java.io.IOExceptionpublic void debug(java.lang.String msg)
public boolean isDebug()
public void setDebug(boolean debug)
public io.inversion.Engine getEngine()
public void setEngine(io.inversion.Engine engine)
public io.inversion.Api getApi()
public void setApi(io.inversion.Api api)
Copyright © 2021 Rocket Partners, LLC. All rights reserved.