public boolean isTargetRemote() {
boolean targetIsRemote = false;
// first look at the target service and see if this has been resolved
OptimizableBinding optimizableBinding = (OptimizableBinding)binding;
// The decision is based on the results of the wiring process in the assembly model
// The SCA binding is used to represent unresolved reference targets, i.e. those
// reference targets that need resolving at run time. We can tell by lookin if the
// service to which this binding refers is resolved or not.
//
// TODO - When a callback is in operation. A callback reference bindings sometimes has to
// act as though there is a local wire and sometimes as if there is a remote wire
// what are the implications of this here?
if (RemoteBindingHelper.isTargetRemote()) {
if (reference.getInterfaceContract() != null) {
targetIsRemote = reference.getInterfaceContract().getInterface().isRemotable();
} else {
targetIsRemote = true;
}
} else if (optimizableBinding.getTargetComponentService() != null) {
if (optimizableBinding.getTargetComponentService().isUnresolved() == true) {
targetIsRemote = true;
} else {
targetIsRemote = false;
}
} else {