150 likes | 364 Views
Distributed Objects. distributed objects - objects which reside on different machines/ network architectures, benefits, drawbacks implementation of a remote object system . Design large systems - avoid bottlenecks and single points of failure
E N D
distributed objects - objects which reside on different machines/ network • architectures, benefits, drawbacks • implementation of a remote object system
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
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
RMI Architecture in Java • framework for remote method invocation • abstract subsystem A as providing a service=an interface • interface used by subsystem, B, in a different JVM - invoke methods of A.
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.
Implementing the Interface • implementing the remote interface • tell Java how this class is going to communicate remotely
Make the Service Available • instantiate Object of this class • wait for messages from other RTE: • Instantiate LinePrinterImpl Object, L. • Make L available for remote invocations • Wait for remote invocations, and call the appropriate methods of L.
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