/** * Create a new BaseReference from the specified config model. * * @param referenceConfig the composite reference config. * @param application the application containing the service. */ public BaseReference(CompositeReferenceModel referenceConfig, BaseApplication application) { _name = referenceConfig.getQName(); _application = application; if (referenceConfig.getInterface() != null) { _referenceInterface = referenceConfig.getInterface().getInterface(); } _promotedReference = referenceConfig.getPromote(); _gateways = new LinkedHashMap<String, Binding>(); int idx = 0; for (BindingModel bindingModel : referenceConfig.getBindings()) { // Generate binding name for now until tooling and config are updated to expose it ++idx; String name = bindingModel.getName() == null ? "_" + _name.getLocalPart() + "_" + bindingModel.getType() + "_" + idx : bindingModel.getName(); _gateways.put(name, new BaseBinding(_application, _name, bindingModel.getType(), name, bindingModel.toString())); } _operations = new LinkedList<ServiceOperation>(); for (org.switchyard.metadata.ServiceOperation so : getInterfaceOperations(referenceConfig.getInterface())) { _operations.add(new BaseServiceOperation(so.getName(), so.getExchangePattern().name(), so.getInputType(), so.getOutputType(), so.getFaultType())); } }