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:
ApplicationContextProvider
,Closeable
,AutoCloseable
- Direct Known Subclasses:
AbstractFunctionExecutor
,FunctionInitializer
,StreamFunctionExecutor
public class AbstractExecutor<C>
extends Object
implements ApplicationContextProvider, Closeable, AutoCloseable
An abstract executor implementation.
- Since:
- 1.0
- Author:
- Graeme Rocher
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected ApplicationContext
buildApplicationContext
(C context) void
close()
Resolves theApplicationContext
for this class.protected @NonNull ApplicationContextBuilder
Builds a new builder.protected ExecutableMethod<Object,
Object> resolveFunction
(LocalFunctionRegistry localFunctionRegistry, String functionName) Resolve a function from theLocalFunctionRegistry
.protected String
Resolves the function name to execution for the environment.protected Environment
startEnvironment
(ApplicationContext applicationContext) Start the environment specified.
-
Field Details
-
applicationContext
The currentApplicationContext
.
-
-
Constructor Details
-
AbstractExecutor
public AbstractExecutor()
-
-
Method Details
-
resolveFunction
protected ExecutableMethod<Object,Object> resolveFunction(LocalFunctionRegistry localFunctionRegistry, String functionName) Resolve a function from theLocalFunctionRegistry
.- Parameters:
localFunctionRegistry
- TheLocalFunctionRegistry
functionName
- 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
ApplicationContext
to use
-
newApplicationContextBuilder
Builds a new builder.- Returns:
- The
ApplicationContextBuilder
-
startEnvironment
Start the environment specified.- Parameters:
applicationContext
- the application context with the environment- Returns:
- The environment within the context
-
getApplicationContext
Description copied from interface:ApplicationContextProvider
Resolves theApplicationContext
for this class.- Specified by:
getApplicationContext
in interfaceApplicationContextProvider
- Returns:
- The
ApplicationContext
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-