Presentation is loading. Please wait.

Presentation is loading. Please wait.

Extending Java RMI for Dynamic Reconfiguration

Similar presentations


Presentation on theme: "Extending Java RMI for Dynamic Reconfiguration"— Presentation transcript:

1 Extending Java RMI for Dynamic Reconfiguration
Presentation for ECE 8813 Georgia Institute of Technology Spring 2003 Christophe Levand

2 Java RMI CLIENT RMI Registry ? myObj SERVER

3 Java RMI RMI Registry Naming.bind(“hello”, myObj) SERVER myObj

4 Java RMI Naming.lookup(“hello”) lookup returns the stub of myObj.
CLIENT Naming.lookup(“hello”) RMI Registry lookup returns the stub of myObj. The stub code resides on the client.

5 Java RMI Stub on client / Skeleton on server
Stub/Skeleton responsible for parameters marshalling/unmarshalling. Client uses the stub through an interface. The interface is implemented by the class of myObj. The stub is following the proxy design pattern. Consequence: Client uses the remote object as if it was “local”.

6 Dynamic reconfiguration: Motivations
RMI RMI Server A Server B Server C

7 Dynamic reconfiguration: Motivations
RemoteException ! Server A Server B Server C RMI ?

8 Dynamic reconfiguration: Motivations
Solutions? The client intercepts the Exception and makes a new lookup Error handling is not transparent to the application. Before moving the target component, one has to make sure that there is no ongoing transactions. Extend the RMI middleware  XRMI. From a static to a dynamic approach.

9 RMI vs XRMI XRMI RMI Abstraction Client Server RMI Registry RMI Stub
lookup (1) uses (3) forwards to (4) RMI Registry creates (2) RMI Stub RMI Client Server Component Manager Virtual Stub lookup (1) creates (2) uses (6) RMI lookup (3) RMI Registry creates (4) RMI Stub uses (5) forwards to (7) XRMI Abstraction

10 XRMI: General perspective
Attributes of the virtual stub: - ClientName / ServerName provided by the CM A target reference provided by the CM. Dependency list: (client, server) - lock flag: to block new invocations invocation counter Client Server lookup (1) uses (6) Component Manager Virtual Stub creates (2) forwards to (7) RMI lookup (3) uses (5) RMI Registry creates (4) RMI Stub XRMI

11 XRMI: Scenario 1 Client needs to calls a method on the remote server object. Lock flag is false, so a call can be made. Virtual stub adds a dependency. Virtual stub delegates the call to rmi stub (target reference), which forwards to server. After the server sends the result back, Virtual stub removes the dependency. Virtual stub returns the result to the Client. Client Server lookup (1) uses (6) Component Manager Virtual Stub creates (2) forwards to (7) RMI lookup (3) uses (5) RMI Registry creates (4) RMI Stub XRMI

12 XRMI: Scenario 2 XRMI Server needs to be moved to another location.
The CM on Server’s location broadcasts a query to all CMs in the network. Each CM gathers a list of all its Virtual stubs that point to server. For each Virtual stub of that list, set the lock flag to true: to block any new requests. Each Virtual stub of that list monitors its dependency list and sends a signal to the CM when the list is empty. Each CM sends a signal to the CM in Server’s location. Client Server lookup (1) uses (6) Component Manager Virtual Stub creates (2) forwards to (7) RMI lookup (3) uses (5) RMI Registry creates (4) RMI Stub XRMI

13 XRMI: Scenario 2 XRMI For each virtual stub used by server:
set lock to true monitor the dependency list. send a signal to the CM when the list is empty. the CM moves the server to another location. the CM broadcasts a signal to every CMs. Each CM makes an RMI look up for the remote server and update the target reference in their virtual stubs that point to the old location. Client Server lookup (1) uses (6) Component Manager Virtual Stub creates (2) forwards to (7) RMI lookup (3) uses (5) RMI Registry creates (4) RMI Stub XRMI

14 XRMI: Improvement XRMI remote server XRMI local server no RMI lookup
Client Server Client Server Component Manager Virtual Stub lookup (1) creates (2) uses (3) forwards to (4) XRMI local server lookup (1) uses (6) Component Manager Virtual Stub creates (2) forwards to (7) no RMI lookup no parameter marshalling RMI lookup (3) uses (5) RMI Registry creates (4) RMI Stub XRMI remote server

15 XRMI: Improvement XRMI Attributes of the virtual stub:
- ClientName / ServerName provided by the CM A target reference provided by the CM. Dependency list: (client, server) - lock flag: to block new invocations invocation counter  when high, move client to the same location as server. Client Server lookup (1) uses (6) Component Manager Virtual Stub creates (2) forwards to (7) RMI lookup (3) uses (5) RMI Registry creates (4) RMI Stub XRMI

16 RMI / XRMI cost comparison
Runtime environment Middleware Time (ms) Caller and callee on same computer RMI 1.01 XRMI 0.06 Caller and callee on different computers 2.79 2.83

17 Resources Xuejun Chen, Extending RMI to Support Dynamic Reconfiguration of Distributed Systems. Proceedings of the 22nd International Conference on Distributed Computing Systems, page(s): 401 – 408, 2002.


Download ppt "Extending Java RMI for Dynamic Reconfiguration"

Similar presentations


Ads by Google