private void initInvocationChains() {
chains = new ArrayList<InvocationChain>();
InterfaceContract sourceContract = getBindingInterfaceContract();
// It's the service wire
RuntimeComponentService service = (RuntimeComponentService)getService();
RuntimeComponent serviceComponent = (RuntimeComponent)getComponent();
//InterfaceContract targetContract = getInterfaceContract();
// TODO - EPR - why is this looking at the component types. The endpoint should have the right interface contract by this time
InterfaceContract targetContract = getComponentTypeServiceInterfaceContract();
// setInterfaceContract(targetContract);
validateServiceInterfaceCompatibility();
for (Operation operation : sourceContract.getInterface().getOperations()) {
Operation targetOperation = interfaceContractMapper.map(targetContract.getInterface(), operation);
if (targetOperation == null) {
throw new ServiceRuntimeException("No matching operation for " + operation.getName()
+ " is found in service "
+ serviceComponent.getURI()
+ "#"
+ service.getName());
}
InvocationChain chain = new InvocationChainImpl(operation, targetOperation, false, phaseManager);
if (operation.isNonBlocking()) {
addNonBlockingInterceptor(chain);
}