Search in sources :

Example 6 with RecoveryCoordinator

use of org.omg.CosTransactions.RecoveryCoordinator in project narayana by jbosstm.

the class ServerTopLevelAction method registerResource.

protected boolean registerResource(Coordinator theCoordinator) {
    boolean result = false;
    if (theCoordinator != null) {
        if (_registered)
            return true;
        try {
            /*
		 * Register resource and pass RecoveryCoordinator reference
		 * to the interposed transaction to save and restore.
		 */
            RecoveryCoordinator recoveryCoord = theCoordinator.register_resource(_resourceRef);
            _registered = true;
            if (!_theControl.isWrapper()) {
                ServerTransaction tx = (ServerTransaction) _theControl.getImplHandle();
                if (tx != null) {
                    tx.setRecoveryCoordinator(recoveryCoord);
                    result = true;
                } else {
                    result = false;
                    jtsLogger.i18NLogger.warn_orbspecific_interposition_resources_arjuna_ipfailed("ServerTopLevelAction");
                }
            } else
                result = true;
        } catch (ClassCastException classCastException) {
            jtsLogger.i18NLogger.warn_orbspecific_interposition_resources_arjuna_generror("ServerTopLevelAction.registerResource", classCastException);
        } catch (Inactive ine) {
            jtsLogger.i18NLogger.warn_server_top_level_action_inactive();
            jtsLogger.i18NLogger.debug_orbspecific_interposition_resources_arjuna_generror("ServerTopLevelAction.registerResource", ine);
            transactionInactive = true;
        } catch (TRANSACTION_ROLLEDBACK ex1) {
            jtsLogger.i18NLogger.warn_orbspecific_interposition_resources_arjuna_generror("ServerTopLevelAction.registerResource", ex1);
        } catch (INVALID_TRANSACTION ex2) {
            jtsLogger.i18NLogger.warn_orbspecific_interposition_resources_arjuna_generror("ServerTopLevelAction.registerResource", ex2);
        } catch (Exception e) {
            jtsLogger.i18NLogger.warn_orbspecific_interposition_resources_arjuna_generror("ServerTopLevelAction.registerResource", e);
        }
    } else {
        jtsLogger.i18NLogger.warn_orbspecific_interposition_resources_arjuna_nocoord("ServerTopLevelAction.registerResource");
    }
    return result;
}
Also used : INVALID_TRANSACTION(org.omg.CORBA.INVALID_TRANSACTION) RecoveryCoordinator(org.omg.CosTransactions.RecoveryCoordinator) Inactive(org.omg.CosTransactions.Inactive) ServerTransaction(com.arjuna.ats.internal.jts.orbspecific.interposition.coordinator.ServerTransaction) TRANSACTION_ROLLEDBACK(org.omg.CORBA.TRANSACTION_ROLLEDBACK) SystemException(org.omg.CORBA.SystemException)

Example 7 with RecoveryCoordinator

use of org.omg.CosTransactions.RecoveryCoordinator in project narayana by jbosstm.

the class JavaIdlRCManager method makeRC.

/**
 * We create a RecoveryCoordinator reference, but without (we think)
 * actually making the implementation object available to the orb.
 * The data needed to construct the RecoveryCoordinator is put in
 * the ObjectId. If a replay_completion is received, it will be sent,
 * via the locationd daemon, to the RecoveryManager.
 */
public RecoveryCoordinator makeRC(Uid RCUid, Uid tranUid, Uid processUid, boolean isServerTransaction) {
    initialise();
    RecoveryCoordinator rc = null;
    try {
        String rcObjectId = GenericRecoveryCoordinator.makeId(RCUid, tranUid, processUid, isServerTransaction);
        if (ref_ReCoo != null) {
            // New for IOR template
            String new_ior = RecoverIOR.getIORFromString(ORBManager.getORB().orb(), ref_ReCoo, rcObjectId);
            org.omg.CORBA.Object rcAsObject = ORBManager.getORB().orb().string_to_object(new_ior);
            // End for IOR Template
            rc = RecoveryCoordinatorHelper.narrow(rcAsObject);
            if (jtsLogger.logger.isDebugEnabled()) {
                jtsLogger.logger.debug("JavaIdlRCManager: Created reference for tran " + tranUid + " = " + rc);
            }
        } else {
            if (JavaIdlRCManager._runWithoutDaemon)
                throw new NO_IMPLEMENT();
            else {
                jtsLogger.i18NLogger.warn_orbspecific_jacorb_recoverycoordinators_JacOrbRCManager_3();
                rc = null;
            }
        }
    } catch (Exception ex) {
        jtsLogger.i18NLogger.warn_orbspecific_jacorb_recoverycoordinators_JacOrbRCManager_2(ex);
    }
    return rc;
}
Also used : NO_IMPLEMENT(org.omg.CORBA.NO_IMPLEMENT) RecoveryCoordinator(org.omg.CosTransactions.RecoveryCoordinator) GenericRecoveryCoordinator(com.arjuna.ats.internal.jts.orbspecific.recovery.recoverycoordinators.GenericRecoveryCoordinator) SystemException(org.omg.CORBA.SystemException)

Example 8 with RecoveryCoordinator

use of org.omg.CosTransactions.RecoveryCoordinator in project narayana by jbosstm.

the class IbmORBRecoveryUnitTest method testORBRCManager.

@Test
public void testORBRCManager() throws Exception {
    JavaIdlRCManager manager = new JavaIdlRCManager();
    RecoveryCoordinator rc = manager.makeRC(new Uid(), new Uid(), new Uid(), false);
    assertTrue(rc == null);
    manager.destroy(rc);
    manager.destroyAll(null);
}
Also used : Uid(com.arjuna.ats.arjuna.common.Uid) RecoveryCoordinator(org.omg.CosTransactions.RecoveryCoordinator) JavaIdlRCManager(com.arjuna.ats.internal.jts.orbspecific.ibmorb.recoverycoordinators.JavaIdlRCManager) Test(org.junit.Test)

Example 9 with RecoveryCoordinator

use of org.omg.CosTransactions.RecoveryCoordinator in project narayana by jbosstm.

the class JavaIdlRecoveryUnitTest method testORBRCManager.

@Test
public void testORBRCManager() throws Exception {
    JavaIdlRCManager manager = new JavaIdlRCManager();
    RecoveryCoordinator rc = manager.makeRC(new Uid(), new Uid(), new Uid(), false);
    assertTrue(rc == null);
    manager.destroy(rc);
    manager.destroyAll(null);
}
Also used : Uid(com.arjuna.ats.arjuna.common.Uid) RecoveryCoordinator(org.omg.CosTransactions.RecoveryCoordinator) JavaIdlRCManager(com.arjuna.ats.internal.jts.orbspecific.javaidl.recoverycoordinators.JavaIdlRCManager) Test(org.junit.Test)

Example 10 with RecoveryCoordinator

use of org.omg.CosTransactions.RecoveryCoordinator in project narayana by jbosstm.

the class JacORBRecoveryUnitTest method testORBRCManager.

@Test
public void testORBRCManager() throws Exception {
    JacOrbRCManager manager = new JacOrbRCManager();
    RecoveryCoordinator rc = manager.makeRC(new Uid(), new Uid(), new Uid(), false);
    assertTrue(rc == null);
    manager.destroy(rc);
    manager.destroyAll(null);
}
Also used : Uid(com.arjuna.ats.arjuna.common.Uid) RecoveryCoordinator(org.omg.CosTransactions.RecoveryCoordinator) JacOrbRCManager(com.arjuna.ats.internal.jts.orbspecific.jacorb.recoverycoordinators.JacOrbRCManager) Test(org.junit.Test)

Aggregations

RecoveryCoordinator (org.omg.CosTransactions.RecoveryCoordinator)13 SystemException (org.omg.CORBA.SystemException)6 Uid (com.arjuna.ats.arjuna.common.Uid)5 Test (org.junit.Test)5 NO_IMPLEMENT (org.omg.CORBA.NO_IMPLEMENT)4 GenericRecoveryCoordinator (com.arjuna.ats.internal.jts.orbspecific.recovery.recoverycoordinators.GenericRecoveryCoordinator)3 TRANSACTION_ROLLEDBACK (org.omg.CORBA.TRANSACTION_ROLLEDBACK)3 BasicAction (com.arjuna.ats.arjuna.coordinator.BasicAction)2 ArjunaTransactionImple (com.arjuna.ats.internal.jts.orbspecific.coordinator.ArjunaTransactionImple)2 ServerTransaction (com.arjuna.ats.internal.jts.orbspecific.interposition.coordinator.ServerTransaction)2 INVALID_TRANSACTION (org.omg.CORBA.INVALID_TRANSACTION)2 UNKNOWN (org.omg.CORBA.UNKNOWN)2 Coordinator (org.omg.CosTransactions.Coordinator)2 Inactive (org.omg.CosTransactions.Inactive)2 Resource (org.omg.CosTransactions.Resource)2 OTSAbstractRecord (com.arjuna.ArjunaOTS.OTSAbstractRecord)1 UidCoordinator (com.arjuna.ArjunaOTS.UidCoordinator)1 AbstractRecord (com.arjuna.ats.arjuna.coordinator.AbstractRecord)1 XAResourceRecord (com.arjuna.ats.internal.jta.resources.jts.orbspecific.XAResourceRecord)1 TxInfo (com.arjuna.ats.internal.jta.xa.TxInfo)1