public Object sendMessage(Message msg, int mode, long timeout) throws TimeoutException, SuspectedException {
Vector mbrs=new Vector();
RspList rsp_list=null;
Object dest=msg.getDest();
Rsp rsp;
GroupRequest _req=null;
if(dest == null) {
System.out.println("MessageProtocol.sendMessage(): the message's destination is null ! " +
"Cannot send message !");
return null;
}
mbrs.addElement(dest); // dummy membership (of destination address)
_req=new GroupRequest(msg, _corr, mbrs, mode, timeout, 0);
try {
_req.execute();
}
catch(Exception e) {
throw new RuntimeException("failed executing request " + _req, e);
}
if(mode == GroupRequest.GET_NONE)
return null;
rsp_list=_req.getResults();
if(rsp_list.size() == 0) {
if(log.isErrorEnabled()) log.error("response list is empty");
return null;
}