protected Component getComponent(String name, CamelContext context) throws Exception {
LOG.trace("Finding Component: {}", name);
try {
ServiceReference[] refs = bundleContext.getServiceReferences(ComponentResolver.class.getName(), "(component=" + name + ")");
if (refs != null && refs.length > 0) {
ComponentResolver resolver = (ComponentResolver) bundleContext.getService(refs[0]);
return resolver.resolveComponent(name, context);
}
return null;
} catch (InvalidSyntaxException e) {
throw ObjectHelper.wrapRuntimeCamelException(e);
}