@Override
public Set<ComputedValue> execute(final FunctionExecutionContext executionContext, final FunctionInputs inputs, final ComputationTarget target,
final Set<ValueRequirement> desiredValues) throws AsynchronousExecution {
final ValueRequirement desiredValue = Iterables.getOnlyElement(desiredValues);
final String name = desiredValue.getConstraint(CURRENCY_PAIRS_NAME);
@SuppressWarnings("deprecation")
final CurrencyPairsSource ccyPairsSource = OpenGammaExecutionContext.getCurrencyPairsSource(executionContext);
final CurrencyPairs currencyPairs = ccyPairsSource.getCurrencyPairs(name);
if (currencyPairs == null) {
throw new OpenGammaRuntimeException("Could not get CurrencyPairs called " + CurrencyPairs.DEFAULT_CURRENCY_PAIRS);
}
return Collections.singleton(new ComputedValue(new ValueSpecification(ValueRequirementNames.CURRENCY_PAIRS, ComputationTargetSpecification.NULL,
createValueProperties().with(CURRENCY_PAIRS_NAME, name).get()), currencyPairs));