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

推荐订阅源

博客园 - Franky
C
CXSECURITY Database RSS Feed - CXSecurity.com
S
Schneier on Security
Know Your Adversary
Know Your Adversary
Security Latest
Security Latest
Spread Privacy
Spread Privacy
Project Zero
Project Zero
T
The Exploit Database - CXSecurity.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
AI
AI
N
News | PayPal Newsroom
A
Arctic Wolf
NISL@THU
NISL@THU
W
WeLiveSecurity
Security Archives - TechRepublic
Security Archives - TechRepublic
Hacker News: Ask HN
Hacker News: Ask HN
P
Palo Alto Networks Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
大猫的无限游戏
大猫的无限游戏
L
Lohrmann on Cybersecurity
Last Week in AI
Last Week in AI
T
Threatpost
The Last Watchdog
The Last Watchdog
博客园_首页
C
Cybersecurity and Infrastructure Security Agency CISA
酷 壳 – CoolShell
酷 壳 – CoolShell
量子位
Engineering at Meta
Engineering at Meta
爱范儿
爱范儿
aimingoo的专栏
aimingoo的专栏
S
Security Affairs
P
Privacy & Cybersecurity Law Blog
B
Blog RSS Feed
AWS News Blog
AWS News Blog
P
Proofpoint News Feed
雷峰网
雷峰网
T
Tenable Blog
Schneier on Security
Schneier on Security
H
Heimdal Security Blog
V2EX - 技术
V2EX - 技术
V
V2EX
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
Secure Thoughts
Latest news
Latest news
Help Net Security
Help Net Security
Jina AI
Jina AI
Stack Overflow Blog
Stack Overflow Blog
The Cloudflare Blog
V
Vulnerabilities – Threatpost
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org

博客园 - 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");