header.addHeader(MsgHeaderConstants.BODY_TYPE, MsgBody.Type.REQUEST);
header.addHeader(MsgHeaderConstants.TOPOLOGY_VERSION, new Integer(0));
msg.getBody().setContent(localNodeInfo);
final FutureResult result = new FutureResult();
setMsgProducerOut(new MsgOutInterceptor() {
public void push(Msg aMsg) {
result.set(aMsg);
}
});
getMsgConsumerOut().push(msg);
Msg reply;
try {
// waits 3 seconds for a reply.
reply = (Msg) result.get();
reply = (Msg) result.timedGet(3000);
} catch (TimeoutException e) {
throw new NodeException("Join request submitted by " +
localNodeInfo + " to " + remoteNodeInfo + " has timed out.");
} catch (InterruptedException e) {
throw new NodeException(e);