Search in sources :

Example 6 with SubordinateATCoordinator

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

Example 7 with SubordinateATCoordinator

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();
        }
    }
}
Also used : SubordinateATCoordinator(com.arjuna.mwlabs.wscf.model.twophase.arjunacore.subordinate.SubordinateATCoordinator)

Aggregations

SubordinateATCoordinator (com.arjuna.mwlabs.wscf.model.twophase.arjunacore.subordinate.SubordinateATCoordinator)7 SystemException (com.arjuna.mw.wsas.exceptions.SystemException)4 NoActivityException (com.arjuna.mw.wsas.exceptions.NoActivityException)3 ServiceRegistry (com.arjuna.webservices11.ServiceRegistry)2 InstanceIdentifier (com.arjuna.webservices11.wsarj.InstanceIdentifier)2 InvalidCreateParametersException (com.arjuna.wsc.InvalidCreateParametersException)2 InvalidProtocolException (com.arjuna.wsc.InvalidProtocolException)2 W3CEndpointReference (javax.xml.ws.wsaddressing.W3CEndpointReference)2 XTSATRecoveryManager (org.jboss.jbossts.xts.recovery.participant.at.XTSATRecoveryManager)2 CoordinationContext (org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContext)2 CoordinationContextType (org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType)2 Expires (org.oasis_open.docs.ws_tx.wscoor._2006._06.Expires)2 Uid (com.arjuna.ats.arjuna.common.Uid)1 ActivityHierarchy (com.arjuna.mw.wsas.activity.ActivityHierarchy)1 ProtocolViolationException (com.arjuna.mw.wsas.exceptions.ProtocolViolationException)1 WrongStateException (com.arjuna.mw.wsas.exceptions.WrongStateException)1 ProtocolNotRegisteredException (com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException)1 DurableTwoPhaseCommitParticipant (com.arjuna.mwlabs.wst.at.participants.DurableTwoPhaseCommitParticipant)1 VolatileTwoPhaseCommitParticipant (com.arjuna.mwlabs.wst.at.participants.VolatileTwoPhaseCommitParticipant)1 ArjunaContextImple (com.arjuna.mwlabs.wst11.at.context.ArjunaContextImple)1