Upgraded spring-cloud-task to 2.1.1
pllished some code and javadoc in AbstractComposableFunctionRegistry
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -20,7 +20,7 @@
|
|||||||
<java.version>1.8</java.version>
|
<java.version>1.8</java.version>
|
||||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||||
<spring-cloud-task.version>2.1.0.RELEASE</spring-cloud-task.version>
|
<spring-cloud-task.version>2.1.1.RELEASE</spring-cloud-task.version>
|
||||||
<wrapper.version>1.0.21.RELEASE</wrapper.version>
|
<wrapper.version>1.0.21.RELEASE</wrapper.version>
|
||||||
<docs.main>spring-cloud-function</docs.main>
|
<docs.main>spring-cloud-function</docs.main>
|
||||||
<maven-checkstyle-plugin.failsOnError>true</maven-checkstyle-plugin.failsOnError>
|
<maven-checkstyle-plugin.failsOnError>true</maven-checkstyle-plugin.failsOnError>
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ public abstract class AbstractComposableFunctionRegistry implements FunctionRegi
|
|||||||
* @return immutable {@link Set} of available {@link Supplier} names.
|
* @return immutable {@link Set} of available {@link Supplier} names.
|
||||||
*/
|
*/
|
||||||
public Set<String> getSupplierNames() {
|
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.
|
* @return the count of all Suppliers, Function and Consumers currently registered.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@@ -184,7 +186,14 @@ public abstract class AbstractComposableFunctionRegistry implements FunctionRegi
|
|||||||
this.environment = environment;
|
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();
|
Object target = registration.getTarget();
|
||||||
this.addName(target, key);
|
this.addName(target, key);
|
||||||
if (registration.getType() != null) {
|
if (registration.getType() != null) {
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ public class ContextFunctionCatalogAutoConfiguration {
|
|||||||
public <T> void register(FunctionRegistration<T> functionRegistration) {
|
public <T> void register(FunctionRegistration<T> functionRegistration) {
|
||||||
Assert.notEmpty(functionRegistration.getNames(),
|
Assert.notEmpty(functionRegistration.getNames(),
|
||||||
"'registration' must contain at least one name before it is registered in catalog.");
|
"'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())));
|
targets.get(registration.getTarget())));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user