Search in sources :

Example 26 with AbstractRecord

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

the class RecoveredTransaction method addResourceRecord.

/**
 * Allows a new Resource to be added to the transaction. Typically this is
 * used to replace a Resource that has failed and cannot be recovered on
 * it's original IOR.
 */
public void addResourceRecord(Uid rcUid, Resource r) {
    Coordinator coord = null;
    AbstractRecord corbaRec = createOTSRecord(true, r, coord, rcUid);
    addRecord(corbaRec);
}
Also used : AbstractRecord(com.arjuna.ats.arjuna.coordinator.AbstractRecord) Coordinator(org.omg.CosTransactions.Coordinator)

Example 27 with AbstractRecord

use of com.arjuna.ats.arjuna.coordinator.AbstractRecord 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 28 with AbstractRecord

use of com.arjuna.ats.arjuna.coordinator.AbstractRecord 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 29 with AbstractRecord

use of com.arjuna.ats.arjuna.coordinator.AbstractRecord 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 30 with AbstractRecord

use of com.arjuna.ats.arjuna.coordinator.AbstractRecord 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)

Aggregations

AbstractRecord (com.arjuna.ats.arjuna.coordinator.AbstractRecord)31 RecordListIterator (com.arjuna.ats.arjuna.coordinator.RecordListIterator)10 Coordinator (org.omg.CosTransactions.Coordinator)5 RecordTypeMap (com.arjuna.ats.arjuna.coordinator.abstractrecord.RecordTypeMap)4 OTSAbstractRecord (com.arjuna.ArjunaOTS.OTSAbstractRecord)3 AtomicAction (com.arjuna.ats.arjuna.AtomicAction)3 Uid (com.arjuna.ats.arjuna.common.Uid)3 BasicAction (com.arjuna.ats.arjuna.coordinator.BasicAction)3 LastResourceRecord (com.arjuna.ats.internal.arjuna.abstractrecords.LastResourceRecord)3 BAD_PARAM (org.omg.CORBA.BAD_PARAM)3 UidCoordinator (com.arjuna.ArjunaOTS.UidCoordinator)2 IOException (java.io.IOException)2 Enumeration (java.util.Enumeration)2 Test (org.junit.Test)2 SystemException (org.omg.CORBA.SystemException)2 TRANSACTION_ROLLEDBACK (org.omg.CORBA.TRANSACTION_ROLLEDBACK)2 UNKNOWN (org.omg.CORBA.UNKNOWN)2 Inactive (org.omg.CosTransactions.Inactive)2 RecoveryCoordinator (org.omg.CosTransactions.RecoveryCoordinator)2 SubtransactionsUnavailable (org.omg.CosTransactions.SubtransactionsUnavailable)2