if (!aList.isEmpty()) {
//Set the headings for the tabular output
int componentNameLength = COLUMN_LENGTH;
int txIdLength = COLUMN_LENGTH + 15;
for (int i=0; i < aList.size(); i++) {
TransactionAdminBean txnBean = (TransactionAdminBean)aList.get(i);
String componentName = txnBean.getComponentName();
if (componentName.length() > componentNameLength) {
componentNameLength = componentName.length() + 1;
}
String txnId = txnBean.getId();
if (txnId.length() > txIdLength) {
txIdLength = txnId.length() + 1;
}
}
if (aList.size() > 0) {
strBuf.append(LINE_BREAK).append(LINE_BREAK);
appendColumn(strBuf, "Transaction Id", txIdLength);
appendColumn(strBuf, "Status", COLUMN_LENGTH);
appendColumn(strBuf, "ElapsedTime(ms)", COLUMN_LENGTH);
appendColumn(strBuf, "ComponentName", componentNameLength);
strBuf.append("ResourceNames ").append(LINE_BREAK);
}
for (int i=0; i < aList.size(); i++) {
TransactionAdminBean txnBean = (TransactionAdminBean)aList.get(i);
String txnId = txnBean.getId();
_logger.fine("=== Processing txnId: " + txnId);
appendColumn(strBuf, txnId, txIdLength);
appendColumn(strBuf, txnBean.getStatus(), COLUMN_LENGTH);
appendColumn(strBuf, String.valueOf(txnBean.getElapsedTime()), COLUMN_LENGTH);
appendColumn(strBuf, txnBean.getComponentName(), componentNameLength);
List<String> resourceList = txnBean.getResourceNames();
if (resourceList != null) {
for (int k = 0; k < resourceList.size(); k++) {
if (k != 0) strBuf.append(",");
strBuf.append(resourceList.get(k));
}