}
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:
ClusterJoinBody request = new ClusterJoinBody();
request.broker = member.getDetails();
Broker leader = getLeader();
send(leader, new SimpleSendable(request));
_logger.info(new LogMessage("Passed join request for {0} to {1}", member, leader));
}
}