Knowledge (XXG)

Java remote method invocation

Source 📝

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

Index


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
"Java RMI Release Notes"

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