Search in sources :

Example 1 with PrepareLogRecord

use of com.swiftmq.swiftlet.store.PrepareLogRecord in project swiftmq-ce by iitsoftware.

the class XAResourceManagerSwiftletImpl method buildPreparedTransactions.

private void buildPreparedTransactions() throws Exception {
    List prepareRecordList = ctx.storeSwiftlet.getPrepareLogRecords();
    if (ctx.traceSpace.enabled)
        ctx.traceSpace.trace(getName(), "buildPreparedTransactions, recordList: " + prepareRecordList);
    if (prepareRecordList != null && prepareRecordList.size() > 0) {
        for (int i = 0; i < prepareRecordList.size(); i++) {
            PrepareLogRecord record = (PrepareLogRecord) prepareRecordList.get(i);
            AbstractQueue queue = getPreparedQueue(record.getQueueName());
            if (queue != null) {
                XidImpl xid = record.getGlobalTxId();
                Object localTxId = queue.buildPreparedTransaction(record);
                XALiveContextImpl xac = (XALiveContextImpl) contexts.get(xid);
                if (xac == null) {
                    xac = new XALiveContextImpl(ctx, xid, true);
                    xac.setRecovered(true);
                    xac.registerUsageList();
                    contexts.put(xid, xac);
                }
                xac._addTransaction(queue, localTxId);
            }
        }
    }
}
Also used : PrepareLogRecord(com.swiftmq.swiftlet.store.PrepareLogRecord) AbstractQueue(com.swiftmq.swiftlet.queue.AbstractQueue) XidImpl(com.swiftmq.jms.XidImpl)

Aggregations

XidImpl (com.swiftmq.jms.XidImpl)1 AbstractQueue (com.swiftmq.swiftlet.queue.AbstractQueue)1 PrepareLogRecord (com.swiftmq.swiftlet.store.PrepareLogRecord)1