if ( members.length == 0 || firstIdx == -1 ) return backup;
boolean success = false;
do {
//select a backup node
Member next = members[nextIdx];
//increment for the next round of back up selection
nextIdx = nextIdx + 1;
if ( nextIdx >= members.length ) nextIdx = 0;
if (next == null) {
continue;
}
MapMessage msg = null;
try {
backup = wrap(next);
//publish the backup data to one node
msg = new MapMessage(getMapContextName(), MapMessage.MSG_BACKUP, false,
(Serializable) key, (Serializable) value, null, channel.getLocalMember(false), backup);
if ( log.isTraceEnabled() )
log.trace("Publishing backup data:"+msg+" to: "+next.getName());
UniqueId id = getChannel().send(backup, msg, getChannelSendOptions());
if ( log.isTraceEnabled() )
log.trace("Data published:"+msg+" msg Id:"+id);
//we published out to a backup, mark the test success
success = true;