Java™ RMI

RMI applications often comprise two separate programs, a server and a client.
A typical server program creates some remote objects, makes references to these objects accessible, and waits for clients to invoke methods on these objects.
A typical client program obtains a remote reference to one or more remote objects on a server and then invokes methods on them.
RMI provides the mechanism by which the server and the client communicate and pass information back and forth. Such an application is sometimes referred to as a distributed object application.

RMI System

Step by step RMI
1. Define the remote interface
2. Develop the remote object by implementing the remote interface.
3. Develop the client program.
4. Compile the Java source files.
5. Generate the client stubs and server skeletons.
6. Start the RMI registry.
7. Start the remote server objects.
8. Run the client

RMI System consist of three layers

1. stub/skeleton layer, yaitu stub at client side (berupa proxy), dan skeleton pada sisi server.
2. remote reference layer, yaitu remote reference behaviour (example: call to an object)?
3. transport layer, yaitu connection set up, maintenance and remote object tracking.

1 komentar: