CORBA Binding Process. |
private void getSessionSchedulerHandle() { |
try { |
// Initialize the ORB. |
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(this, null); |
// Calculate Start time |
long startTime = System.currentTimeMillis(); |
// Bind to the Scheduler Object |
/* 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", "Scheduler")}; |
_chatSession= |
jdce.scheduler.sessionSchedulerHelper.narrow(nameService.resolve(collabName)); |
} catch(Exception e) { |
System.out.println("Exception: " + e); |
} |
} |
RMI Binding Process |
private void getSessionSchedulerHandle() { |
try { |
remoteObject = |
Naming.lookup("rmi://jojo.npac.syr.edu:7000/Scheduler"); |
} catch (java.lang.Exception exec) { |
System.out.println("Unable to lookup created Scheduler"); |
} |
_chatSession = (jdce.scheduler.RMISessionScheduler) remoteObject; |
} |