Search in sources :

Example 61 with UnknownTransactionException

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;
        }
    }
}
Also used : SubordinateATCoordinator(com.arjuna.mwlabs.wscf.model.twophase.arjunacore.subordinate.SubordinateATCoordinator) XTSATRecoveryManager(org.jboss.jbossts.xts.recovery.participant.at.XTSATRecoveryManager) UnknownTransactionException(com.arjuna.wst.UnknownTransactionException)

Aggregations

UnknownTransactionException (com.arjuna.wst.UnknownTransactionException)61 SystemException (com.arjuna.wst.SystemException)57 WrongStateException (com.arjuna.wst.WrongStateException)40 TransactionRolledBackException (com.arjuna.wst.TransactionRolledBackException)35 ArrayList (java.util.ArrayList)18 W3CEndpointReference (javax.xml.ws.wsaddressing.W3CEndpointReference)16 UserBusinessActivity (com.arjuna.mw.wst11.UserBusinessActivity)14 InstanceIdentifier (com.arjuna.webservices11.wsarj.InstanceIdentifier)13 InvalidCreateParametersException (com.arjuna.wsc.InvalidCreateParametersException)13 SoapFault (com.arjuna.webservices.SoapFault)11 MAP (org.jboss.ws.api.addressing.MAP)11 TxContextImple (com.arjuna.mwlabs.wst11.ba.context.TxContextImple)8 TxContextImple (com.arjuna.mwlabs.wst11.at.context.TxContextImple)7 FaultedException (com.arjuna.wst.FaultedException)6 BusinessActivityTerminator (com.arjuna.wst11.BusinessActivityTerminator)6 UserTransaction (com.arjuna.mw.wst11.UserTransaction)5 SoapFault11 (com.arjuna.webservices11.SoapFault11)5 InvalidActivityException (com.arjuna.mw.wsas.exceptions.InvalidActivityException)4 Context (com.arjuna.mw.wsc11.context.Context)3 TransactionManager (com.arjuna.mw.wst11.TransactionManager)3