return server.getHornetQServerControl().listSessions(connectionID);
}
public String listPreparedTransactionDetailsAsJSON() throws Exception
{
ResourceManager resourceManager = server.getResourceManager();
Map<Xid, Long> xids = resourceManager.getPreparedTransactionsWithCreationTime();
if (xids == null || xids.size() == 0)
{
return "";
}
ArrayList<Entry<Xid, Long>> xidsSortedByCreationTime = new ArrayList<Map.Entry<Xid, Long>>(xids.entrySet());
Collections.sort(xidsSortedByCreationTime, new Comparator<Entry<Xid, Long>>()
{
public int compare(final Entry<Xid, Long> entry1, final Entry<Xid, Long> entry2)
{
// sort by creation time, oldest first
return (int)(entry1.getValue() - entry2.getValue());
}
});
JSONArray txDetailListJson = new JSONArray();
for (Map.Entry<Xid, Long> entry : xidsSortedByCreationTime)
{
Xid xid = entry.getKey();
Transaction tx = resourceManager.getTransaction(xid);
if (tx == null)
{
continue;
}
TransactionDetail detail = new JMSTransactionDetail(xid, tx, entry.getValue());