by, 01-02-2012 at 06:31 PM (3191 Views)
RMI or Java Remote Method Invocation gives means to Java program (present at a machine) to do communication with other objects present in other JVMs, address spaces or processes. RMI architecture’s important parts are the skeleton class, stub class and object serialization. Layered architecture is used by the RMI where layers are enhanced without having any affect at the other layers. To summarize the layers, proceed as following:
- Application Layer: Server program and the client.
- Stub & Skeleton Layer: Method calls that are created by the client are intercepted. These calls are redirected towards the remote services of RMIL
- Remote Reference Layer: Connections are set up for the remote address spaces and to mange the connection. Also understands that how to manage and intercept references that are being made from clients, for remote service object.
- Transport layer: Based on IP/TCP connections in a network, b/w machines. It provides firewall penetration strategies as well as basic connectivity.
RMI runtime steps are, as it has been shown in above figure:
Step 1: Take start with RMI registry then proceed to the RMI server.
Step 2: From RMI registry, remote objects will be looked up by the client process
Step 3: Stub will be returned from server process by the lookup to the client’s process.
Step 4: On stub, method calls will be invoked by the client process. Skeleton is called by the stub on the server process, via RMI reference manager.
Step 5: Actual method call will be executed by the skeleton on the remote object. Result or an exception would be returned to client process through stub & RMI reference manager.