Cisco Cisco Prime Optical 9.6 Developer's Guide

Page of 818
Cisco Prime Optical 9.6.3 GateWay/CORBA Programmer Reference Guide 
OL-28047-01
 
 
750
 
// or  
             
 // Option 2: corbaloc URL 
 String objRef = "corbaloc:iiop:gatewayserver.cisco.com:14005/NameServiceGWC"; 
org.omg.CORBA.Object obj = global_orb.string_to_object(objRef); 
/*  NOTE: Please replace "gatewayserver.cisco.com" with the name of the server 
on which CORBA Naming service is running. */ 
// Narrow to root naming context 
NamingContextExt root_context = NamingContextExtHelper.narrow(obj); 
 
}  
catch (org.omg.CORBA.ORBPackage.InvalidName inEx) {  
// Exception handling  
7.2.2.3  Get Reference to EMSSessionFactory 
Follow the example in 
 to obtain a reference to the 
naming service.  
NameComponent name = new NameComponent[6]; 
name[0] = new NameComponent("TMF_MTNM", "Class");  
name[1] = new NameComponent("Cisco Systems", "Vendor"); 
name[2] = new NameComponent("Cisco Prime Optical", "EMSInstance"); 
name[3] = new NameComponent(version, "Version"); //where version = "9_5" for 
Prime Optical 9.5 
name[4] = new NameComponent(ctm_sys_id, "EMS"); // ctm_sys_id = "PrimeOptical" 
name[5] = new NameComponent("SessionFactory", "EmsSessionFactory"); 
try {  
org.omg.CORBA.Object emsSessionI = root_context.resolve(name);  
}  
catch (InvalidName inEx) {  
// Exception handling  
}  
catch (NotFound nfEx) {  
// Exception handling  
7.2.2.4  Implement NmsSession_IOperations 
import org.tmforum.mtnm.session.*;  
import org.tmforum.mtnm.nmsSession.*; 
 
public class SessionImpl implements NmsSession_IOperations {