chore: remove workaround for runtime registry as issue has been fixed upstream
*/
package org.apache.camel.quarkus.core;
-import java.util.LinkedHashSet;
-import java.util.Set;
-
import io.quarkus.runtime.RuntimeValue;
-import org.apache.camel.spi.BeanRepository;
import org.apache.camel.support.DefaultRegistry;
public class RuntimeRegistry extends DefaultRegistry {
@@ -34,36 +30,4 @@ public class RuntimeRegistry extends DefaultRegistry {
? ((RuntimeValue)value).getValue()
: value;
}
-
- //
- // DefaultRegistry does not merge results from the repositories
- // and fallback registry so in case beans are bound to the local
- // registry only but any of the configured repositories returns
- // a non null answer, then the local values are not taken into
- // account for the final answer.
- //
- // TODO: fix upstream and remove this method
- //
- @Override
- public <T> Set<T> findByType(Class<T> type) {
- final Set<T> answer = new LinkedHashSet<>();
-
- if (repositories != null) {
- for (BeanRepository r : repositories) {
- Set<T> instances = r.findByType(type);
- if (instances != null && !instances.isEmpty()) {
- answer.addAll(instances);
- }
- }
- }
-
- Set<T> instances = fallbackRegistry.findByType(type);
- if (instances != null && !instances.isEmpty()) {
- for (T instance: instances) {
- answer.add((T)unwrap(instance));
- }
- }
-
- return answer;
- }
}
