Class SimpleFunctionRegistry

java.lang.Object
org.springframework.cloud.function.context.catalog.SimpleFunctionRegistry
All Implemented Interfaces:
FunctionCatalog, FunctionRegistry
Direct Known Subclasses:
BeanFactoryAwareFunctionRegistry

public class SimpleFunctionRegistry extends Object implements FunctionRegistry
Implementation of FunctionCatalog and FunctionRegistry which does not depend on Spring's BeanFactory. Each function must be registered with it explicitly to benefit from features such as type conversion, composition, POJO etc.
Author:
Oleg Zhurakousky, Roman Samarev
  • Field Details

    • logger

      protected org.apache.commons.logging.Log logger
  • Constructor Details

    • SimpleFunctionRegistry

      public SimpleFunctionRegistry(org.springframework.core.convert.ConversionService conversionService, org.springframework.messaging.converter.CompositeMessageConverter messageConverter, JsonMapper jsonMapper, @Nullable FunctionProperties functionProperties, @Nullable FunctionInvocationHelper<org.springframework.messaging.Message<?>> functionInvocationHelper)
    • SimpleFunctionRegistry

      public SimpleFunctionRegistry(org.springframework.core.convert.ConversionService conversionService, org.springframework.messaging.converter.CompositeMessageConverter messageConverter, JsonMapper jsonMapper)
  • Method Details

    • addMessageConverters

      public void addMessageConverters(Collection<org.springframework.messaging.converter.MessageConverter> messageConverters)
      Will add provided MessageConverters to the head of the stack of the existing MessageConverters.
      Parameters:
      messageConverters - list of MessageConverters.
    • lookup

      public <T> T lookup(Class<?> type, String functionDefinition, String... expectedOutputMimeTypes)
      Specified by:
      lookup in interface FunctionCatalog
    • register

      public <T> void register(FunctionRegistration<T> registration)
      Specified by:
      register in interface FunctionRegistry
    • getNames

      public Set<String> getNames(Class<?> type)
      Specified by:
      getNames in interface FunctionCatalog
    • size

      public int size()
      Description copied from interface: FunctionCatalog
      Return the count of functions registered in this catalog.
      Specified by:
      size in interface FunctionCatalog
      Returns:
      the count of functions registered in this catalog
    • containsFunction

      protected boolean containsFunction(String functionName)