Class FunctionRegistration<T>
java.lang.Object
org.springframework.cloud.function.context.FunctionRegistration<T>
- Type Parameters:
T- target type
- All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware
public class FunctionRegistration<T>
extends Object
implements org.springframework.beans.factory.BeanNameAware
- Author:
- Dave Syer, Oleg Zhurakousky, Soby Chacko
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic StringSuffix used to add to the name of FunctionRegistration bean that corresponds to the an actual function bean. -
Constructor Summary
ConstructorsConstructorDescriptionFunctionRegistration(T target, String... names) Creates instance of FunctionRegistration. -
Method Summary
Modifier and TypeMethodDescriptiongetNames()getType()names(Collection<String> names) properties(Map<String, String> properties) voidsetBeanName(String name) Transforms (wraps) function identified by the 'target' to itsFluxequivalent unless it already is.voidWill set the names for this registration clearing all previous names first.voidsetUserFunction(Object userFunction) Allows to override the target of this registration with a new target that typically wraps the original target.
-
Field Details
-
REGISTRATION_NAME_SUFFIX
Suffix used to add to the name of FunctionRegistration bean that corresponds to the an actual function bean. It is often used when the actual function bean may not be a java Function (e.g., Kotlin) and certain custom wrapping is required.
NOTE: This is not intended as oublis API
-
-
Constructor Details
-
FunctionRegistration
Creates instance of FunctionRegistration.- Parameters:
target- instance ofSupplier,FunctionorConsumernames- additional set of names for this registration. Additional names can be providedname(String)ornames(String...)operations.
-
-
Method Details
-
getProperties
-
getNames
-
setNames
Will set the names for this registration clearing all previous names first. If you want to add a name or set or names to the existing set of names usenames(Collection)orname(String)ornames(String...)operations.- Parameters:
names- - bean names
-
getType
-
getTarget
-
properties
-
type
-
target
Allows to override the target of this registration with a new target that typically wraps the original target. This typically happens when original target is wrapped into itsFluxcounterpart (e.g., Function into FluxFunction)- Parameters:
target- new target- Returns:
- this registration with new target
-
name
-
names
-
names
-
setBeanName
Transforms (wraps) function identified by the 'target' to itsFluxequivalent unless it already is. For example,Function<String, String>becomesFunction<Flux<String>, Flux<String>>- Specified by:
setBeanNamein interfaceorg.springframework.beans.factory.BeanNameAware- Type Parameters:
S- the expected target type of the function (e.g., FluxFunction)
-
getUserFunction
-
setUserFunction
-