if (inboundWire != null) {
// if null, the target side has no interceptors or handlers
Map<Operation<?>, InboundInvocationChain> targetInvocationConfigs = inboundWire.getInvocationChains();
for (OutboundInvocationChain outboundInvocationConfig : outboundWire.getInvocationChains().values()) {
// match wire chains
InboundInvocationChain inboundInvocationConfig =
targetInvocationConfigs.get(outboundInvocationConfig.getOperation());
if (inboundInvocationConfig == null) {
BuilderConfigException e =
new BuilderConfigException("Incompatible source and target interface types for reference");
e.setIdentifier(outboundWire.getReferenceName());
throw e;
}
if (inboundInvocationConfig.getHeadInterceptor() == null) {
BuilderConfigException e =
new BuilderConfigException("No target handler or interceptor for operation");
e.setIdentifier(inboundInvocationConfig.getOperation().getName());
throw e;
}
if (!(outboundInvocationConfig.getTailInterceptor() instanceof InvokerInterceptor
&& inboundInvocationConfig.getHeadInterceptor() instanceof InvokerInterceptor)) {
// check that we do not have the case where the only interceptors are invokers since we just
// need one
outboundInvocationConfig.setTargetInterceptor(inboundInvocationConfig.getHeadInterceptor());
}
}
for (OutboundInvocationChain chain : outboundWire.getInvocationChains().values()) {
//FIXME should use target method, not outboundInvocationConfig.getMethod()