Professional Documents
Culture Documents
OBJECTS MODELS
RMI Remote Method
Invocation
Reply
Proxy is stub
March 2018 IMPLEMENTATIONS OF DISTRIBUTED OBJECT MODELS 3
DISTRIBUTED OBJECTS
MODEL
RMI IMPLEMENTATION
Create a remote object reference and add it to the table when a remote
object is passed in a request or a replay message for the first time.
Translate the remote object reference to the corresponding local object
reference which refer either to a remote object (in the server) or to a
proxy (in the client).
Proxy:
Make remote method invocation transparent to clients by
behaving like a local object to the invoker.
Forward the call in a message to the remote object and
hiding all in-between operations (send, receive,
marshalling, and un-marshalling) from the client.
A client has one proxy for each remote object to hold its
remote reference and implement the methods in its remote
interface.
Marshal a reference to the target object, its own methodID
and its arguments into a request message and send it to the
target then await the reply message to un-marshall it and
return the result to the invoker.
March 2018 IMPLEMENTATIONS OF DISTRIBUTED OBJECT MODELS 6
DISTRIBUTED OBJECTS
MODEL
RMI IMPLEMENTATION
Dispatcher:
A server has one dispatcher for each class
representing a remote object.
Receive the request message from the
communication module and use the methodID to
select the appropriate method in the skeleton and
passing on the request message.
Request
Reply
client stub server stub
procedure procedure
client service
program Communication Communication procedure
module module
dispatcher
Notification Information
provider Notification
Notification
Notification
Notification
Dealer’s computer Dealer’s computer
Notification
Information
provider
Notification
Dealer Notification
Dealer
External
source
March 2018 IMPLEMENTATIONS OF DISTRIBUTED OBJECT MODELS 20
EVENTS AND
NOTIFICATIONS
EVENT TYPES
An event source can generate events of one or more different types.
Each event has attributes to specify information about that event: the
name of object generated it, the operation, its parameters and the
time.
Types and attributes are used in subscribing to events and in
notifications.
Whenever an event of a specific type that matches the attributes
occurs, the interested parties will be notified.
In dealing room system example:
There is one type of event – the arrival of an update to a stock.
The attributes might specify the name of a stock, its current price, and latest
rice or fall.
Dealers may specify the interesting in all the events of a particular stock.