建议新手和我一样,从官网下载英文文档,开个有道词典,慢慢啃。ICE学习笔记一----运行官方的java版demo程序

官方文档下载:

http://download.csdn.net/detail/xiong_mao_1/6300631


程序代码就不说了,我照抄文档的,以下都是个人笔记。

ICE学习笔记一----运行官方的java版demo程序

slice2java后,生成了这些文档,具体每个文件的含义有得学习,先mark个。

ICE学习笔记一----运行官方的java版demo程序

我是在eclipse中运行的,

ICE学习笔记一----运行官方的java版demo程序

结果图!嘿嘿,小兴奋中~~

ICE学习笔记一----运行官方的java版demo程序


eclipse工程打包下载:

http://download.csdn.net/detail/xiong_mao_1/6300697


关于客户端代码一个知识点:

源码:

Ice.ObjectPrx base = ic.stringToProxy("SimplePrinter:default -p 10000");
PrinterPrx printer = PrinterPrxHelper.checkedCast(base);


官方文档解释:

The proxy returned by sringToProxy is of type Ice.ObjectPrx,which is at the root of the inheritance tree for interfaces and classes. But to actually talk to our printer, we need a proxy for aPrinterinterface, not anObject interface. To do this,we need to do adown-cast by callingPrinterPrxHelper.checkedCast.A checked cast sends a message to the server, effectively asking “is this aproxy for a Printer interface?” If so, the call returns a proxy of typeDemo::Printer; otherwise, if the proxy denotes an interface of some other type,the call returns null.



相关文章:

  • 2021-10-06
  • 2021-07-18
  • 2021-11-21
  • 2021-09-19
  • 2018-03-05
  • 2021-09-14
  • 2022-12-23
  • 2021-10-23
猜你喜欢
  • 2021-07-23
  • 2021-12-14
  • 2022-12-23
  • 2022-12-23
  • 2021-11-01
  • 2022-01-09
相关资源
相似解决方案