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 serviceIOR1 = ServerIORStore.loadIOR(args[args.length - 2]);
Service service1 = ServiceHelper.narrow(ORBInterface.orb().string_to_object(serviceIOR1));
String serviceIOR2 = ServerIORStore.loadIOR(args[args.length - 1]);
Service service2 = ServiceHelper.narrow(ORBInterface.orb().string_to_object(serviceIOR2));
CrashRecoveryDelays.awaitRecoveryCR10();
boolean correct = true;
OTS.current().begin();
IntHolder valueHolder1 = new IntHolder();
IntHolder valueHolder2 = new IntHolder();
service1.get(OTS.get_current().get_control(), valueHolder1);
service2.get(OTS.get_current().get_control(), valueHolder2);
correct = correct && (valueHolder1.value == 1);
correct = correct && (valueHolder2.value == 1);
OTS.current().commit(true);
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);
}
}
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 serviceIOR1 = ServerIORStore.loadIOR(args[args.length - 2]);
Service service1 = ServiceHelper.narrow(ORBInterface.orb().string_to_object(serviceIOR1));
String serviceIOR2 = ServerIORStore.loadIOR(args[args.length - 1]);
Service service2 = ServiceHelper.narrow(ORBInterface.orb().string_to_object(serviceIOR2));
CrashRecoveryDelays.awaitRecoveryCR10();
boolean correct = true;
OTS.current().begin();
IntHolder valueHolder1 = new IntHolder();
IntHolder valueHolder2 = new IntHolder();
service1.get(OTS.current().get_control(), valueHolder1);
service2.get(OTS.current().get_control(), valueHolder2);
correct = correct && (valueHolder1.value == 0);
correct = correct && (valueHolder2.value == 0);
OTS.current().commit(true);
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);
}
}
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]);
Service service = ServiceHelper.narrow(ORBInterface.orb().string_to_object(serviceIOR));
CrashRecoveryDelays.awaitRecoveryCR09();
boolean correct = true;
OTS.current().begin();
IntHolder valueHolder = new IntHolder();
service.get(valueHolder);
correct = correct && (valueHolder.value == 0);
OTS.current().commit(true);
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);
}
}
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 serviceIOR1 = ServerIORStore.loadIOR(args[args.length - 2]);
Service service1 = ServiceHelper.narrow(ORBInterface.orb().string_to_object(serviceIOR1));
String serviceIOR2 = ServerIORStore.loadIOR(args[args.length - 1]);
Service service2 = ServiceHelper.narrow(ORBInterface.orb().string_to_object(serviceIOR2));
CrashRecoveryDelays.awaitRecoveryCR09();
boolean correct = true;
OTS.current().begin();
IntHolder valueHolder1 = new IntHolder();
IntHolder valueHolder2 = new IntHolder();
service1.get(valueHolder1);
service2.get(valueHolder2);
correct = correct && (valueHolder1.value == 0);
correct = correct && (valueHolder2.value == 0);
OTS.current().commit(true);
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);
}
}
use of org.omg.CORBA.IntHolder in project narayana by jbosstm.
the class Client01a method main.
public static void main(String[] args) {
try {
ORBInterface.initORB(args, null);
OAInterface.initOA();
String serviceIOR = ServerIORStore.loadIOR(args[args.length - 1]);
Service service = ServiceHelper.narrow(ORBInterface.orb().string_to_object(serviceIOR));
CrashRecoveryDelays.awaitRecoveryCR10();
boolean correct = true;
OTS.current().begin();
IntHolder valueHolder = new IntHolder();
service.get(OTS.get_current().get_control(), valueHolder);
correct = correct && (valueHolder.value == 1);
OTS.current().commit(true);
if (correct) {
System.out.println("Passed");
} else {
System.out.println("Failed");
}
} catch (Exception exception) {
System.out.println("Failed");
System.err.println("Client01a.main: " + exception);
exception.printStackTrace(System.err);
}
try {
OAInterface.shutdownOA();
ORBInterface.shutdownORB();
} catch (Exception exception) {
System.err.println("Client01a.main: " + exception);
exception.printStackTrace(System.err);
}
}
Aggregations