Interface FunctionRegistry


@Api public 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 Details

    • registerFunction

      void registerFunction(Function function) throws FunctionAlreadyRegisteredException, InvalidFunctionException
      Registers given function.
      Parameters:
      function - function instance
      Throws:
      FunctionAlreadyRegisteredException
      InvalidFunctionException
    • unregisterFunction

      void unregisterFunction(Function function)
      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 strategy
      instanceFactory - Instance factory that should me used to create components instances
      Returns:
      mapping with functions and classes used to discover those functions
    • getFunctions

      List<Function> getFunctions()
      Returns all registered functions.
      Returns:
      available functions
    • getFunction

      Function getFunction(String name) throws FunctionNotFoundException
      Returns registered function with given name.
      Returns:
      function
      Throws:
      FunctionNotFoundException - function not found
    • isRegistered

      boolean isRegistered(String name)
      Returns true if function with given name is available.
      Parameters:
      name - function name
      Returns:
      true if function is registered