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);
}
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();
}
}
}
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;
}
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);
}
}
}
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());
}
}
}
Aggregations