Object value = script.run();
return exchange.getContext().getTypeConverter().convertTo(type, value);
}
private void configure(Exchange exchange, Script script) {
final Binding binding = script.getBinding();
ExchangeHelper.populateVariableMap(exchange, new AbstractMap<String, Object>() {
@Override
public Object put(String key, Object value) {
binding.setProperty(key, value);
return null;
}
@SuppressWarnings("unchecked")
@Override