command.setMembershipManager(membershipManager);
command.execute(null);
} catch (ClusteringFault e) {
String errMsg = "Cannot handle MEMBER_JOINED notification";
log.error(errMsg, e);
throw new RemoteProcessException(errMsg, e);
}
} else if (msg instanceof MemberListCommand) {
try { //TODO: What if we receive more than one member list message?
log.info("Received MEMBER_LIST message from " + TribesUtil.getName(sender));
MemberListCommand command = (MemberListCommand) msg;
command.setMembershipManager(membershipManager);
command.execute(null);
return "Processed MEMBER_LIST message";
//TODO Send MEMBER_JOINED messages to all nodes
} catch (ClusteringFault e) {
String errMsg = "Cannot handle MEMBER_LIST message from " +
TribesUtil.getName(sender);
log.error(errMsg, e);
throw new RemoteProcessException(errMsg, e);
}
}
return null;
}