protected DataFormat getDataFormat(String name, CamelContext context) {
LOG.trace("Finding DataFormat: {}", name);
try {
ServiceReference[] refs = bundleContext.getServiceReferences(DataFormatResolver.class.getName(), "(dataformat=" + name + ")");
if (refs != null && refs.length > 0) {
DataFormatResolver resolver = (DataFormatResolver) bundleContext.getService(refs[0]);
return resolver.resolveDataFormat(name, context);
}
return null;
} catch (InvalidSyntaxException e) {
throw ObjectHelper.wrapRuntimeCamelException(e);
}