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