关于 Jini API 的问题
我正在尝试了解 java 中的 Jini API,但无法理解服务器和客户端如何交互,并且经常看到被称为“智能代理”的东西。什么是智能代理?客户端和服务器如何交互?
谢谢。
I am trying to learn about the Jini API in java, but can't get my head around how the server and client interact, and am constantly seeing things being referred to as "smart proxies". What are smart proxies? And how does the client and server interact ?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Jini 基于 Java RMI,因此客户端和服务器之间的通信就像在 RMI 中一样:在线上使用 RMI 协议进行请求/响应。
至于“智能代理”,Jini 编译器使用代理工厂为您的接口生成实现代码,其中包括用于发送和接收有关服务的元数据的 API。这种魔力使得客户端可以在网络上发出对某种服务的请求(例如“我想要一台彩色激光绘图仪”),并从响应中进行选择以找到可能的最佳匹配。
Jini is based on Java RMI, so clients and servers communicate with each other just as they do in RMI: request/response using RMI protocol on the wire.
As for the "smart proxies", the Jini compiler uses a proxy factory to generate implementation code for your interface that includes an API for sending and receiving meta data about services. This is the magic that makes it possible for a client to send out a request for a certain kind of service on the network (e.g. "I'd like a color laser plotter") and select from the responses to find the best match possible.