String filename = "ior.txt";
org.omg.CORBA.Object obj = null;
File file = new File(filename);
String ior_context = readIorFile(filename);
if (ior_context == null) {
log.error("解析ior文件失败,跳出程序!");
return -1;
}
ior_context = ior_context.trim();
log.info("-------入口点IOR文件内容为--------" + ior_context);
obj = this.orb.string_to_object(ior_context);
}
EmsSessionFactory_I m_emsFactory = EmsSessionFactory_IHelper.narrow(obj);
-------------------解析完毕 接下来是获取 POA 获取emsSession 利用 Common_IHolder 初始化各种管理器
//--------------------------- readIorFile
public String readIorFile(String fileName)
{
BufferedReader bufferedreader = null;
try {
bufferedreader = new BufferedReader(new InputStreamReader(new FileInputStream(fileName)));
}
catch (FileNotFoundException ex) {
log.error("找不到ior文件------->" + fileName, ex);
return null;
}
try {
String s = bufferedreader.readLine();
return s;
} catch (IOException ex1) {
log.error("读取ior文件" + fileName + "失败------->", ex1);
}return null;
}