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

2 篇文章 0 订阅

建议新手和我一样,从官网下载英文文档,开个有道词典,慢慢啃。大笑

官方文档下载:

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


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


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


我是在eclipse中运行的,


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



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.



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值