Basic HTML version of Foils prepared July 15 1998

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

From Java Distributed Collaborative Environment as a CORBA and RMI Example Tutorial: ITEA HPCC Conference Aberdeen Md. -- July 13 98. by Shrideep Pallickara


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

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