use of com.arjuna.wst.UnknownTransactionException 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;
}
}
}
Aggregations