for (ReferenceTarget referenceTarget : definition.getReferenceTargets().values()) {
Map<String, ? extends ReferenceDefinition> references = componentType.getReferences();
ReferenceDefinition mappedReference = references.get(referenceTarget.getReferenceName());
if (mappedReference == null) {
String refName = referenceTarget.getReferenceName();
ReferenceNotFoundException e = new ReferenceNotFoundException(refName);
e.addContextName(refName);
e.addContextName(definition.getName());
throw e;
}
OutboundWire wire = createWire(referenceTarget, mappedReference);
wire.setContainer(component);
component.addOutboundWire(wire);