Distributed Objects SPL2010 1 distributed objects objects which
Distributed Objects SPL/2010 1
● ● ● distributed objects - objects which reside on different machines/ network architectures, benefits, drawbacks implementation of a remote object system SPL/2010 2
● ● ● Design large systems - avoid bottlenecks and single points of failure Distributed: partition system into autonomic subsystems, self-contained, with clear relations (interfaces) Subsystem may be on different host, communicate by networking protocols SPL/2010 3
active object model ● ● ● objects reside on different RTE's ● send messages to one to another ● how two objects are going to communicate? remote method invocation: OO concept objects in different environments communicate=send messages SPL/2010 4
RMI Architecture in Java ● ● ● framework for remote method invocation abstract subsystem A as providing a service=an interface used by subsystem, B, in a different JVM - invoke methods of A. SPL/2010 5
SPL/2010 6
example ● ● ● class, representing a printing service. support printing lines of text sent to them from other objects, which reside on different JVMs, on different hosts. SPL/2010 7
interface of the service SPL/2010 8
remote interface supports remote method invocations SPL/2010 9
communication throws section SPL/2010 10
Implementing the Interface ● ● implementing the remote interface tell Java how this class is going to communicate remotely SPL/2010 11
Make the Service Available ● instantiate Object of this class ● wait for messages from other RTE: 1. Instantiate Line. Printer. Impl Object, L. 2. Make L available for remote invocations 3. Wait for remote invocations, and call the appropriate methods of L. SPL/2010 12
SPL/2010 13
● ● user needs to locate where on which host and JVM printer object is located. process does not exit when the main function completes ● naming. rebind(name, object) - executor is created - waits for messages and executes SPL/2010 14
- Slides: 14