use of com.arjuna.ats.internal.jts.recovery.RecoveryCreator in project narayana by jbosstm.
the class GenericRecoveryCreator method register.
/**
* Create an instance of this class, which will delegate the orb-specific
* aspects to the supplied RcvCoManager instance and register it with
* the transaction service.
*/
public static void register(RcvCoManager theManager) {
RecoveryCreator theCreator = new GenericRecoveryCreator(theManager);
RecoveryCreator.setCreator(theCreator);
}
use of com.arjuna.ats.internal.jts.recovery.RecoveryCreator in project narayana by jbosstm.
the class JacORBGenericRecoveryCreatorFailureUnitTest method testFail.
@Test
public void testFail() throws Exception {
JacOrbRCServiceInit init = new JacOrbRCServiceInit();
JacOrbRecoveryInit rinit = new JacOrbRecoveryInit();
init.startRCservice();
RecoveryCreator creator = RecoveryCreator.getCreator();
GenericRecoveryCreator generic = null;
if (creator instanceof GenericRecoveryCreator)
generic = (GenericRecoveryCreator) creator;
assertTrue(generic != null);
DemoResource demo = new DemoResource();
assertTrue(generic.create(demo.getResource(), null) == null);
JacOrbRCServiceInit.shutdownRCService();
}
use of com.arjuna.ats.internal.jts.recovery.RecoveryCreator in project narayana by jbosstm.
the class JacORBGenericRecoveryCreatorSuccessUnitTest method testSuccess.
@Test
public void testSuccess() throws Exception {
JacOrbRCServiceInit init = new JacOrbRCServiceInit();
JacOrbRecoveryInit rinit = new JacOrbRecoveryInit();
init.startRCservice();
RecoveryCreator creator = RecoveryCreator.getCreator();
GenericRecoveryCreator generic = null;
if (creator instanceof GenericRecoveryCreator)
generic = (GenericRecoveryCreator) creator;
assertTrue(generic != null);
DemoResource demo = new DemoResource();
ArjunaTransactionImple tx = new ArjunaTransactionImple(null);
Object[] params = new Object[1];
params[0] = tx;
RecoveryCoordinator rc = generic.create(demo.getResource(), params);
assertTrue(rc != null);
generic.destroy(rc);
generic.destroyAll(params);
JacOrbRCServiceInit.shutdownRCService();
}
Aggregations