protected C setConfigurationProperties(C configuration, Map<String, Object> parameters) throws Exception {
Map<String, Object> configs = IntrospectionSupport.extractProperties(parameters, "resource.config.");
for (Map.Entry<String, Object> entry : configs.entrySet()) {
String ref = (String)entry.getValue();
if (!EndpointHelper.isReferenceParameter(ref)) {
throw new IllegalArgumentException("The option resource.config." + ref + " should be a reference");
}
configuration.addResourceConfig(
entry.getKey(),
EndpointHelper.resolveReferenceParameter(getCamelContext(), ref, Properties.class));
}
Map<String, Object> options = IntrospectionSupport.extractProperties(parameters, "resource.options.");
for (Map.Entry<String, Object> entry : options.entrySet()) {
String ref = (String)entry.getValue();
if (!EndpointHelper.isReferenceParameter(ref)) {
throw new IllegalArgumentException("The option resource.options." + ref + " should be a reference");
}
configuration.addResourceOption(
entry.getKey(),
EndpointHelper.resolveReferenceParameter(getCamelContext(), ref, Properties.class));
}
setProperties(configuration, parameters);
return configuration;
}