// lets see what other components are registered on camel context
List<String> names = camelContext.getComponentNames();
for (String name : names) {
if (!map.containsKey(name)) {
Component component = camelContext.getComponent(name);
if (component != null) {
Properties properties = new Properties();
properties.put("component", component);
properties.put("class", component.getClass().getName());
properties.put("name", name);
// override default component if name clash
map.put(name, properties);
}
}
}
// lets see what other components are in the registry
Map<String, Component> beanMap = camelContext.getRegistry().findByTypeWithName(Component.class);
Set<Map.Entry<String, Component>> entries = beanMap.entrySet();
for (Map.Entry<String, Component> entry : entries) {
String name = entry.getKey();
if (!map.containsKey(name)) {
Component component = entry.getValue();
if (component != null) {
Properties properties = new Properties();
properties.put("component", name);
properties.put("class", component.getClass().getName());
properties.put("name", name);
map.put(name, properties);
}
}
}