Reaves.dev

v0.1.0

built using

Phoenix v1.7.12

Java RMI

Stephen M. Reaves

::

2024-03-28

Notes about Lecture 6b for CS-6210

Summary

Java History

Invented by James Gosling at Sun

Originally called Oak

Originally used for PDAs then to set-top boxes, then to the internet

Java Distributed Object Model

Bank Account Example

Reuse of Local Implementation

Interfaces are available everywhere, but specific instantiations (objects) may not be. It’s up to the implementer.

Reuse of Remote

More work on programmer in terms of extensions/implementations, but objects are immediately visible.

javaRMIReuseOfRemote

Java RMI at work

Server

BankAccount acct = new BankAcctImpl();
URL url = new URL("mywebaddress");
Java.rmi.Naming.bind(url, acct);

Client

BankAccount acct = Java.rmi.Naming.lookup(url);
float balance;
acct.deposit(5);
acct.withdraw(3);
balance = acct.balance();

RMI Implementation

GmstubsskeletonsRemote Reference Layer (RRL)Transportcclientc->m:1sservers->m:2

RRL handles ser/des

RMI Implementation Transport

Endpoints contain transports which connect to other transports via channels.

IO on channel using connections

RRL decides which transport to use depending on location of client/server