CORAB 对 ior 文件的解析使用

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


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部