}
public void handleJoin(MemberHandle member) throws AMQException
{
_logger.info(new LogMessage("Handling join request for {0}", member));
if(isLeader())
{
//connect to the host and port specified:
Broker prospect = connectToProspect(member);
announceMembership();
List<AMQMethodBody> msgs = _replayMgr.replay(true);
_logger.info(new LogMessage("Replaying {0} from leader to {1}", msgs, prospect));
prospect.replay(msgs);
}
else
{
//pass request on to leader:
// AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
// TODO: Connect this to the session version obtained from ProtocolInitiation for this session.
ClusterJoinBody request = new ClusterJoinBody((byte)8, (byte)0,
ClusterJoinBody.getClazz((byte)8, (byte)0),
ClusterJoinBody.getMethod((byte)8, (byte)0),
member.getDetails());
Broker leader = getLeader();
send(leader, new SimpleBodySendable(request));
_logger.info(new LogMessage("Passed join request for {0} to {1}", member, leader));
}
}