Upgraded spring-cloud-task to 2.1.1
pllished some code and javadoc in AbstractComposableFunctionRegistry
This commit is contained in:
@@ -118,7 +118,7 @@ public abstract class AbstractComposableFunctionRegistry implements FunctionRegi
|
||||
* @return immutable {@link Set} of available {@link Supplier} names.
|
||||
*/
|
||||
public Set<String> getSupplierNames() {
|
||||
return Collections.unmodifiableSet(this.suppliers.keySet());
|
||||
return this.suppliers.keySet();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -150,7 +150,9 @@ public abstract class AbstractComposableFunctionRegistry implements FunctionRegi
|
||||
}
|
||||
|
||||
/**
|
||||
* The count of all Suppliers, Function and Consumers currently registered.
|
||||
* The size of this catalog, which is the count of all Suppliers,
|
||||
* Function and Consumers currently registered.
|
||||
*
|
||||
* @return the count of all Suppliers, Function and Consumers currently registered.
|
||||
*/
|
||||
@Override
|
||||
@@ -184,7 +186,14 @@ public abstract class AbstractComposableFunctionRegistry implements FunctionRegi
|
||||
this.environment = environment;
|
||||
}
|
||||
|
||||
protected void wrap(FunctionRegistration<?> registration, String key) {
|
||||
/**
|
||||
* Registers function wrapped by the provided FunctionRegistration with
|
||||
* this FunctionRegistry.
|
||||
*
|
||||
* @param registration instance of {@link FunctionRegistration}
|
||||
* @param key the name of the function
|
||||
*/
|
||||
protected void register(FunctionRegistration<?> registration, String key) {
|
||||
Object target = registration.getTarget();
|
||||
this.addName(target, key);
|
||||
if (registration.getType() != null) {
|
||||
|
||||
@@ -110,7 +110,7 @@ public class ContextFunctionCatalogAutoConfiguration {
|
||||
public <T> void register(FunctionRegistration<T> functionRegistration) {
|
||||
Assert.notEmpty(functionRegistration.getNames(),
|
||||
"'registration' must contain at least one name before it is registered in catalog.");
|
||||
wrap(functionRegistration, functionRegistration.getNames().iterator().next());
|
||||
register(functionRegistration, functionRegistration.getNames().iterator().next());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -256,7 +256,7 @@ public class ContextFunctionCatalogAutoConfiguration {
|
||||
}
|
||||
});
|
||||
|
||||
registrations.forEach(registration -> wrap(registration,
|
||||
registrations.forEach(registration -> register(registration,
|
||||
targets.get(registration.getTarget())));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user