if (isBufferable(msg))
{
MemberHandle peer = ClusteredProtocolSession.getSessionPeer(session);
if (peer == null)
{
_logger.debug(new LogMessage("Buffering {0} for client", msg));
_clientBuffer.receive(session, msg);
}
else if (inState(JoinState.JOINING) && isMembershipAnnouncement(msg))
{
_logger.debug(new LogMessage("Initial membership [{0}] received from {1}", msg, peer));
super.messageReceived(session, msg);
}
else if (inState(JoinState.INITIATION) && _groupMgr.isLeader(peer))
{
_logger.debug(new LogMessage("Replaying {0} from leader ", msg));
super.messageReceived(session, msg);
}
else if (inState(JoinState.INDUCTION))
{
_logger.debug(new LogMessage("Replaying {0} from peer {1}", msg, peer));
super.messageReceived(session, msg);
}
else
{
_logger.debug(new LogMessage("Buffering {0} for peer {1}", msg, peer));
_peerBuffer.receive(session, msg);
}
}
else
{
_logger.debug(new LogMessage("Received {0}", msg));
super.messageReceived(session, msg);
}
}