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

    Constructors
    Constructor
    Description
    Default constructor; will initialize a suitable ApplicationContext for Lambda deployment.
    MicronautRequestStreamHandler(io.micronaut.context.ApplicationContext applicationContext)
    Constructor used to inject a preexisting ApplicationContext.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected io.micronaut.context.ApplicationContext
    buildApplicationContext(com.amazonaws.services.lambda.runtime.Context context)
     
    void
     
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MicronautRequestStreamHandler

      public MicronautRequestStreamHandler()
      Default constructor; will initialize a suitable ApplicationContext for Lambda deployment.
    • MicronautRequestStreamHandler

      public MicronautRequestStreamHandler(io.micronaut.context.ApplicationContext applicationContext)
      Constructor used to inject a preexisting ApplicationContext.
      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 interface com.amazonaws.services.lambda.runtime.RequestStreamHandler
      Throws:
      IOException
    • buildApplicationContext

      protected io.micronaut.context.ApplicationContext buildApplicationContext(com.amazonaws.services.lambda.runtime.Context context)
      Overrides:
      buildApplicationContext in class io.micronaut.function.executor.AbstractExecutor<com.amazonaws.services.lambda.runtime.Context>
    • newApplicationContextBuilder

      @NonNull protected @NonNull io.micronaut.context.ApplicationContextBuilder newApplicationContextBuilder()
      Overrides:
      newApplicationContextBuilder in class io.micronaut.function.executor.AbstractExecutor<com.amazonaws.services.lambda.runtime.Context>
    • resolveFunctionName

      protected String resolveFunctionName(io.micronaut.context.env.Environment env)
      Overrides:
      resolveFunctionName in class io.micronaut.function.executor.AbstractExecutor<com.amazonaws.services.lambda.runtime.Context>
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class io.micronaut.function.executor.AbstractExecutor<com.amazonaws.services.lambda.runtime.Context>