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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值