for (Binding binding : service.getBindings()) {
// TODO - we should look at all the bindings now associated with the
// unresolved target but we assume the SCA binding here as
// its currently the only wireable one
if (binding instanceof OptimizableBinding) {
OptimizableBinding scaBinding = (OptimizableBinding)binding;
// clone the SCA binding and fill in service details
// its cloned as each target
SCABinding clonedSCABinding = null;
try {
clonedSCABinding = (SCABinding)((OptimizableBinding)scaBinding).clone();
clonedSCABinding.setURI(service.getName());
// wireable binding stuff needs to go. SCA binding uses it
// currently to get to the service to work out if the service
// is resolved.
OptimizableBinding endpoint = ((OptimizableBinding)clonedSCABinding);
endpoint.setTargetComponentService(service);
//endpoint.setTargetComponent(component); - not known for unresolved target
//endpoint.setTargetBinding(serviceBinding); - not known for unresolved target
// add the cloned SCA binding to the reference as it will be used to look up the
// provider later