Search in sources :

Example 11 with Uid

use of com.arjuna.ats.arjuna.common.Uid in project narayana by jbosstm.

the class RecoveryManager method persistParticipantInformation.

public void persistParticipantInformation(final ParticipantInformation participantInformation) {
    if (LOG.isTraceEnabled()) {
        LOG.trace("RecoveryManager.persistParticipantInformation: participantInformation=" + participantInformation);
    }
    if (!isRecoverableParticipant(participantInformation.getParticipant())) {
        if (LOG.isTraceEnabled()) {
            LOG.trace("RecoveryManager.persistParticipantInformation: participant is not recoverable");
        }
        return;
    }
    try {
        final RecoveryStore recoveryStore = StoreManager.getRecoveryStore();
        final OutputObjectState state = getParticipantInformationOutputState(participantInformation);
        final Uid uid = new Uid(participantInformation.getId());
        recoveryStore.write_committed(uid, PARTICIPANT_INFORMATION_RECORD_TYPE, state);
    } catch (Exception e) {
        LOG.warn("Failure while persisting participant information.", e);
    }
}
Also used : Uid(com.arjuna.ats.arjuna.common.Uid) OutputObjectState(com.arjuna.ats.arjuna.state.OutputObjectState) RecoveryStore(com.arjuna.ats.arjuna.objectstore.RecoveryStore) ParticipantException(org.jboss.narayana.rest.integration.api.ParticipantException) HeuristicException(org.jboss.narayana.rest.integration.api.HeuristicException) IOException(java.io.IOException) ObjectStoreException(com.arjuna.ats.arjuna.exceptions.ObjectStoreException)

Example 12 with Uid

use of com.arjuna.ats.arjuna.common.Uid in project narayana by jbosstm.

the class AITServer02 method main.

public static void main(String[] args) {
    try {
        ORBInterface.initORB(args, null);
        OAInterface.initOA();
        Uid uid = ObjectUidStore.loadUid(args[args.length - 2]);
        AITServiceImpl01 aitServiceImpl = new AITServiceImpl01(uid);
        ServicePOATie servant = new ServicePOATie(aitServiceImpl);
        OAInterface.objectIsReady(servant);
        Service service = ServiceHelper.narrow(OAInterface.corbaReference(servant));
        ServerIORStore.storeIOR(args[args.length - 1], ORBInterface.orb().object_to_string(service));
        System.out.println("Ready");
        ORBInterface.run();
    } catch (Exception exception) {
        System.err.println("AITServer02.main: " + exception);
        exception.printStackTrace(System.err);
    }
}
Also used : Uid(com.arjuna.ats.arjuna.common.Uid) AITServiceImpl01(org.jboss.jbossts.qa.CrashRecovery09Impls.AITServiceImpl01)

Example 13 with Uid

use of com.arjuna.ats.arjuna.common.Uid in project narayana by jbosstm.

the class AITServer02 method main.

public static void main(String[] args) {
    try {
        ORBInterface.initORB(args, null);
        OAInterface.initOA();
        Uid uid = ObjectUidStore.loadUid(args[args.length - 2]);
        AITServiceImpl01 aitServiceImpl = new AITServiceImpl01(uid);
        ServicePOATie servant = new ServicePOATie(aitServiceImpl);
        OAInterface.objectIsReady(servant);
        Service service = ServiceHelper.narrow(OAInterface.corbaReference(servant));
        ServerIORStore.storeIOR(args[args.length - 1], ORBInterface.orb().object_to_string(service));
        System.out.println("Ready");
        ORBInterface.run();
    } catch (Exception exception) {
        System.err.println("AITServer02.main: " + exception);
        exception.printStackTrace(System.err);
    }
}
Also used : Uid(com.arjuna.ats.arjuna.common.Uid) AITServiceImpl01(org.jboss.jbossts.qa.CrashRecovery10Impls.AITServiceImpl01)

Example 14 with Uid

use of com.arjuna.ats.arjuna.common.Uid in project narayana by jbosstm.

the class AITServer04 method main.

public static void main(String[] args) {
    try {
        ORBInterface.initORB(args, null);
        OAInterface.initOA();
        Uid uid1 = ObjectUidStore.loadUid(args[args.length - 4]);
        Uid uid2 = ObjectUidStore.loadUid(args[args.length - 3]);
        AITServiceImpl01 aitServiceImpl1 = new AITServiceImpl01(uid1);
        AITServiceImpl01 aitServiceImpl2 = new AITServiceImpl01(uid2);
        ServicePOATie servant1 = new ServicePOATie(aitServiceImpl1);
        ServicePOATie servant2 = new ServicePOATie(aitServiceImpl2);
        OAInterface.objectIsReady(servant1);
        Service service1 = ServiceHelper.narrow(OAInterface.corbaReference(servant1));
        OAInterface.objectIsReady(servant2);
        Service service2 = ServiceHelper.narrow(OAInterface.corbaReference(servant2));
        ServerIORStore.storeIOR(args[args.length - 2], ORBInterface.orb().object_to_string(service1));
        ServerIORStore.storeIOR(args[args.length - 1], ORBInterface.orb().object_to_string(service2));
        System.out.println("Ready");
        ORBInterface.run();
    } catch (Exception exception) {
        System.err.println("AITServer04.main: " + exception);
        exception.printStackTrace(System.err);
    }
}
Also used : Uid(com.arjuna.ats.arjuna.common.Uid) AITServiceImpl01(org.jboss.jbossts.qa.CrashRecovery10Impls.AITServiceImpl01)

Example 15 with Uid

use of com.arjuna.ats.arjuna.common.Uid in project narayana by jbosstm.

the class InboundBridgeRecoveryModule method periodicWorkSecondPass.

/**
 * Called by the RecoveryManager RECOVERY_BACKOFF_PERIOD seconds after the completion of the first pass
 */
@Override
public void periodicWorkSecondPass() {
    if (LOG.isTraceEnabled()) {
        LOG.trace("InboundBridgeRecoveryModule.periodicWorkSecondPass");
    }
    recoveredBridges.clear();
    final Set<Uid> uids = getUidsToRecover();
    uids.retainAll(firstPassUids);
    for (Uid uid : uids) {
        try {
            final SubordinateTransaction st = SubordinationManager.getTransactionImporter().recoverTransaction(uid);
        } catch (XAException e) {
            LOG.warn(e.getMessage(), e);
        }
    }
    addBridgesToMapping();
}
Also used : Uid(com.arjuna.ats.arjuna.common.Uid) XAException(javax.transaction.xa.XAException) SubordinateTransaction(com.arjuna.ats.internal.jta.transaction.arjunacore.jca.SubordinateTransaction)

Aggregations

Uid (com.arjuna.ats.arjuna.common.Uid)402 Test (org.junit.Test)185 InputObjectState (com.arjuna.ats.arjuna.state.InputObjectState)83 OutputObjectState (com.arjuna.ats.arjuna.state.OutputObjectState)74 XidImple (com.arjuna.ats.jta.xa.XidImple)71 ObjectStoreException (com.arjuna.ats.arjuna.exceptions.ObjectStoreException)57 IOException (java.io.IOException)48 Xid (javax.transaction.xa.Xid)44 XAException (javax.transaction.xa.XAException)40 SubordinateTransaction (com.arjuna.ats.internal.jta.transaction.arjunacore.jca.SubordinateTransaction)32 AtomicAction (com.arjuna.ats.arjuna.AtomicAction)31 RecoveryStore (com.arjuna.ats.arjuna.objectstore.RecoveryStore)27 SoapFault11 (com.arjuna.webservices11.SoapFault11)22 Transaction (javax.transaction.Transaction)18 ObjectStoreEnvironmentBean (com.arjuna.ats.arjuna.common.ObjectStoreEnvironmentBean)17 Vector (java.util.Vector)17 XATerminator (javax.resource.spi.XATerminator)15 TransactionImporter (com.arjuna.ats.internal.jta.transaction.arjunacore.jca.TransactionImporter)14 Enumeration (java.util.Enumeration)13 SystemException (org.omg.CORBA.SystemException)13