Class SimpleFunctionRegistry
- java.lang.Object
-
- org.springframework.cloud.function.context.catalog.SimpleFunctionRegistry
-
- All Implemented Interfaces:
FunctionInspector,FunctionCatalog,FunctionRegistry
- Direct Known Subclasses:
BeanFactoryAwareFunctionRegistry
public class SimpleFunctionRegistry extends Object implements FunctionRegistry, FunctionInspector
Implementation ofFunctionCatalogandFunctionRegistrywhich does not depend on Spring'sBeanFactory. Each function must be registered with it explicitly to benefit from features such as type conversion, composition, POJO etc.- Author:
- Oleg Zhurakousky, Roman Samarev
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classSimpleFunctionRegistry.FunctionInvocationWrapperstatic classSimpleFunctionRegistry.PassThruFunction
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.commons.logging.Loglogger
-
Constructor Summary
Constructors Constructor Description SimpleFunctionRegistry(org.springframework.core.convert.ConversionService conversionService, org.springframework.messaging.converter.CompositeMessageConverter messageConverter, JsonMapper jsonMapper)SimpleFunctionRegistry(org.springframework.core.convert.ConversionService conversionService, org.springframework.messaging.converter.CompositeMessageConverter messageConverter, JsonMapper jsonMapper, FunctionProperties functionProperties, FunctionInvocationHelper<org.springframework.messaging.Message<?>> functionInvocationHelper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMessageConverters(Collection<org.springframework.messaging.converter.MessageConverter> messageConverters)Will add providedMessageConverters to the head of the stack of the existing MessageConverters.protected booleancontainsFunction(String functionName)Set<String>getNames(Class<?> type)FunctionRegistration<?>getRegistration(Object function)<T> Tlookup(Class<?> type, String functionDefinition, String... expectedOutputMimeTypes)<T> voidregister(FunctionRegistration<T> registration)intsize()Return the count of functions registered in this catalog.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.springframework.cloud.function.context.FunctionCatalog
lookup, lookup, lookup
-
Methods inherited from interface org.springframework.cloud.function.context.catalog.FunctionInspector
getInputType, getInputWrapper, getName, getOutputType, getOutputWrapper, isMessage
-
-
-
-
Constructor Detail
-
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 Detail
-
addMessageConverters
public void addMessageConverters(Collection<org.springframework.messaging.converter.MessageConverter> messageConverters)
Will add providedMessageConverters to the head of the stack of the existing MessageConverters.- Parameters:
messageConverters- list ofMessageConverters.
-
getRegistration
public FunctionRegistration<?> getRegistration(Object function)
- Specified by:
getRegistrationin interfaceFunctionInspector
-
lookup
public <T> T lookup(Class<?> type, String functionDefinition, String... expectedOutputMimeTypes)
- Specified by:
lookupin interfaceFunctionCatalog
-
register
public <T> void register(FunctionRegistration<T> registration)
- Specified by:
registerin interfaceFunctionRegistry
-
getNames
public Set<String> getNames(Class<?> type)
- Specified by:
getNamesin interfaceFunctionCatalog
-
size
public int size()
Description copied from interface:FunctionCatalogReturn the count of functions registered in this catalog.- Specified by:
sizein interfaceFunctionCatalog- Returns:
- the count of functions registered in this catalog
-
containsFunction
protected boolean containsFunction(String functionName)
-
-