Java Remote Object Model

skillfulwolverineSoftware and s/w Development

Dec 2, 2013 (3 years and 10 months ago)

81 views

Java Remote Object Model

References



http://pdos.csail.mit.edu/6.824/papers/waldo
-
rmi.pdf


o

Describes the given “Remote Object” model.



http://people.cs.umass.edu/~yannis/j
-
orchestra/dist
-
synch
-
final.pdf

o

Shows some limitations and issues with this model.




http://www.cc.gatech.edu/computing/pag/chord/examples/jdk/java/rmi/server/


o

RMI Source code

Overview

These notes assume the Reader is familiar with the “Remote Procedure Call


RPC” model.



The discussion centers around

how to provide
a “Distributed Object Model”.

Object Features

1.

Remote Method Invocations



Method invocations on ob
jects across different JVMs

2.

Object Class Methods



The methods of the Object class


equals, hashCode, toString, clone, finalize

3.

Remote access an
d faults



Throwing RemoteException



Dynamic stubs and proxies

Remote Method Invocation Model

Interfaces and Objects

1.

Java has interfaces and objects

2.

For Remote invocations
, Java defines RemoteInterface and RemoteObject classes.

3.

All clients are expected to use the Remote, or an interface extended from it.



This is a marker interface to convey that remote calls need to be invoked on the same

4.

The servers implement “Remote Objects”

by extending RemoteObject class.

Stubs and
Serializ
ation

1.

For every call that is made
, stubs on the client side



convert the object
-
calls to network protocol and vice
-
versa

2.

To allow for generic stubs to be written,



Java d
efines a standard Object Serialization format, to convert to the wire and vice
-
versa

Dy
namic Stubs

1.

For consistency between the server version and the server stubs,



The Java class
-
loader can load the stubs from an external URL. This could be the RMI server

Remote Exceptions

1.

Every Remote Method must be declared to throw a RemoteException



This is to handle when there is a communication failure across systems.


Object Implementation

All Object methods need t
o be revisited for re
-
implementation under the new “Distributed Object
Model”.

getClass

Returns the stub
-
class. Requires no changes

h
ashCode

Re
-
implemented to hash the ReferenceId


not “Content based”

周楳⁩猠摯T攠to⁡vo楤⁡ RP䌠景爠灥牦orm慮捥⁡湤⁩湴敧 慴楯n⁲敡獯ns

敱e慬a


-
業p汥m敮瑥搠瑯⁨ 獨⁴s攠剥R敲敮e敉e


not “Content based”

周楳⁩猠摯T攠to⁡vo楤⁡ RP䌠景爠灥牦orm慮捥⁡湤
楮瑥gr慴楯n⁲敡獯ns

捬cne

䥭p汥m敮e敤⁴o⁣lon攠瑨攠t敦e牥湣e

睡楴

Loc欠on⁴he 捡cbj散e

佢橥捴Oon⁳敲e敲e捡c⁢攠慣捥c獥搠sy⁤楦晥f敮琠e汩敮瑳

no瑩晹

啮汯捫cono捡氠ob橥捴

no瑩晹䅬l

啮汯捫cono捡氠ob橥捴

瑯却物ng

佢橥捴楦楥猠she⁳ 物rg⁲ 晥f敮捥