Package io.micronaut.function.executor
Class AbstractExecutor<C>
java.lang.Object
io.micronaut.function.executor.AbstractExecutor<C>
- Type Parameters:
C- Type of the context
- All Implemented Interfaces:
io.micronaut.context.ApplicationContextProvider,Closeable,AutoCloseable
- Direct Known Subclasses:
AbstractFunctionExecutor,FunctionInitializer,StreamFunctionExecutor
public class AbstractExecutor<C>
extends Object
implements io.micronaut.context.ApplicationContextProvider, Closeable, AutoCloseable
An abstract executor implementation.
- Since:
- 1.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected io.micronaut.context.ApplicationContextThe currentApplicationContext. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected io.micronaut.context.ApplicationContextbuildApplicationContext(C context) voidclose()io.micronaut.context.ApplicationContextprotected @NonNull io.micronaut.context.ApplicationContextBuilderBuilds a new builder.resolveFunction(LocalFunctionRegistry localFunctionRegistry, String functionName) Resolve a function from theLocalFunctionRegistry.protected StringresolveFunctionName(io.micronaut.context.env.Environment env) Resolves the function name to execution for the environment.protected io.micronaut.context.env.EnvironmentstartEnvironment(io.micronaut.context.ApplicationContext applicationContext) Start the environment specified.
-
Field Details
-
applicationContext
protected io.micronaut.context.ApplicationContext applicationContextThe currentApplicationContext.
-
-
Constructor Details
-
AbstractExecutor
public AbstractExecutor()
-
-
Method Details
-
resolveFunction
protected io.micronaut.inject.ExecutableMethod<Object,Object> resolveFunction(LocalFunctionRegistry localFunctionRegistry, String functionName) Resolve a function from theLocalFunctionRegistry.- Parameters:
localFunctionRegistry- TheLocalFunctionRegistryfunctionName- The function name- Returns:
- The method
-
resolveFunctionName
Resolves the function name to execution for the environment.- Parameters:
env- The environment- Returns:
- The function name
-
buildApplicationContext
- Parameters:
context- A platform specific context object- Returns:
- Build the
ApplicationContextto use
-
newApplicationContextBuilder
@NonNull protected @NonNull io.micronaut.context.ApplicationContextBuilder newApplicationContextBuilder()Builds a new builder.- Returns:
- The
ApplicationContextBuilder
-
startEnvironment
protected io.micronaut.context.env.Environment startEnvironment(io.micronaut.context.ApplicationContext applicationContext) Start the environment specified.- Parameters:
applicationContext- the application context with the environment- Returns:
- The environment within the context
-
getApplicationContext
public io.micronaut.context.ApplicationContext getApplicationContext()- Specified by:
getApplicationContextin interfaceio.micronaut.context.ApplicationContextProvider
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-