Chapter 5_Version2
Download
Report
Transcript Chapter 5_Version2
Distributed Systems
Concepts and Design
Chapter 5
Distributed Objects and Remote
Invocation
RMI – Remote Method Invocation
Remote Objects
Remote Interface
RMI vs. Remote Procedure Call
Remote object event subscription
Distributed Objects and Remote
Invocation pp. 178-179
Middleware
Applications
RMI, RPC and Events
Request/Reply Protocols
External Data Representation
Operating System
Distributed Objects and Remote
Invocation – Interfaces pp. 179-181
Interface of a module hides its internal
operations
Only procedures and variables defined in the
interface are ‘visible’
Distributed programs- no direct access to
variables
Instead variable values are passed
Distributed Objects and Remote
Invocation – Interfaces pp. 179-181
Service Interfaces
Server provides set of procedures
Defines the input/output arguments of
procedures
Remote Interfaces
Specifies the methods of objects
Defines the input/output arguments of objects
Methods can pass objects
Interface Definition Language (IDL)
Communication between distributed
objects pp. 181-183
The Object Model – object oriented program
consisting of interacting objects and the
objects sets of data and methods
Object references
Interfaces
Actions
Exceptions
Garbage Collection
Distributed Objects pp. 183-184
RMI for Distributed Objects – client/server
Objects are managed by servers
Client requests invoke methods on those
objects
Result is returned to client
Distributed Objects p. 184
Distributed Objects pp. 184-185
Extending objects to allow RMI
Remote Object Reference
An identifier for a unique remote object
Invoker specifies object as remote at invocation
Results may be passed as arguments and results
Remote Interface
Classes of remote objects may be implemented
in any language with an IDL compiler
Interface lists all methods of a class available for
RMI
Distributed Objects p. 185
Distributed Objects p. 186
Actions in a distributed system
Garbage Collection
Exceptions
Distributed Objects p. 187
Design Issues for Distributed Objects
RMI Semantics for request/reply protocol
Retry request message
Duplicate filtering
Retransmission of results
Distributed Objects p. 188
Maybe Invocation Semantics
Once or not at all invocation
At-least-once Invocation Semantics
Invoker receives either a result or an
exception – may be executed again
At-most-once Invocation Semantics
Invoker receives either a result or an
exception – never executes more than once
Transparency p 189
Remote Interface
Must be able to recover
Remote Invocation
Operation idempotent
Syntax of local and remote invocations
Figure 5.7 p 190
Communication Module p 190
Transmits request and reply messages
Provides specified invocation semantics
Remote Reference Module p 191
Remote Object Table
Entry for all remote objects held by the
process
Provides invocation semantics
Remote Object Reference
Servant
RMI Software p 191
Proxy
Dispatcher
Skeleton
RMI Software p 192
Dynamic Invocation – alternate to proxies
Dynamic Skeletons
Server/Client Program p 193
Classes for Dispatcher
Classes for Skeleton
Implements Servant Classes
Factory Methods
Server Threads
Binder
Client /Server Program p 194-95
Activation of Remote Objects
De-activation of Remote Objects
Persistent Objects
Location of Objects
Distributed Garbage Collection p 196
JAVA Algorithm
B.holders
addRef(B)
removeRef(B)
Pairwise request-reply
Leases
RPC- Remote Procedure Call p 197
Service Interfaces
Invocation Semantics
Stub Procedure
Client stub procedure
Server stub procedure
Figure 5.8 p 198
Sun RPC p 198 - 201
XDR Interface Language
Interface Definition
Client Stub Procedure
Dispatcher
Server Stub Procedure
Binding
Authentication
Figure 5.10 p 202
Events and Notifications p 201-202
Asynchronous
Publish-Service Paradigm
Heterogeneous Objects
Participants in Event/Notification
Object of Interest
Event
Notification
Subscriber
Observer Objects
Publisher
Figure 5.11 p 204
Roles for Observers p 204-206
Forwarding
Filtering of Notification
Patterns of Events
Notification Mailboxes
Jini Distributed Event Specs p 206-208
Event Generators
Remote Event Listeners
Remote Events
Third-party Agents
JAVA RMI p 208-211
Remote Interfaces
Parameter/Result Passing
Downloading Classes
RMI Registry
JAVA RMI p 210-211
Server Program
Main Method
Servant Class Implementations
RMI Security Manager
JAVA RMI p 212-213
Client Program
Binder
Lookup Operation
Callbacks
Design/Implement JAVA RMI
Reflection
JAVA Classes
RemoteObject
RemoteServer
Activatable
UnicastRemoteObject
Servant class