Presentation is loading. Please wait.

Presentation is loading. Please wait.

FONG CHAN SING (143334) WONG YEW JOON (143388). JAVA RMI is a distributive system programming interface introduced in JDK 1.1. A library that allows an.

Similar presentations


Presentation on theme: "FONG CHAN SING (143334) WONG YEW JOON (143388). JAVA RMI is a distributive system programming interface introduced in JDK 1.1. A library that allows an."— Presentation transcript:

1 FONG CHAN SING (143334) WONG YEW JOON (143388)

2 JAVA RMI is a distributive system programming interface introduced in JDK 1.1. A library that allows an object running in one Java virtual machine to invoke methods on an object running in another Java virtual machine. Similar to RPC but is more simpler and written in JAVA language. Can only be used between JAVA programs.

3 The server must first bind it name to the registry. The client lookup the server name in the registry to establish remote references. The stub (client side) serializing the parameters to skeleton, the skeleton (server side) invoking the remote method and serializing the result back to the stub.

4 A client invoke a remote method, the call is first forwarded to stub. The stub is responsible for sending the remote call over to the server-side skeleton. The stub opening a socket to the remote server, marshaling the object parameters and forwarding the data stream to the skeleton. A skeleton contains a method that receives the remote calls, unmarshals the parameters, and invokes the actual remote object implementation.

5 The stub forward request and receives the result. The skeleton responsible to receiving the request and forward the result. Remote Reference Layer (RRL) responsible for carrying out a specific remote reference protocol. Transport Layer responsible for connection set up and reporting object tracking.

6 Must have:  JDK 1.1 or above  rmiregistry – remote object registry service  rmic – generate stubs and skeletons for remote object(Below JAVA version 5)  rmid - RMI activation system daemon  serialver - return class serialVersionUID Optional:  Textpad

7 Generally, JAVA RMI consists of: a) RMI Interface b) RMI Server c) RMI Client

8 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 skeleton. 6. Start the RMI regisitry. 7. Start the remote object server. 8. Run the client.

9 A RMI interface is an interface that declares a set of methods that maybe invoked from a remote JAVA virtual machine. Requirement:  Must extended java.rmi.Remote  Each method must declare java.rmi.RemoteException

10 UnicastRemoteObject - classes that remote object implementations can extend which facilitate remote object creation. super() calls the following superclass constructor: a)UnicastRemoteObject() Creates and exports a new UnicastRemoteObject object using an anonymous port. a)exportObject(Remote obj) Exports the remote object to make it available to receive incoming calls using an anonymous port.

11

12 The Naming class provides methods for storing and obtaining references to remote objects in a remote object registry: rebind(String name, Remote obj) Rebinds the specified name to a new remote object.

13 lookup(String name) Returns a reference, a stub, for the remote object associated with the specified name. //host:port/name where host is the host (remote or local) where the registry is located- default is localhost port is the port number on which the registry accepts calls- default is 1099 Client can using remote object method through stub.

14

15 After developing the code for RMI interface, RMI server, RMI client. Compile all of them. Next, using command line and go to the directory on when user store all this code. At there, type start rmiregistry Then, run the server code. Run the client code.

16


Download ppt "FONG CHAN SING (143334) WONG YEW JOON (143388). JAVA RMI is a distributive system programming interface introduced in JDK 1.1. A library that allows an."

Similar presentations


Ads by Google