for (Map.Entry<Xid, Long> entry : xidsSortedByCreationTime)
{
Xid xid = entry.getKey();
TransactionDetail detail = new JMSTransactionDetail(xid, resourceManager.getTransaction(xid), entry.getValue());
JSONObject txJson = detail.toJSON();
html.append("<table border=\"1\">");
html.append("<tr><th>creation_time</th>");
html.append("<td>" + txJson.get(TransactionDetail.KEY_CREATION_TIME) + "</td>");
html.append("<th>xid_as_base_64</th>");
html.append("<td colspan=\"3\">" + txJson.get(TransactionDetail.KEY_XID_AS_BASE64) + "</td></tr>");
html.append("<tr><th>xid_format_id</th>");
html.append("<td>" + txJson.get(TransactionDetail.KEY_XID_FORMAT_ID) + "</td>");
html.append("<th>xid_global_txid</th>");
html.append("<td>" + txJson.get(TransactionDetail.KEY_XID_GLOBAL_TXID) + "</td>");
html.append("<th>xid_branch_qual</th>");
html.append("<td>" + txJson.get(TransactionDetail.KEY_XID_BRANCH_QUAL) + "</td></tr>");
html.append("<tr><th colspan=\"6\">Message List</th></tr>");
html.append("<tr><td colspan=\"6\">");
html.append("<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\">");
JSONArray msgs = txJson.getJSONArray(TransactionDetail.KEY_TX_RELATED_MESSAGES);
for (int i = 0; i < msgs.length(); i++)
{
JSONObject msgJson = msgs.getJSONObject(i);
JSONObject props = msgJson.getJSONObject(TransactionDetail.KEY_MSG_PROPERTIES);
StringBuilder propstr = new StringBuilder();
@SuppressWarnings("unchecked")
Iterator<String> propkeys = props.keys();
while (propkeys.hasNext())
{
String key = propkeys.next();
propstr.append(key);
propstr.append("=");
propstr.append(props.get(key));
propstr.append(", ");
}
html.append("<th>operation_type</th>");
html.append("<td>" + msgJson.get(TransactionDetail.KEY_MSG_OP_TYPE) + "</th>");