Search in sources :

Example 61 with IntHolder

use of org.omg.CORBA.IntHolder in project narayana by jbosstm.

the class Client02a method main.

public static void main(String[] args) {
    try {
        ORBInterface.initORB(args, null);
        OAInterface.initOA();
        String serviceIOR = ServerIORStore.loadIOR(args[args.length - 1]);
        AfterCrashService service = AfterCrashServiceHelper.narrow(ORBInterface.orb().string_to_object(serviceIOR));
        Thread.sleep(Delays.recoveryDelay());
        boolean correct = true;
        IntHolder valueHolder = new IntHolder();
        service.get(valueHolder);
        // 
        // recovery should have rolled the transaction back.
        // the set(1) change should therefore have been undone.
        // 
        correct = correct && (valueHolder.value == 0);
        if (correct) {
            System.out.println("Passed");
        } else {
            System.out.println("Failed");
        }
    } catch (Exception exception) {
        System.out.println("Failed");
        System.err.println("Client02a.main: " + exception);
        exception.printStackTrace(System.err);
    }
    try {
        OAInterface.shutdownOA();
        ORBInterface.shutdownORB();
    } catch (Exception exception) {
        System.err.println("Client02a.main: " + exception);
        exception.printStackTrace(System.err);
    }
}
Also used : IntHolder(org.omg.CORBA.IntHolder)

Example 62 with IntHolder

use of org.omg.CORBA.IntHolder in project narayana by jbosstm.

the class Client03a method main.

public static void main(String[] args) {
    try {
        ORBInterface.initORB(args, null);
        OAInterface.initOA();
        String serviceIOR = ServerIORStore.loadIOR(args[args.length - 1]);
        AfterCrashService service = AfterCrashServiceHelper.narrow(ORBInterface.orb().string_to_object(serviceIOR));
        Thread.sleep(Delays.recoveryDelay());
        boolean correct = true;
        IntHolder valueHolder = new IntHolder();
        // non-tx
        service.get(valueHolder);
        correct = correct && (valueHolder.value == 1);
        if (correct) {
            System.out.println("Passed");
        } else {
            System.out.println("Failed");
        }
    } catch (Exception exception) {
        System.out.println("Failed");
        System.err.println("Client03a.main: " + exception);
        exception.printStackTrace(System.err);
    }
    try {
        OAInterface.shutdownOA();
        ORBInterface.shutdownORB();
    } catch (Exception exception) {
        System.err.println("Client03a.main: " + exception);
        exception.printStackTrace(System.err);
    }
}
Also used : IntHolder(org.omg.CORBA.IntHolder)

Example 63 with IntHolder

use of org.omg.CORBA.IntHolder in project narayana by jbosstm.

the class Client04a method main.

public static void main(String[] args) {
    try {
        ORBInterface.initORB(args, null);
        OAInterface.initOA();
        String serviceIOR = ServerIORStore.loadIOR(args[args.length - 1]);
        AfterCrashService service = AfterCrashServiceHelper.narrow(ORBInterface.orb().string_to_object(serviceIOR));
        Thread.sleep(Delays.recoveryDelay());
        boolean correct = true;
        IntHolder valueHolder = new IntHolder();
        // non-tx
        service.get(valueHolder);
        correct = correct && (valueHolder.value == 0);
        if (correct) {
            System.out.println("Passed");
        } else {
            System.out.println("Failed");
        }
    } catch (Exception exception) {
        System.out.println("Failed");
        System.err.println("Client04a.main: " + exception);
        exception.printStackTrace(System.err);
    }
    try {
        OAInterface.shutdownOA();
        ORBInterface.shutdownORB();
    } catch (Exception exception) {
        System.err.println("Client04a.main: " + exception);
        exception.printStackTrace(System.err);
    }
}
Also used : IntHolder(org.omg.CORBA.IntHolder)

Example 64 with IntHolder

use of org.omg.CORBA.IntHolder in project narayana by jbosstm.

the class Outcome01 method main.

public static void main(String[] args) {
    try {
        ORBInterface.initORB(args, null);
        OAInterface.initOA();
        String matrixIOR = ServerIORStore.loadIOR(args[args.length - 1]);
        Matrix matrix = MatrixHelper.narrow(ORBInterface.orb().string_to_object(matrixIOR));
        boolean correct = true;
        int matrixWidth = matrix.get_width();
        int matrixHeight = matrix.get_height();
        int total = 0;
        for (int x = 0; x < matrixWidth; x++) {
            for (int y = 0; y < matrixHeight; y++) {
                IntHolder value = new IntHolder();
                matrix.get_value(x, y, value, null);
                correct = correct && ((value.value == 0) || (value.value == 1));
                total += value.value;
            }
        }
        if (correct && (total == ((matrixWidth * matrixHeight) / 2))) {
            System.out.println("Passed");
        } else {
            System.out.println("Failed");
        }
    } catch (Exception exception) {
        System.out.println("Failed");
        System.err.println("Outcome01.main: " + exception);
        exception.printStackTrace(System.err);
    }
    try {
        OAInterface.shutdownOA();
        ORBInterface.shutdownORB();
    } catch (Exception exception) {
        System.err.println("Outcome01.main: " + exception);
        exception.printStackTrace(System.err);
    }
}
Also used : IntHolder(org.omg.CORBA.IntHolder)

Example 65 with IntHolder

use of org.omg.CORBA.IntHolder in project narayana by jbosstm.

the class Outcome01 method main.

public static void main(String[] args) {
    try {
        ORBInterface.initORB(args, null);
        OAInterface.initOA();
        String matrixIOR = ServerIORStore.loadIOR(args[args.length - 1]);
        Matrix matrix = MatrixHelper.narrow(ORBInterface.orb().string_to_object(matrixIOR));
        boolean correct = true;
        int matrixWidth = matrix.get_width();
        int matrixHeight = matrix.get_height();
        int total = 0;
        for (int x = 0; x < matrixWidth; x++) {
            for (int y = 0; y < matrixHeight; y++) {
                IntHolder value = new IntHolder();
                matrix.get_value(x, y, value);
                correct = correct && ((value.value == 0) || (value.value == 1));
                total += value.value;
            }
        }
        if (correct && (total == ((matrixWidth * matrixHeight) / 2))) {
            System.out.println("Passed");
        } else {
            System.out.println("Failed");
        }
    } catch (Exception exception) {
        System.out.println("Failed");
        System.err.println("Outcome01.main: " + exception);
        exception.printStackTrace(System.err);
    }
    try {
        OAInterface.shutdownOA();
        ORBInterface.shutdownORB();
    } catch (Exception exception) {
        System.err.println("Outcome01.main: " + exception);
        exception.printStackTrace(System.err);
    }
}
Also used : IntHolder(org.omg.CORBA.IntHolder)

Aggregations

IntHolder (org.omg.CORBA.IntHolder)72 AtomicTransaction (com.arjuna.ats.jts.extensions.AtomicTransaction)12 Control (org.omg.CosTransactions.Control)10 ORB (com.arjuna.orbportability.ORB)6 RootOA (com.arjuna.orbportability.RootOA)6 HitCountRequest (org.codice.alliance.nsili.common.GIAS.HitCountRequest)6 Services (com.arjuna.orbportability.Services)5 ServerORB (com.hp.mwtests.ts.jts.utils.ServerORB)5 AcsJCORBAProblemEx (alma.ACSErrTypeCommon.wrappers.AcsJCORBAProblemEx)4 NameAlreadyUsed (gov.sandia.NotifyMonitoringExt.NameAlreadyUsed)3 NameMapError (gov.sandia.NotifyMonitoringExt.NameMapError)3 Test (org.junit.Test)3 BAD_PARAM (org.omg.CORBA.BAD_PARAM)3 AdminLimitExceeded (org.omg.CosNotifyChannelAdmin.AdminLimitExceeded)3 AcsJNarrowFailedEx (alma.ACSErrTypeCORBA.wrappers.AcsJNarrowFailedEx)2 CurrentImple (com.arjuna.ats.internal.jts.orbspecific.CurrentImple)2 SubmitQueryRequest (org.codice.alliance.nsili.common.GIAS.SubmitQueryRequest)2 DAGListHolder (org.codice.alliance.nsili.common.UCO.DAGListHolder)2 InvalidInputParameter (org.codice.alliance.nsili.common.UCO.InvalidInputParameter)2 ProcessingFault (org.codice.alliance.nsili.common.UCO.ProcessingFault)2