use of com.arjuna.mwlabs.wscf.model.twophase.arjunacore.subordinate.SubordinateATCoordinator in project narayana by jbosstm.
the class BridgeWrapper method recover.
/**
* recreate a wrapper for a bridged-to WS-AT 1.1 transaction recovered from the log
* @param identifier the identifier of a previously created bridged-to transaction
* @return a wrapper for the bridged-to transaction or null if it may still be awaiting recovery
* @throws UnknownTransactionException if recovery has been performed and no transaction with the
* given identifier has been found in the log
*/
public static BridgeWrapper recover(String identifier) throws UnknownTransactionException {
SubordinateATCoordinator coordinator = SubordinateATCoordinator.getRecoveredCoordinator(identifier);
if (coordinator != null) {
BridgeWrapper bridgeWrapper = new BridgeWrapper();
bridgeWrapper.context = null;
bridgeWrapper.coordinator = coordinator;
bridgeWrapper.id = identifier;
bridgeWrapper.subordinateType = coordinator.getSubordinateType();
return bridgeWrapper;
} else {
XTSATRecoveryManager recoveryManager = XTSATRecoveryManager.getRecoveryManager();
if (recoveryManager != null && recoveryManager.isCoordinatorRecoveryStarted()) {
throw new UnknownTransactionException();
} else {
return null;
}
}
}
use of com.arjuna.mwlabs.wscf.model.twophase.arjunacore.subordinate.SubordinateATCoordinator in project narayana by jbosstm.
the class XTSATRecoveryManagerImple method cullOrphanedSubordinates.
/**
* look for recovered subordinate transactions which do not have an associated proxy participant
* rolling back any that are found. this only needs doing once after the first participant and
* subordinate transaction recovery passes have both completed
*/
private void cullOrphanedSubordinates() {
if (culledOrphanSubordinates || !(subordinateCoordinatorRecoveryStarted && participantRecoveryStarted)) {
return;
}
culledOrphanSubordinates = true;
SubordinateATCoordinator[] coordinators = SubordinateATCoordinator.listRecoveredCoordinators();
for (SubordinateATCoordinator coordinator : coordinators) {
if (coordinator.getSubordinateType().equals(SubordinateATCoordinator.SUBORDINATE_TX_TYPE_AT_AT) && coordinator.isOrphaned()) {
RecoveryLogger.i18NLogger.warn_participant_at_XTSATRecoveryModule_5(coordinator.get_uid());
coordinator.rollback();
}
}
}
Aggregations