// create wire if binding has an endpoint
Component targetComponent = null;
ComponentService targetComponentService = null;
Binding targetBinding = null;
if (binding instanceof OptimizableBinding) {
OptimizableBinding endpoint = (OptimizableBinding)binding;
targetComponent = endpoint.getTargetComponent();
targetComponentService = endpoint.getTargetComponentService();
targetBinding = endpoint.getTargetBinding();
}
// create a forward wire, either static or dynamic
addReferenceWire(component, reference, binding, targetComponent, targetComponentService, targetBinding);