Search in sources :

Example 6 with ServerNestedAction

use of com.arjuna.ats.internal.jts.orbspecific.interposition.resources.arjuna.ServerNestedAction in project narayana by jbosstm.

the class ServerResource method tidyup.

protected void tidyup() {
    synchronized (_children) {
        while (_children.size() > 0) {
            ServerNestedAction child = _children.remove(0);
            child.setParentHandle(null);
            try {
                ORBManager.getPOA().shutdownObject(child.theResource());
            } catch (Exception e) {
            }
        }
    }
    if (_theControl != null) {
        if (_theControl.isWrapper()) {
            try {
                // will delete itself
                _theControl.destroy();
            } catch (Exception e) {
            }
        }
        _theControl = null;
    }
}
Also used : ServerNestedAction(com.arjuna.ats.internal.jts.orbspecific.interposition.resources.arjuna.ServerNestedAction)

Example 7 with ServerNestedAction

use of com.arjuna.ats.internal.jts.orbspecific.interposition.resources.arjuna.ServerNestedAction in project narayana by jbosstm.

the class ServerNestedActionUnitTest method test.

@Test
public void test() throws Exception {
    ControlImple cont = new ControlImple(null, null);
    Control theControl = cont.getControl();
    ArjunaTransactionImple tx = cont.getImplHandle();
    ServerControl sc = new ServerControl(tx.get_uid(), theControl, tx, theControl.get_coordinator(), theControl.get_terminator());
    ServerNestedAction act = new ServerNestedAction(sc);
    try {
        act.prepare();
        fail();
    } catch (final BAD_OPERATION ex) {
    }
    act.commit();
    act.rollback();
    act.commit_one_phase();
    assertTrue(act.theResource() != null);
}
Also used : Control(org.omg.CosTransactions.Control) ServerControl(com.arjuna.ats.internal.jts.orbspecific.interposition.ServerControl) ServerControl(com.arjuna.ats.internal.jts.orbspecific.interposition.ServerControl) ArjunaTransactionImple(com.arjuna.ats.internal.jts.orbspecific.coordinator.ArjunaTransactionImple) ServerNestedAction(com.arjuna.ats.internal.jts.orbspecific.interposition.resources.arjuna.ServerNestedAction) BAD_OPERATION(org.omg.CORBA.BAD_OPERATION) ControlImple(com.arjuna.ats.internal.jts.orbspecific.ControlImple) Test(org.junit.Test)

Example 8 with ServerNestedAction

use of com.arjuna.ats.internal.jts.orbspecific.interposition.resources.arjuna.ServerNestedAction in project narayana by jbosstm.

the class ServerNestedActionUnitTest method testNestedCommit.

@Test
public void testNestedCommit() throws Exception {
    ControlImple cont = new ControlImple(null, null);
    Control theControl = cont.getControl();
    ArjunaTransactionImple tx = cont.getImplHandle();
    ServerControl sc = new ServerControl(tx.get_uid(), theControl, tx, theControl.get_coordinator(), theControl.get_terminator());
    ServerNestedAction act = new ServerNestedAction(sc);
    act.commit_subtransaction(null);
}
Also used : Control(org.omg.CosTransactions.Control) ServerControl(com.arjuna.ats.internal.jts.orbspecific.interposition.ServerControl) ServerControl(com.arjuna.ats.internal.jts.orbspecific.interposition.ServerControl) ArjunaTransactionImple(com.arjuna.ats.internal.jts.orbspecific.coordinator.ArjunaTransactionImple) ServerNestedAction(com.arjuna.ats.internal.jts.orbspecific.interposition.resources.arjuna.ServerNestedAction) ControlImple(com.arjuna.ats.internal.jts.orbspecific.ControlImple) Test(org.junit.Test)

Example 9 with ServerNestedAction

use of com.arjuna.ats.internal.jts.orbspecific.interposition.resources.arjuna.ServerNestedAction in project narayana by jbosstm.

the class ServerNestedActionUnitTest method testNestedRollback.

@Test
public void testNestedRollback() throws Exception {
    ControlImple cont = new ControlImple(null, null);
    Control theControl = cont.getControl();
    ArjunaTransactionImple tx = cont.getImplHandle();
    ServerControl sc = new ServerControl(tx.get_uid(), theControl, tx, theControl.get_coordinator(), theControl.get_terminator());
    ServerNestedAction act = new ServerNestedAction(sc);
    act.rollback_subtransaction();
}
Also used : Control(org.omg.CosTransactions.Control) ServerControl(com.arjuna.ats.internal.jts.orbspecific.interposition.ServerControl) ServerControl(com.arjuna.ats.internal.jts.orbspecific.interposition.ServerControl) ArjunaTransactionImple(com.arjuna.ats.internal.jts.orbspecific.coordinator.ArjunaTransactionImple) ServerNestedAction(com.arjuna.ats.internal.jts.orbspecific.interposition.resources.arjuna.ServerNestedAction) ControlImple(com.arjuna.ats.internal.jts.orbspecific.ControlImple) Test(org.junit.Test)

Aggregations

ServerNestedAction (com.arjuna.ats.internal.jts.orbspecific.interposition.resources.arjuna.ServerNestedAction)9 ServerControl (com.arjuna.ats.internal.jts.orbspecific.interposition.ServerControl)5 ControlImple (com.arjuna.ats.internal.jts.orbspecific.ControlImple)3 ArjunaTransactionImple (com.arjuna.ats.internal.jts.orbspecific.coordinator.ArjunaTransactionImple)3 Test (org.junit.Test)3 Control (org.omg.CosTransactions.Control)3 Uid (com.arjuna.ats.arjuna.common.Uid)2 SystemException (org.omg.CORBA.SystemException)2 TRANSACTION_ROLLEDBACK (org.omg.CORBA.TRANSACTION_ROLLEDBACK)2 Coordinator (org.omg.CosTransactions.Coordinator)2 Terminator (org.omg.CosTransactions.Terminator)2 ServerTopLevelAction (com.arjuna.ats.internal.jts.orbspecific.interposition.resources.arjuna.ServerTopLevelAction)1 BAD_OPERATION (org.omg.CORBA.BAD_OPERATION)1 TRANSACTION_UNAVAILABLE (org.omg.CORBA.TRANSACTION_UNAVAILABLE)1 TransIdentity (org.omg.CosTransactions.TransIdentity)1