Package com.suncode.pwfl.core.function
Interface FunctionRegistry
Function registry that holds every registered function. Functions can be registered or
unregistered at any time.
- Author:
- RafaĆ Nowacki 1 gru 2015, Cezary Kozar 29 kwi 2016
-
Method Summary
Modifier and TypeMethodDescriptiongetFunction
(String name) Returns registered function with given name.Returns all registered functions.boolean
isRegistered
(String name) Returnstrue
if function with given name is available.void
registerFunction
(Function function) Registers given function.registerFunctions
(ComponentDiscovery strategy, InstanceFactory instanceFactory) Registers all functions discovered using given strategy.void
unregisterFunction
(Function function) Removes given function from registry.
-
Method Details
-
registerFunction
void registerFunction(Function function) throws FunctionAlreadyRegisteredException, InvalidFunctionException Registers given function.- Parameters:
function
- function instance- Throws:
FunctionAlreadyRegisteredException
InvalidFunctionException
-
unregisterFunction
Removes given function from registry.- Parameters:
function
- function instance
-
registerFunctions
com.google.common.collect.Multimap<Class<?>,Function> registerFunctions(ComponentDiscovery strategy, InstanceFactory instanceFactory) Registers all functions discovered using given strategy.This operation is atomic. It will either register every discovered function or none when unexpected error occurs.
- Parameters:
strategy
- discovery strategyinstanceFactory
- Instance factory that should me used to create components instances- Returns:
- mapping with functions and classes used to discover those functions
-
getFunctions
Returns all registered functions.- Returns:
- available functions
-
getFunction
Returns registered function with given name.- Returns:
- function
- Throws:
FunctionNotFoundException
- function not found
-
isRegistered
Returnstrue
if function with given name is available.- Parameters:
name
- function name- Returns:
true
if function is registered
-