public class ModuleManager extends Object
Constructor and Description |
---|
ModuleManager() |
Modifier and Type | Method and Description |
---|---|
Optional<FunctionDefinition> |
getFunctionDefinition(String name)
Get an optional of
FunctionDefinition by a given name. |
List<ModuleEntry> |
listFullModules()
Get all loaded modules with use status.
|
Set<String> |
listFunctions()
Get names of all functions from used modules.
|
List<String> |
listModules()
Get names of all used modules in resolution order.
|
void |
loadModule(String name,
Module module)
Load a module under a unique name.
|
void |
unloadModule(String name)
Unload a module with given name.
|
void |
useModules(String... names)
Enable modules in use with declared name order.
|
public void loadModule(String name, Module module)
name
- name of the modulemodule
- the module instanceValidationException
- when there already exists a module with the same namepublic void unloadModule(String name)
name
- name of the moduleValidationException
- when there is no module with the given namepublic void useModules(String... names)
names
- module names to be usedValidationException
- when module names contain an unloaded namepublic List<String> listModules()
public List<ModuleEntry> listFullModules()
public Set<String> listFunctions()
public Optional<FunctionDefinition> getFunctionDefinition(String name)
FunctionDefinition
by a given name. Function will be resolved to
modules in the used order, and the first match will be returned. If no match is found in all
modules, return an optional.name
- name of the functionFunctionDefinition
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.