}
//Caller must ensure this is the transaction home broker
private void sendClusterTransactionInfo(TransactionUID tid, BrokerAddress to, Long xid) {
TransactionList translist = Globals.getTransactionList();
TransactionState ts = translist.retrieveState(tid, true);
BrokerAddress[] parties = null;
BrokerAddress[] waitfor = null;
TransactionBroker[] brokers = null;
if (ts != null) {
try {
brokers = translist.getClusterTransactionBrokers(tid);
} catch (Exception e) {
logger.log(logger.WARNING, "Can't retrieve cluster transaction brokers:"+ e.getMessage());
}
if (brokers == null) {
logger.log(logger.WARNING, "No cluster transaction brokers information for TID="+ tid);
} else {
parties = new BrokerAddress[brokers.length];
ArrayList waits = new ArrayList();
for (int i = 0; i < brokers.length; i++) {
parties[i] = brokers[i].getBrokerAddress();
if (!brokers[i].isCompleted()) waits.add(brokers[i].getBrokerAddress());
}
if (waits.size() > 0) waitfor = (BrokerAddress[])waits.toArray(new BrokerAddress[0]);
}
}
ClusterTxnInfoInfo ii = ClusterTxnInfoInfo.newInstance(new Long(tid.longValue()),
(ts == null ? TransactionState.NULL: ts.getState()),
parties, waitfor, Globals.getMyAddress(),
true, c, xid);
if (DEBUG_CLUSTER_TXN) {
logger.log(logger.INFO, Globals.getBrokerResources().getString(
BrokerResources.I_SEND_CLUSTER_TXN_INFO, to.toString(), ii.toString()));