in geronimo-transaction/src/main/java/org/apache/geronimo/transaction/log/HOWLLog.java [278:303]
public Object prepare(Xid xid, List<? extends TransactionBranchInfo> branches) throws LogException {
int branchCount = branches.size();
byte[][] data = new byte[3 + 2 * branchCount][];
data[0] = intToBytes(xid.getFormatId());
data[1] = xid.getGlobalTransactionId();
data[2] = xid.getBranchQualifier();
int i = 3;
for (TransactionBranchInfo transactionBranchInfo : branches) {
data[i++] = transactionBranchInfo.getBranchXid().getBranchQualifier();
data[i++] = transactionBranchInfo.getResourceName().getBytes();
}
try {
XACommittingTx committingTx = logger.putCommit(data);
return committingTx;
} catch (LogClosedException e) {
throw (IllegalStateException) new IllegalStateException().initCause(e);
} catch (LogRecordSizeException e) {
throw (IllegalStateException) new IllegalStateException().initCause(e);
} catch (LogFileOverflowException e) {
throw (IllegalStateException) new IllegalStateException().initCause(e);
} catch (InterruptedException e) {
throw (IllegalStateException) new IllegalStateException().initCause(e);
} catch (IOException e) {
throw new LogException(e);
}
}