Basic HTML version of Foils prepared July 5 98

Foil 47 Getting a handle to the DataBahn (CORBA)

From FMS: Forces Modeling and Simulation Handout JSU HPC Summer Institute for Undergraduates, Jackson MS -- June 15 1998. by Wojtek Furmanski, Subhash Nair, Tom Pulikal


public void getDataBahnHandle() {
try {
_chatSession.createBahn(partyName, "Chat");
System.out.println("New Party created");
} catch (jdceBahnException e) {
System.out.println("Exception in creations" +e);
} catch (Exception e) {
e.printStackTrace();
}
long startTime = System.currentTimeMillis();
try {
// Initialize the ORB.
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(this, null);
/* Get a reference to the Naming Service */
org.omg.CORBA.Object nameServiceObj =
orb.resolve_initial_references("NameService");
if (nameServiceObj == null) {
System.out.println("Name Service Object = null");
return;
}
org.omg.CosNaming.NamingContext nameService =
org.omg.CosNaming.NamingContextHelper.narrow(nameServiceObj);
if (nameService == null) {
System.out.println("nameService = null");
return;
}
NameComponent[] collabName =
{ new NameComponent("Collaboration", partyName+"Chat"+"Coordinator")};
_chatBahn=
jdce.byteways.dataBahnHelper.narrow(nameService.resolve(collabName));
} catch(Exception e) {
System.out.println("Exception: " + e);
}
long stopTime = System.currentTimeMillis();
System.out.println("Avg Ping to invoke = "
+ ((stopTime - startTime)/1000f) + " msecs");
}



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sat Nov 28 1998