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 | } |