Knowledge

Java remote method invocation

Source 📝

28: 799:
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, or for programs that don't provide an explicit port number (or zero) when exporting remote objects, which is required for
81:(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 653:
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
161:
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.
111:
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
131:" 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. 82: 788:
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'
55: 977: 36: 800:
generated stubs to be possible, as described in the Javadoc for UnicastRemoteObject. See the comment in the constructor above.
144:
package. Note that with Java versions before Java 5.0 developers had to compile RMI stubs in a separate compilation step using
792:
Note: we make a stub file from the '*.class' file with the implementation of the remote interface, not from the '*.java' file.
1020: 957: 838: 71: 136: 124: 123:
The programmers of the original RMI API generalized the code somewhat to support different implementations, such as a
52: 863: 59: 1015: 915: 254:
listens to RMI requests and implements the interface which is used by the client to invoke remote methods.
63: 951: 940: 994: 78: 889: 172:
The following classes implement a simple client-server program using RMI that displays a message.
923: 104:) specifically denotes the RMI interface delegating most of the functionality to the supporting 844: 834: 945: 936: 826: 970: 819: 1000: 1009: 128: 67: 27: 92:
may denote solely the programming interface or may signify both the API and JRMP,
182:
defines the interface that is used by the client and implemented by the server.
32: 848: 966: 868: 39:
objects. Java 2 SDK, Standard Edition, v1.2 removed the need for a skeleton.
112: 97: 821:
From P2P to Web Services and Grids : Peers in a Client/Server World
17: 830: 105: 26: 825:. Computer Communications and Networks. London: Springer-Verlag. 158: 101: 93: 587:// Bind this object instance to the name "RmiServer" 150:. Version 5.0 of Java and beyond no longer require this step. 127:
transport. Additionally, the ability to pass arguments "
374:// required to avoid the 'rmic' step, see below 140:, while most of Sun's implementation is located in the 939:- a good starting point to learn RMI. Also check the 818: 948:- Very good for training JavaRMI and as reference 536://do nothing, error means registry already exists 470://special exception handler for registry creation 31:A typical implementation model of Java-RMI using 971:"A Distributed Object Model for the Java System" 961:(Sun's Java API Reference for the RMI package) 96:, or another implementation, whereas the term 920:Oracle Technology Network for Java Developers 557:"java RMI registry already exists." 8: 997:- an introduction to RMI in Oracle Weblogic. 66:(RPC), with support for direct transfer of 632:"PeerServer bound in registry" 809: 134:RMI functionality comes in the package 77:The original implementation depends on 509:"java RMI registry created." 862:Wilson, M. Jeff (November 10, 2000). 7: 62:, the object-oriented equivalent of 281:java.rmi.server.UnicastRemoteObject 25: 744:"//localhost/RmiServer" 602:"//localhost/RmiServer" 1001:General Remote Method Invocation 864:"Get smart with proxies and RMI" 983:from the original on 2022-10-10 916:"Remote Method Invocation Home" 458:"RMI server started" 72:distributed garbage-collection 1: 45:Java Remote Method Invocation 952:The RMI page in the JDK docs 946:the Java RMI online training 965:Ann Wollrath; Roger Riggs; 922:. Redwood Shores, CA, USA: 1037: 995:Programming WebLogic RMI 890:"Java RMI Release Notes" 657: 272:java.rmi.RemoteException 257: 200:java.rmi.RemoteException 185: 60:remote method invocation 566://Instantiate RmiServer 338:"Hello World" 817:Taylor, Ian J (2005). 64:remote procedure calls 40: 1021:Remote procedure call 937:The Java RMI tutorial 30: 79:Java Virtual Machine 308:UnicastRemoteObject 290:java.rmi.registry.* 941:Hello World in RMI 924:Oracle Corporation 88:Usage of the term 41: 70:Java classes and 16:(Redirected from 1028: 991: 989: 988: 982: 975: 960: 933: 931: 930: 902: 901: 899: 897: 886: 880: 879: 877: 876: 859: 853: 852: 824: 814: 784: 781: 778: 775: 772: 769: 766: 763: 760: 757: 754: 751: 748: 745: 742: 739: 736: 733: 730: 727: 724: 721: 718: 715: 712: 709: 706: 703: 700: 697: 694: 691: 688: 685: 682: 679: 676: 673: 670: 667: 664: 661: 649: 642: 639: 636: 633: 630: 627: 624: 621: 618: 615: 612: 609: 606: 603: 600: 597: 594: 591: 588: 585: 582: 579: 576: 573: 570: 567: 564: 561: 558: 555: 552: 549: 546: 543: 540: 537: 534: 531: 528: 525: 522: 519: 516: 513: 510: 507: 504: 501: 498: 495: 492: 489: 486: 483: 480: 477: 474: 471: 468: 465: 462: 459: 456: 453: 450: 447: 444: 441: 438: 435: 432: 429: 426: 423: 420: 417: 414: 411: 408: 405: 402: 399: 396: 393: 390: 387: 384: 381: 378: 375: 372: 369: 366: 363: 360: 357: 354: 351: 348: 345: 342: 339: 336: 333: 330: 327: 324: 321: 318: 315: 312: 309: 306: 303: 300: 297: 294: 291: 288: 285: 282: 279: 276: 273: 270: 267: 264: 261: 250: 243: 240: 237: 234: 231: 228: 225: 222: 219: 216: 213: 210: 207: 204: 201: 198: 195: 192: 189: 178: 149: 143: 139: 119:Generalized code 108:implementation. 100:(read: RMI over 21: 1036: 1035: 1031: 1030: 1029: 1027: 1026: 1025: 1006: 1005: 986: 984: 980: 973: 964: 956: 928: 926: 914: 911: 906: 905: 895: 893: 888: 887: 883: 874: 872: 861: 860: 856: 841: 831:10.1007/b138333 816: 815: 811: 806: 797: 796:rmic RmiServer 786: 785: 782: 779: 776: 773: 770: 767: 764: 761: 758: 755: 752: 749: 746: 743: 740: 737: 734: 731: 728: 725: 722: 719: 716: 713: 710: 707: 704: 701: 698: 695: 692: 689: 686: 683: 680: 677: 674: 671: 668: 665: 663:java.rmi.Naming 662: 659: 647: 644: 643: 640: 637: 634: 631: 628: 625: 622: 619: 616: 613: 610: 607: 604: 601: 598: 595: 592: 589: 586: 583: 580: 577: 574: 571: 568: 565: 562: 559: 556: 553: 550: 547: 544: 541: 538: 535: 532: 529: 526: 524:RemoteException 523: 520: 517: 514: 511: 508: 505: 502: 499: 496: 493: 490: 487: 484: 481: 478: 475: 472: 469: 466: 463: 460: 457: 454: 451: 448: 445: 442: 439: 436: 433: 430: 427: 424: 421: 418: 415: 412: 409: 406: 403: 400: 397: 394: 391: 388: 385: 382: 379: 376: 373: 370: 367: 364: 361: 358: 356:RemoteException 355: 352: 349: 346: 343: 340: 337: 334: 331: 328: 325: 322: 319: 316: 313: 310: 307: 304: 301: 298: 295: 292: 289: 286: 283: 280: 277: 274: 271: 268: 265: 263:java.rmi.Naming 262: 259: 248: 245: 244: 241: 238: 236:RemoteException 235: 232: 229: 226: 223: 220: 217: 214: 211: 208: 205: 202: 199: 196: 193: 191:java.rmi.Remote 190: 187: 176: 170: 164: 156: 145: 141: 135: 121: 23: 22: 15: 12: 11: 5: 1034: 1032: 1024: 1023: 1018: 1016:JDK components 1008: 1007: 1004: 1003: 998: 992: 962: 954: 949: 943: 934: 910: 909:External links 907: 904: 903: 881: 854: 839: 808: 807: 805: 802: 795: 794: 793: 658: 656: 655: 651: 479:createRegistry 473:LocateRegistry 258: 256: 255: 252: 186: 184: 183: 180: 169: 166: 155: 152: 120: 117: 58:that performs 24: 14: 13: 10: 9: 6: 4: 3: 2: 1033: 1022: 1019: 1017: 1014: 1013: 1011: 1002: 999: 996: 993: 979: 972: 968: 963: 959: 955: 953: 950: 947: 944: 942: 938: 935: 925: 921: 917: 913: 912: 908: 891: 885: 882: 871: 870: 865: 858: 855: 850: 846: 842: 836: 832: 828: 823: 822: 813: 810: 803: 801: 791: 790: 789: 726:RmiServerIntf 714:RmiServerIntf 652: 646: 645: 314:RmiServerIntf 253: 247: 246: 212:RmiServerIntf 181: 177:RmiServerIntf 175: 174: 173: 167: 165: 162: 160: 153: 151: 148: 138: 132: 130: 126: 118: 116: 114: 109: 107: 103: 99: 95: 91: 86: 84: 80: 75: 73: 69: 65: 61: 57: 54: 50: 46: 38: 34: 29: 19: 985:. Retrieved 927:. Retrieved 919: 894:. Retrieved 884: 873:. Retrieved 867: 857: 820: 812: 798: 787: 171: 163: 157: 154:Jini version 146: 133: 122: 110: 89: 87: 76: 48: 44: 42: 1010:Categories 987:2009-02-11 929:2014-07-14 875:2020-07-18 840:1852338695 804:References 774:getMessage 386:getMessage 311:implements 227:getMessage 68:serialized 967:Jim Waldo 869:JavaWorld 849:827073874 708:Exception 675:RmiClient 648:RmiClient 581:RmiServer 569:RmiServer 434:Exception 347:RmiServer 302:RmiServer 249:RmiServer 209:interface 179:interface 85:version. 978:Archived 958:java.rmi 892:. Oracle 137:java.rmi 129:by value 113:Modula-3 98:RMI-IIOP 49:Java RMI 37:skeleton 18:Java RMI 762:println 626:println 551:println 503:println 452:println 398:MESSAGE 332:MESSAGE 305:extends 215:extends 168:Example 142:sun.rmi 51:) is a 847:  837:  768:server 750:System 738:lookup 732:Naming 717:server 705:throws 696:String 684:static 681:public 669:public 660:import 654:value. 614:System 608:server 596:rebind 590:Naming 572:server 539:System 491:System 440:System 431:throws 422:String 410:static 407:public 395:return 383:String 380:public 353:throws 344:public 329:String 323:static 320:public 296:public 287:import 278:import 269:import 260:import 233:throws 224:String 218:Remote 206:public 197:import 188:import 981:(PDF) 974:(PDF) 896:9 May 672:class 650:class 518:catch 362:super 326:final 299:class 251:class 106:CORBA 83:CORBA 898:2012 845:OCLC 835:ISBN 777:()); 699:args 690:main 687:void 485:1099 425:args 416:main 413:void 159:Jini 147:rmic 125:HTTP 102:IIOP 94:IIOP 53:Java 43:The 35:and 33:stub 827:doi 756:out 620:out 584:(); 578:new 545:out 497:out 464:try 446:out 90:RMI 56:API 1012:: 976:. 969:. 918:. 866:. 843:. 833:. 747:); 635:); 611:); 560:); 512:); 488:); 461:); 389:() 371:); 350:() 230:() 115:. 74:. 990:. 932:. 900:. 878:. 851:. 829:: 783:} 780:} 771:. 765:( 759:. 753:. 741:( 735:. 729:) 723:( 720:= 711:{ 702:) 693:( 678:{ 666:; 641:} 638:} 629:( 623:. 617:. 605:, 599:( 593:. 575:= 563:} 554:( 548:. 542:. 533:{ 530:) 527:e 521:( 515:} 506:( 500:. 494:. 482:( 476:. 467:{ 455:( 449:. 443:. 437:{ 428:) 419:( 404:} 401:; 392:{ 377:} 368:0 365:( 359:{ 341:; 335:= 317:{ 293:; 284:; 275:; 266:; 242:} 239:; 221:{ 203:; 194:; 47:( 20:)

Index

Java RMI

stub
skeleton
Java
API
remote method invocation
remote procedure calls
serialized
distributed garbage-collection
Java Virtual Machine
CORBA
IIOP
RMI-IIOP
IIOP
CORBA
Modula-3
HTTP
by value
java.rmi
Jini
From P2P to Web Services and Grids : Peers in a Client/Server World
doi
10.1007/b138333
ISBN
1852338695
OCLC
827073874
"Get smart with proxies and RMI"
JavaWorld

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.