植物纤维是什么面料| 晕血是什么原因| 子宫在肚脐眼什么位置| 天使长什么样| 奇亚籽在中国叫什么| 乙肝e抗体阴性是什么意思| 冰丝是什么材料| 健康证明需要检查什么| 虫草花不能和什么一起吃| 石见念什么| 脸上突然长痣是什么原因| 鸽子是什么意思| 机票什么时候买最便宜| 6.21什么星座| 警察是什么编制| 宫寒吃什么药| 症瘕病是什么病| 限购是什么意思| 血压低是什么原因造成的| 割伤用什么药愈合伤口| 切忌是什么意思| 硼砂是什么东西| 眼皮发肿是什么原因| 浅黄色是什么颜色| 国家安全法属于什么法| 长期喝枸杞水有什么好处和坏处| 两拐是什么军衔| 什么是肠镜检查| 肛门潮湿是什么情况| 人流后吃什么水果| 薄熙来犯了什么罪| 7月29号是什么星座| 梦见哭是什么意思| 胃出血有什么症状表现| 奶粉结块是什么原因| 18k是什么金| 荨麻疹忌口什么食物| 尿里有泡沫是什么原因| 什么枝条| 鼻子上长痘痘是什么原因| 血糖高喝什么酒好| 树挪死人挪活是什么意思| 草酸对人体有什么危害| 哽咽是什么意思| 手癣是什么原因引起的| 肺癌晚期有什么症状| 眼压高是什么原因引起的| 溥仪为什么没有后代| 才高八斗是什么意思| 区级以上医院是什么意思| 蛇缠身是什么病| 心肌缺血吃什么药管用| 波子是什么车| 增强免疫力的针叫什么| 柠檬有什么作用| 药食同源是什么意思| 肺部真菌感染吃什么药| 吃生葵花籽有什么好处和坏处吗| 农历六月十二是什么日子| 怀孕了有什么征兆| 血压压差小是什么原因| 舌头上有红点点是什么原因| 没收个人全部财产是什么意思| 西游记告诉我们什么道理| 肝掌是什么样子| 高铁为什么会晚点| 初一的月亮是什么形状| 指甲看什么科| 事不过三是什么意思| 日柱国印是什么意思| 胎盘成熟度1级是什么意思| 什么地飞| 四六级要带什么| 月亮为什么是红色的| 尿毒症什么症状| 脚趾发紫是什么原因| store是什么| 提高免疫力吃什么食物| 手指盖空了是什么原因| 工口什么意思| 马鞍皮是什么皮| 澄面粉是什么面粉| 佛陀是什么意思| 中性粒细胞比率偏低是什么意思| 阴虚便秘吃什么中成药| 老人大便失禁是什么原因| 碧根果和核桃有什么区别| 血脂高适合吃什么食物| 跳蚤的天敌是什么| 木危读什么| 眩光是什么意思| 提炼是什么意思| 梦见房子漏水是什么意思| 灰指甲用什么药膏| 小米粥和什么搭配最好| 下巴反复长痘痘是什么原因| 猪肉排酸是什么意思| 秋天有什么植物| 奶糕是什么| 梦见狐狸是什么预兆| 吃什么对睡眠好| 女生怀孕的前兆是什么| 蹦蹦跳跳的动物是什么生肖| 膀胱充盈欠佳什么意思| 洛神花茶有什么功效| 孕妇梦到蛇是什么意思| 简单明了是什么意思| 夕阳西下是什么意思| 浪子回头金不换是什么意思| 尿道炎用什么药治疗| tct是检查什么| 尿路感染吃什么药效果好| 肝炎吃什么药| 什么颜色衣服显皮肤白| 食欲不振吃什么药| 过敏性结膜炎用什么眼药水| 梦见和死去的人说话是什么意思| 桥本甲状腺炎挂什么科| 今天的日子适合做什么| 马齿苋什么人不能吃| 生活补贴是什么意思| 什么人容易得脑溢血| 吃了避孕药有什么副作用| 儿保做些什么检查项目| 炖牛肉放什么调料最好| 发热是什么症状| 什么时候需要打破伤风针| 什么样的孕妇容易翻盘| 肺部钙化灶是什么意思| 中心思想是什么意思| 痔疮是什么样的图片| 脚痛是什么原因| 姨妈少是什么原因怎么办| 角化型足癣用什么药| 收是什么生肖| 吃什么能排结石| 什么睡姿可以矫正驼背| 压箱钱是什么意思| 血脂高吃什么药效果好| 动则气喘是什么原因| 广西为什么简称桂| 红眼病吃什么药| 头皮疼是什么原因引起的| 中性粒细胞绝对值偏高是什么原因| maby什么意思| 元朝是什么民族| 预设是什么意思| ecology是什么意思| 口腔溃疡是什么原因| 麦冬有什么功效| 垂体饱满是什么意思| 叶酸每天什么时候吃最好| 后会有期什么意思| 轻度贫血有什么症状| 小葱拌豆腐的下一句是什么| 两个c交叉是什么牌子| 间质性肺病是什么意思| 燊念什么| 为什么鞋子洗了还是臭| 青光眼是什么原因引起的| 水苏糖是什么东西| 墨池为什么不爱柔嘉了| 牛头马面是什么生肖| 水是由什么组成的| 手术后吃什么最好| 寿司用什么米做好吃| 耳鼻喉科主要看什么病| 苹果醋什么时候喝最好| 什么原因导致尿酸高| 什么是设计| 查微量元素挂什么科| 发烧能吃什么| 蟾酥是什么| 巨蟹座和什么座最配| 眼袋重是什么原因| 变形虫是什么生物| 流水生财是什么意思| 小龙虾不能和什么一起吃| 电是什么| 苍鹰是什么意思| 什么叫辟谷减肥法| 1936年中国发生了什么| 半边脸肿是什么原因引起的| 亢是什么意思| 子加一笔是什么字| 什么明月| 为什么会长瘤| 肠道炎有什么症状| 慰安妇是什么意思| 什么叫脑梗| 走路快的人是什么性格| 名士手表属于什么档次| 头孢不能和什么一起吃| 手腕凸起的骨头叫什么| 24k镀金是什么意思| 容易出汗什么原因| 软文什么意思| 哀大莫过于心死是什么意思| 230是什么意思| 感冒发烧吃什么药比较好| 酸枣仁配什么治疗失眠| 脚底痛挂什么科| 毛笔是用什么毛做的| 心肌缺血吃什么食物| 大名鼎鼎的鼎是什么意思| 为什么会长癣| 大姨妈来的少是什么原因| 善变是什么意思| 前列腺多发钙化灶是什么意思| 龟头有红点用什么药| 卷饼里面配什么菜好吃| 世界上最大的动物是什么| 忏悔是什么意思| 梦见种花生是什么意思| 咕咚是什么| 一个入一个肉念什么| 我们都没错只是不适合是什么歌| 飞机用什么油| 蝙蝠吃什么| ras医学上是什么意思| 剑突下是什么位置| 头晕喝什么饮料| 九月份什么星座| 降血脂有什么好办法| 圣女果是什么水果| 为什么会起荨麻疹| 人生的意义是什么| 贫血什么症状| 解语花是什么意思| 脾虚湿热吃什么药| 0是什么数| pph是什么材料| 检查肺结节挂什么科| 骏五行属什么| 什么烟好抽| 什么样的包皮需要做手术| 高锰酸钾是什么东西| 真菌最怕什么| 黄皮果是什么水果| 脚底有痣代表什么意思| 男士带什么手串好| 鸡枞是什么| 止境是什么意思| rds是什么意思| sat是什么考试| 8月24号是什么星座| 复杂性囊肿是什么意思| 胎盘0级是什么意思啊| 升结肠管状腺瘤是什么意思| 吃什么可以增加黄体酮| 润喉喝什么| 七月一号是什么星座| 夕阳无限好是什么意思| 智齿是什么原因引起的| 大腿肌肉酸痛是什么病| 溺爱的意思是什么| 小便尿出乳白色液体是什么问题| 脂肪瘤长什么样| 总胆固醇高有什么症状| 柠檬片泡水喝有什么功效和作用| 肺炎吃什么水果好| 电动轮椅什么牌子质量好| 尿失禁用什么药好| 乌龟不吃食是什么原因| 百度

iOS用户流失9% 日益惨淡的苹果该如何扭转颓势

百度   “3D藏宝图”并非一张实际的地图,而是利用多种探测手段对考古区域的扫描成像。

The Java Remote Method Invocation (Java RMI) is a Java API that performs remote method invocation, the object-oriented equivalent of remote procedure calls (RPC), with support for direct transfer of serialized Java classes and distributed garbage-collection.

A typical implementation model of Java-RMI using stub and skeleton objects. Java 2 SDK, Standard Edition, v1.2 removed the need for a skeleton.

The original implementation depends on Java Virtual Machine (JVM) class-representation mechanisms and it thus only supports making calls from one JVM to another. The protocol underlying this Java-only implementation is known as Java Remote Method Protocol (JRMP). In order to support code running in a non-JVM context, programmers later developed a CORBA version.

Usage of the term RMI may denote solely the programming interface or may signify both the API and JRMP, IIOP, or another implementation, whereas the term RMI-IIOP (read: RMI over IIOP) specifically denotes the RMI interface delegating most of the functionality to the supporting CORBA implementation.

The basic idea of Java RMI, the distributed garbage-collection (DGC) protocol, and much of the architecture underlying the original Sun implementation, come from the "network objects" feature of Modula-3.

Generalized code

edit

The programmers of the original RMI API generalized the code somewhat to support different implementations, such as a HTTP transport. Additionally, the ability to pass arguments "by value" was added to CORBA in order to be compatible with the RMI interface. Still, the RMI-IIOP and JRMP implementations do not have fully identical interfaces.

RMI functionality comes in the package java.rmi, while most of Sun's implementation is located in the sun.rmi package. Note that with Java versions before Java 5.0, developers had to compile RMI stubs in a separate compilation step using rmic. Version 5.0 of Java and beyond no longer require this step - and static stubs have been deprecated since Java 8.

Jini version

edit

Jini offers a more advanced version of RMI in Java. It functions similarly but provides more advanced security, object discovery capabilities, and other mechanisms for distributed object applications.[1]

Example

edit

The following classes implement a simple client-server program using RMI that displays a message.

RmiServerIntf interface
defines the interface that is used by the client and implemented by the server. This extends the java.rmi.Remote interface, which serves to identify an implementing class as one with remotely-invokable methods.
import java.rmi.Remote;
import java.rmi.RemoteException;

public interface RmiServerIntf extends Remote {
    String getMessage() throws RemoteException;
}
RmiServer class
listens to RMI requests and implements the interface which is used by the client to invoke remote methods.
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.rmi.registry.*;

public class RmiServer extends UnicastRemoteObject implements RmiServerIntf {
    public static final String MESSAGE = "Hello World";

    public RmiServer() throws RemoteException {
        super(0); // required to avoid the 'rmic' step, see below
    }

    public String getMessage() {
        return MESSAGE;
    }

    public static void main(String[] args) throws Exception {
        System.out.println("RMI server started");

        try { //special exception handler for registry creation
            LocateRegistry.createRegistry(1099);
            System.out.println("java RMI registry created.");
        } catch (RemoteException e) {
            //do nothing, error means registry already exists
            System.out.println("java RMI registry already exists.");
        }
           
        //Instantiate RmiServer
        RmiServer server = new RmiServer();

        // Bind this object instance to the name "RmiServer"
        Naming.rebind("//localhost/RmiServer", server);
        System.out.println("PeerServer bound in registry");
    }
}
RmiClient class
this is the client which gets the reference (a proxy) to the remote object living on the server and invokes its method to get a message. If the server object implemented java.io.Serializable instead of java.rmi.Remote, it would be serialized and passed to the client as a value.[2]
import java.rmi.Naming;

public class RmiClient {
    public static void main(String[] args) throws Exception {
        RmiServerIntf server = (RmiServerIntf)Naming.lookup("//localhost/RmiServer");
        System.out.println(server.getMessage());
    }
}

Before running this example, we need to make a 'stub' file for the interface we used. For this task we have the RMI compiler - 'rmic'

  • Note: we make a stub file from the '*.class' file with the implementation of the remote interface, not from the '*.java' file.
rmic RmiServer

Note that since version 5.0 of J2SE, support for dynamically generated stub files has been added, and rmic is only provided for backwards compatibility with earlier runtimes,[3] or for programs that don't provide an explicit port number (or zero) when exporting remote objects, which is required for generated stubs to be possible, as described in the Javadoc for UnicastRemoteObject. See the comment in the constructor above.

References

edit
  1. ^ Taylor, Ian J (2005). From P2P to Web Services and Grids : Peers in a Client/Server World. Computer Communications and Networks. London: Springer-Verlag. doi:10.1007/b138333. ISBN 1852338695. OCLC 827073874.[page needed]
  2. ^ Wilson, M. Jeff (November 10, 2000). "Get smart with proxies and RMI". JavaWorld. Retrieved 2025-08-07.
  3. ^ "Java RMI Release Notes". Oracle. Retrieved 9 May 2012.
edit
今年什么生肖年 1994年属狗的是什么命 别见怪是什么意思 长命的动物是什么生肖 投诚是什么意思
211属于什么大学 什么是清宫 甲减的原因是什么引起的 刚感染艾滋病什么症状 蜂蜜不能和什么食物一起吃
上火便秘吃什么最快排便 救星是什么意思 什么是卫校 口淡无味是什么原因 鸡肉和什么不能一起吃
操逼什么意思 伤官配印是什么意思 脸无缘无故的肿是什么原因 走路不稳是什么原因 步步高升是什么意思
莫言是什么意思hcv8jop4ns0r.cn 漳平水仙茶属于什么茶hcv9jop3ns4r.cn 广东有什么特产hcv8jop8ns2r.cn 什么都值得买hcv8jop8ns2r.cn 崩漏下血是什么意思hcv7jop4ns6r.cn
切口憩室是什么意思hcv9jop5ns4r.cn 双鱼座女和什么星座最配jiuxinfghf.com 为什么摩羯女颜值都高hcv8jop5ns1r.cn 奥硝唑和甲硝唑有什么区别fenrenren.com 离婚需要什么资料hcv9jop5ns4r.cn
梦见死人笑什么预兆fenrenren.com 吸烟有什么危害hcv8jop6ns7r.cn 感冒流清水鼻涕吃什么药hcv8jop2ns6r.cn 白喉是什么意思hcv9jop0ns2r.cn 什么植物和动物很像鸡sscsqa.com
冷面是用什么面做的hcv8jop8ns0r.cn 为什么老是梦到男朋友hcv8jop3ns4r.cn 梦见自己鼻子流血是什么预兆hcv9jop2ns9r.cn 补气养血吃什么中成药hcv8jop6ns5r.cn 内分泌失调有什么症状gysmod.com
百度