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 ofFunctionCatalog
andFunctionRegistry
which 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 class
SimpleFunctionRegistry.FunctionInvocationWrapper
static class
SimpleFunctionRegistry.PassThruFunction
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.commons.logging.Log
logger
-
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 void
addMessageConverters(Collection<org.springframework.messaging.converter.MessageConverter> messageConverters)
Will add providedMessageConverter
s to the head of the stack of the existing MessageConverters.protected boolean
containsFunction(String functionName)
Set<String>
getNames(Class<?> type)
FunctionRegistration<?>
getRegistration(Object function)
<T> T
lookup(Class<?> type, String functionDefinition, String... expectedOutputMimeTypes)
<T> void
register(FunctionRegistration<T> registration)
int
size()
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 providedMessageConverter
s to the head of the stack of the existing MessageConverters.- Parameters:
messageConverters
- list ofMessageConverter
s.
-
getRegistration
public FunctionRegistration<?> getRegistration(Object function)
- Specified by:
getRegistration
in interfaceFunctionInspector
-
lookup
public <T> T lookup(Class<?> type, String functionDefinition, String... expectedOutputMimeTypes)
- Specified by:
lookup
in interfaceFunctionCatalog
-
register
public <T> void register(FunctionRegistration<T> registration)
- Specified by:
register
in interfaceFunctionRegistry
-
getNames
public Set<String> getNames(Class<?> type)
- Specified by:
getNames
in interfaceFunctionCatalog
-
size
public int size()
Description copied from interface:FunctionCatalog
Return the count of functions registered in this catalog.- Specified by:
size
in interfaceFunctionCatalog
- Returns:
- the count of functions registered in this catalog
-
containsFunction
protected boolean containsFunction(String functionName)
-
-