惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
V
Visual Studio Blog
P
Privacy International News Feed
月光博客
月光博客
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
L
Lohrmann on Cybersecurity
N
News and Events Feed by Topic
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Apple Machine Learning Research
Apple Machine Learning Research
阮一峰的网络日志
阮一峰的网络日志
Webroot Blog
Webroot Blog
T
Threatpost
宝玉的分享
宝玉的分享
The Last Watchdog
The Last Watchdog
小众软件
小众软件
L
LINUX DO - 最新话题
C
Cisco Blogs
T
Troy Hunt's Blog
Schneier on Security
Schneier on Security
酷 壳 – CoolShell
酷 壳 – CoolShell
www.infosecurity-magazine.com
www.infosecurity-magazine.com
雷峰网
雷峰网
G
GRAHAM CLULEY
有赞技术团队
有赞技术团队
Know Your Adversary
Know Your Adversary
博客园 - 叶小钗
罗磊的独立博客
V
V2EX
博客园 - Franky
P
Proofpoint News Feed
SecWiki News
SecWiki News
腾讯CDC
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Jina AI
Jina AI
博客园 - 三生石上(FineUI控件)
S
Secure Thoughts
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Google DeepMind News
Google DeepMind News
Attack and Defense Labs
Attack and Defense Labs
人人都是产品经理
人人都是产品经理
The Cloudflare Blog
PCI Perspectives
PCI Perspectives
V2EX - 技术
V2EX - 技术
Google DeepMind News
Google DeepMind News
Last Week in AI
Last Week in AI
aimingoo的专栏
aimingoo的专栏
Cisco Talos Blog
Cisco Talos Blog
N
News and Events Feed by Topic
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
S
SegmentFault 最新的问题

博客园 - FallingAutumn

mysql常用命令集锦 Java ClassLoader加载机制理解 实际例子 Java ClassLoader加载机制理解 myeclipse 8.5破解方法 Replace Pioneer 试用推广 linux下关于压缩、解压相关的操作 关于hessian接口类方法顺序及对象序列化的实战研究 Java对象引用传递探索 mysql 语句or效率问题 Java异常学习总结 log4j配置详解 vs2005 sp1补丁安装,报1718错误: 数字签名拒绝 无法访问Windows Installer服务 之错误解决 打开word时,”无法注册这篇文档,不能创建从其他文档到这篇文档的链接“ 错误的解决 Oracle中DBMS_JOB.SUBMIT的用法说明 vs2008 sp1如何修复、删除以及增加组件的方法 OCI-22053: 溢出错误 的原因和解决方案 statspack的实战学习 - FallingAutumn - 博客园 ORACLE中,Schema的理解
JAVA RMI调用实战学习
FallingAutumn · 2013-10-24 · via 博客园 - FallingAutumn

JAVA RMI 实战示例,参考网址: http://diaoge.iteye.com/blog/245170

这个示例很清楚地阐释了rmi的使用方法, 但示例都是放在一起的, 实际使用中我们可能会将生成的stub.class发给客户端用的,这里说下这种用法。 

1、利用rmic对生成的远程class文件生成stub类,即:rmic package.RemoteInterfaceImpl  即可生成RemoteInterfaceImpl_stub.class(注意: rmic针对的是.class,而不是.java文件)

2、将stub.class文件打成jar包,或者直接发给调用方,如果涉及到bean类,也要发给对方(必须可序列化,否则无法远程调用)

3、调用方导入包含stub的jar包,或者直接引入.class(eclipse里可以直接引用class的,具体google)

4、直接实例化stub,如下,然后即可正常调用。 

RemoteInterfaceImpl_Stub stub = (RemoteInterfaceImpl_Stub) Naming.lookup("//url:port/service_name");