// ensure the inbound MAPs are available in the partial response
// message (used to determine relatesTo etc.)
propogateReceivedMAPs(inMAPs, partialResponse);
partialResponse.put(Message.PARTIAL_RESPONSE_MESSAGE, Boolean.TRUE);
Destination target = inMessage.getDestination();
if (target == null) {
return;
}
try {
if (reference == null) {
reference = ContextUtils.getNoneEndpointReference();
}
exchange.setOutMessage(partialResponse);
Conduit backChannel = target.getBackChannel(inMessage,
partialResponse,
reference);
if (backChannel != null) {
// set up interceptor chains and send message
InterceptorChain chain =
fullResponse != null
? fullResponse.getInterceptorChain()
: OutgoingChainInterceptor.getOutInterceptorChain(exchange);
partialResponse.setInterceptorChain(chain);
exchange.put(ConduitSelector.class,
new PreexistingConduitSelector(backChannel,
exchange.get(Endpoint.class)));
if (chain != null && !chain.doIntercept(partialResponse)
&& partialResponse.getContent(Exception.class) != null) {
if (partialResponse.getContent(Exception.class) instanceof Fault) {
throw (Fault)partialResponse.getContent(Exception.class);
} else {
throw new Fault(partialResponse.getContent(Exception.class));
}
}
if (chain != null) {
chain.reset();
}
exchange.put(ConduitSelector.class, new NullConduitSelector());
if (fullResponse == null) {
fullResponse = createMessage(exchange);
}
exchange.setOutMessage(fullResponse);
Destination destination = createDecoupledDestination(
exchange,
reference);
exchange.setDestination(destination);