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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ApplicationContextbuildApplicationContext(C context) voidclose()Resolves theApplicationContextfor this class.protected @NonNull ApplicationContextBuilderBuilds a new builder.protected ExecutableMethod<Object,Object> resolveFunction(LocalFunctionRegistry localFunctionRegistry, String functionName) Resolve a function from theLocalFunctionRegistry.protected StringResolves the function name to execution for the environment.protected EnvironmentstartEnvironment(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- 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
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:ApplicationContextProviderResolves theApplicationContextfor this class.- Specified by:
getApplicationContextin interfaceApplicationContextProvider- Returns:
- The
ApplicationContext
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-