info=(StateTransferInfo)evt.getArg();
coord=determineCoordinator();
if(coord == null || coord.equals(local_addr)) {
event_list=new Vector(1);
event_list.addElement(new Event(Event.GET_STATE_OK, new StateTransferInfo()));
passUp(new Event(Event.STOP_QUEUEING, event_list));
return; // don't pass down any further !
}
try {
sendMakeCopyMessage(); // multicast MAKE_COPY to all members (including me)
state=getStateFromSingle(info.target);
}
catch(Throwable t) {
if(log.isErrorEnabled())
log.error("failed sending state request", t);
state=null;
}
/* Pass up the state to the application layer (insert into JChannel's event queue */
event_list=new Vector(1);
event_list.addElement(new Event(Event.GET_STATE_OK, new StateTransferInfo(null, info.state_id, 0L, (byte[])state)));
/* Now stop queueing */
passUp(new Event(Event.STOP_QUEUEING, event_list));
return; // don't pass down any further !
case Event.GET_APPLSTATE_OK:
synchronized(state_xfer_mutex) {
info=(StateTransferInfo)evt.getArg();