Basic HTML version of Foils prepared July 5 98

Foil 46 Binding to the sessionScheduler (CORBA) Vs (RMI)

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


1 CORBA Binding Process.
2
3 private void getSessionSchedulerHandle() {
4 try {
5 // Initialize the ORB.
6 org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(this, null);
7
8 // Calculate Start time
9 long startTime = System.currentTimeMillis();
10 // Bind to the Scheduler Object
11 /* Get a reference to the Naming Service */
12 org.omg.CORBA.Object nameServiceObj =
13 orb.resolve_initial_references("NameService");
14
15 if (nameServiceObj == null) {
16 System.out.println("Name Service Object = null");
17 return;
18 }
19
20 org.omg.CosNaming.NamingContext nameService =
21 org.omg.CosNaming.NamingContextHelper.narrow(nameServiceObj);
22 if (nameService == null) {
23 System.out.println("nameService = null");
24 return;
25 }
26
27 NameComponent[] collabName =
28 { new NameComponent("Collaboration", "Scheduler")};
29 _chatSession=
30 jdce.scheduler.sessionSchedulerHelper.narrow(nameService.resolve(collabName));
31 } catch(Exception e) {
32 System.out.println("Exception: " + e);
33 }
34 }
35 RMI Binding Process
36
37 private void getSessionSchedulerHandle() {
38 try {
39 remoteObject =
40 Naming.lookup("rmi://jojo.npac.syr.edu:7000/Scheduler");
41 } catch (java.lang.Exception exec) {
42 System.out.println("Unable to lookup created Scheduler");
43 }
44 _chatSession = (jdce.scheduler.RMISessionScheduler) remoteObject;
45 }

in Table To:


© 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