Lecture02 Hreidi
Lecture02 Hreidi
cs5223
Lecture 02
Seif Haridi
Department of Computer Science,
NUS
Application Layer
Middleware Layer
Parameter passing
Variations
Parameter passing
Runtime objects
Can be implemented in any language, but require
use of an object adapter that makes the
implementation appear as an object
Persistent objects
live independently from a server
if a server exits, the object’s state and code
remain (passively) on disk
Observation
Remote-object references allow us to pass references as
parameters
This was difficult with ordinary RPCs
2002-08-15 S. Haridi, CS5223, Lecture 02 38
Remote Method Invocation
RMI Basics I
Assume client stub and server skeleton are in
place
Client invokes method at stub
Stub marshals request and sends it to server
Server ensures referenced object is active
(persistent):
Create separate process to hold object
Load the object into server process
...
2002-08-15 S. Haridi, CS5223, Lecture 02 39
Remote Method Invocation
Basics II
Request is unmarshaled by object’s skeleton,
and referenced method is invoked
If request contained an object reference,
invocation is applied recursively (i.e., server
acts as client)
Result is marshaled and passed back to
client
Client stub unmarshals reply and passes
result to client application
2002-08-15 S. Haridi, CS5223, Lecture 02 40
Remote Method Invocation
Parameter Passing
Object reference: Much easier than in the
case of RPC:
Message Brokers
Transient communication
A message is discarded by a communication
server as soon as it cannot be delivered at the
next server, or at the receiver
Message
Maximum length of a single message
length
Setup retry
Specifies maximum number of retries to start up the remote MCA
count
Delivery retries Maximum times MCA will try to put received message into queue