header2.addHeader(
MsgHeaderConstants.DEST_NODE_PATH,
NodeInfo.pop(path));
RemoteNode remoteNode = findRemoteNode(target);
if ( null == remoteNode ) {
throw new CommunicationException(target +
" has failed during a topology reconfiguration.");
}
out = remoteNode.getMsgConsumerOut();
} else {
// A path has not already been computed. Computes one.
NodeInfo src = (NodeInfo)
header2.getHeader(MsgHeaderConstants.SRC_NODE);
NodeTopology topo = markTopology(header2);
path = topo.getPath(src, target);
if (null == path) {
throw new CommunicationException("{" + target
+ "} is not reachable by {" + src +
"} in the topology " + topo);
}
RemoteNode remoteNode = findRemoteNode(path[0]);
if ( null == remoteNode ) {
throw new CommunicationException(path[0] +
" has failed during a topology reconfiguration.");
}
out = remoteNode.getMsgConsumerOut();
// Inserts the computed path and the new dests.