This commit is contained in:
Oleg Zhurakousky
2019-02-06 15:31:31 +01:00
parent 194858bf60
commit 632b2bf6ab

View File

@@ -216,10 +216,6 @@ public class ContextFunctionCatalogAutoConfiguration {
this.beanFactory = (ConfigurableListableBeanFactory) beanFactory;
}
public <T> void register(FunctionRegistration<T> function) {
wrap(function, function.getNames().iterator().next());
}
@PreDestroy
public void close() {
if (this.applicationEventPublisher != null) {
@@ -241,6 +237,10 @@ public class ContextFunctionCatalogAutoConfiguration {
}
}
<T> void register(FunctionRegistration<T> function) {
wrap(function, function.getNames().iterator().next());
}
FunctionRegistration<?> getRegistration(Object function) {
if (names.containsKey(function)) {
return new FunctionRegistration<>(function, this.names.get(function))
@@ -261,6 +261,20 @@ public class ContextFunctionCatalogAutoConfiguration {
return (Consumer<?>) lookup(name, this.consumers, Consumer.class);
}
// @checkstyle:off
/**
* @deprecated Was never intended for public use.
*/
@Deprecated
@SuppressWarnings("rawtypes")
Set<FunctionRegistration<?>> merge(Map<String, FunctionRegistration> initial,
Map<String, Consumer> consumers, Map<String, Supplier> suppliers,
Map<String, Function> functions) {
this.doMerge(initial, consumers, suppliers, functions);
return null;
}
// @checkstyle:on
@SuppressWarnings("unchecked")
private Object lookup(String name, @SuppressWarnings("rawtypes") Map lookup,
Class<?> typeOfFunction) {
@@ -276,20 +290,6 @@ public class ContextFunctionCatalogAutoConfiguration {
return null;
}
// @checkstyle:off
/**
* @deprecated Was never intended for public use.
*/
@Deprecated
@SuppressWarnings("rawtypes")
Set<FunctionRegistration<?>> merge(Map<String, FunctionRegistration> initial,
Map<String, Consumer> consumers, Map<String, Supplier> suppliers,
Map<String, Function> functions) {
this.doMerge(initial, consumers, suppliers, functions);
return null;
}
// @checkstyle:on
private String normalizeName(String name) {
return name.replaceAll(",", "|").trim();
}