Package io.micronaut.function.aws
Class MicronautRequestStreamHandler
java.lang.Object
io.micronaut.function.executor.AbstractExecutor<C>
io.micronaut.function.executor.StreamFunctionExecutor<com.amazonaws.services.lambda.runtime.Context>
io.micronaut.function.aws.MicronautRequestStreamHandler
- All Implemented Interfaces:
com.amazonaws.services.lambda.runtime.RequestStreamHandler
,io.micronaut.context.ApplicationContextProvider
,MicronautLambdaContext
,Closeable
,AutoCloseable
public class MicronautRequestStreamHandler
extends io.micronaut.function.executor.StreamFunctionExecutor<com.amazonaws.services.lambda.runtime.Context>
implements com.amazonaws.services.lambda.runtime.RequestStreamHandler, MicronautLambdaContext
An implementation of the RequestStreamHandler
for Micronaut
- Since:
- 1.0
- Author:
- Graeme Rocher
-
Field Summary
Fields inherited from class io.micronaut.function.executor.AbstractExecutor
applicationContext
Fields inherited from interface io.micronaut.function.aws.MicronautLambdaContext
ENVIRONMENT_LAMBDA
-
Constructor Summary
ConstructorDescriptionDefault constructor; will initialize a suitableApplicationContext
for Lambda deployment.MicronautRequestStreamHandler
(io.micronaut.context.ApplicationContext applicationContext) Constructor used to inject a preexistingApplicationContext
. -
Method Summary
Modifier and TypeMethodDescriptionprotected io.micronaut.context.ApplicationContext
buildApplicationContext
(com.amazonaws.services.lambda.runtime.Context context) void
close()
void
handleRequest
(InputStream input, OutputStream output, com.amazonaws.services.lambda.runtime.Context context) protected @NonNull io.micronaut.context.ApplicationContextBuilder
protected String
resolveFunctionName
(io.micronaut.context.env.Environment env) Methods inherited from class io.micronaut.function.executor.StreamFunctionExecutor
execute, execute
Methods inherited from class io.micronaut.function.executor.AbstractExecutor
getApplicationContext, resolveFunction, startEnvironment
-
Constructor Details
-
MicronautRequestStreamHandler
public MicronautRequestStreamHandler()Default constructor; will initialize a suitableApplicationContext
for Lambda deployment. -
MicronautRequestStreamHandler
public MicronautRequestStreamHandler(io.micronaut.context.ApplicationContext applicationContext) Constructor used to inject a preexistingApplicationContext
.- Parameters:
applicationContext
- the application context
-
-
Method Details
-
handleRequest
public void handleRequest(InputStream input, OutputStream output, com.amazonaws.services.lambda.runtime.Context context) throws IOException - Specified by:
handleRequest
in interfacecom.amazonaws.services.lambda.runtime.RequestStreamHandler
- Throws:
IOException
-
buildApplicationContext
protected io.micronaut.context.ApplicationContext buildApplicationContext(com.amazonaws.services.lambda.runtime.Context context) - Overrides:
buildApplicationContext
in classio.micronaut.function.executor.AbstractExecutor<com.amazonaws.services.lambda.runtime.Context>
-
newApplicationContextBuilder
@NonNull protected @NonNull io.micronaut.context.ApplicationContextBuilder newApplicationContextBuilder()- Overrides:
newApplicationContextBuilder
in classio.micronaut.function.executor.AbstractExecutor<com.amazonaws.services.lambda.runtime.Context>
-
resolveFunctionName
- Overrides:
resolveFunctionName
in classio.micronaut.function.executor.AbstractExecutor<com.amazonaws.services.lambda.runtime.Context>
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classio.micronaut.function.executor.AbstractExecutor<com.amazonaws.services.lambda.runtime.Context>
-