Search in sources :

Example 6 with RecordListIterator

use of com.arjuna.ats.arjuna.coordinator.RecordListIterator in project narayana by jbosstm.

the class RecoveryBACoordinator method setRecoveryCoordinator.

/**
 * provide the recovered participants with a handle on this coordinator so they can
 * propagate events through to it.
 */
public void setRecoveryCoordinator() {
    if (preparedList != null) {
        RecordListIterator iter = new RecordListIterator(preparedList);
        AbstractRecord absRec = iter.iterate();
        while (absRec != null) {
            if (absRec instanceof ParticipantRecord) {
                ParticipantRecord pr = (ParticipantRecord) absRec;
            }
            absRec = iter.iterate();
        }
    }
}
Also used : RecordListIterator(com.arjuna.ats.arjuna.coordinator.RecordListIterator) AbstractRecord(com.arjuna.ats.arjuna.coordinator.AbstractRecord) ParticipantRecord(com.arjuna.mwlabs.wscf.model.sagas.arjunacore.ParticipantRecord)

Example 7 with RecordListIterator

use of com.arjuna.ats.arjuna.coordinator.RecordListIterator in project narayana by jbosstm.

the class RecoveringTransaction method getParticipants.

public List<RESTRecord> getParticipants(List<RESTRecord> participants) {
    RecordListIterator iter = new RecordListIterator(preparedList);
    AbstractRecord recordBeingHandled;
    while (((recordBeingHandled = iter.iterate()) != null)) {
        if (recordBeingHandled.activate()) {
            if (recordBeingHandled.typeIs() == RecordType.RESTAT_RECORD) {
                participants.add((RESTRecord) recordBeingHandled);
            } else {
                log.warnf("Could not reactivate participant %s of transaction %s", recordBeingHandled.get_uid(), get_uid());
            }
        }
    }
    return participants;
}
Also used : RecordListIterator(com.arjuna.ats.arjuna.coordinator.RecordListIterator) AbstractRecord(com.arjuna.ats.arjuna.coordinator.AbstractRecord)

Example 8 with RecordListIterator

use of com.arjuna.ats.arjuna.coordinator.RecordListIterator in project narayana by jbosstm.

the class Transaction method savePendingList.

private void savePendingList() {
    if (pendingList == null || pending != null)
        return;
    RecordListIterator i = new RecordListIterator(pendingList);
    AbstractRecord r;
    pending = new ArrayList<>();
    while ((r = i.iterate()) != null) {
        if (r instanceof LRARecord) {
            pending.add((LRARecord) r);
        }
    }
}
Also used : RecordListIterator(com.arjuna.ats.arjuna.coordinator.RecordListIterator) AbstractRecord(com.arjuna.ats.arjuna.coordinator.AbstractRecord)

Example 9 with RecordListIterator

use of com.arjuna.ats.arjuna.coordinator.RecordListIterator in project narayana by jbosstm.

the class Transaction method getRecoveryCoordinatorUrls.

public void getRecoveryCoordinatorUrls(Map<String, String> participants, RecordList list) {
    RecordListIterator iter = new RecordListIterator(list);
    AbstractRecord rec;
    while (((rec = iter.iterate()) != null)) {
        if (rec instanceof LRARecord) {
            // rec.typeIs() == LRARecord.getTypeId()) {
            LRARecord lraRecord = (LRARecord) rec;
            participants.put(lraRecord.getRecoveryCoordinatorURL().toExternalForm(), lraRecord.getParticipantPath());
        }
    }
}
Also used : RecordListIterator(com.arjuna.ats.arjuna.coordinator.RecordListIterator) AbstractRecord(com.arjuna.ats.arjuna.coordinator.AbstractRecord)

Example 10 with RecordListIterator

use of com.arjuna.ats.arjuna.coordinator.RecordListIterator in project narayana by jbosstm.

the class RecoveringLRA method moveTo.

private void moveTo(RecordList fromList, RecordList toList) {
    RecordListIterator i = new RecordListIterator(fromList);
    AbstractRecord record;
    while ((record = fromList.getFront()) != null) toList.putFront(record);
}
Also used : RecordListIterator(com.arjuna.ats.arjuna.coordinator.RecordListIterator) AbstractRecord(com.arjuna.ats.arjuna.coordinator.AbstractRecord)

Aggregations

AbstractRecord (com.arjuna.ats.arjuna.coordinator.AbstractRecord)10 RecordListIterator (com.arjuna.ats.arjuna.coordinator.RecordListIterator)10 ParticipantRecord (com.arjuna.mwlabs.wscf.model.sagas.arjunacore.ParticipantRecord)1