LectureSet7 - Remote Method Invocation RMI l Mechanism that...

Info iconThis preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon
Remote Method Invocation
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
RMI l Mechanism that allows one to invoke a method on an object that exists in another address space (on the same of different machine) l RMI is basically an object-oriented RPC mechanism l RMI supports distributed object applications Remote object Remote call Client VM Server VM
Background image of page 2
RMI Components l Server : creates remote objects, makes references to them accessible, and waits for clients to invoke methods on these remote objects l Client : gets a remote reference to one or more remote objects in the server and then invokes methods on them l Object Registry is a name server that relates objects with names. Objects are registered with the Object Registry. Once an object has been registered, one can use the Object Registry to obtain access to a remote object using the name of the object
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Native Methods l Java Native Interface (JNI) supports the ability to call native methods written in languages such as C/C++ l The native keyword is used to identify methods that have implementation defined in such shared object files: public void native sayHello(); l JNI provides a means of providing cross-platform native code, but only if appropriate libraries are generated for each machine (Code is portable, but not WORA--write once, run anywhere.)
Background image of page 4
RMI vs. Corba l CORBA is a language-independent standard (therefore supports multiple languages) l CORBA includes many other mechanisms in its standard (such as a standard for TP monitors) none of which are part of Java RMI l CORBA separates interface definitions from implementation l RMI allows optimization of protocols for communication
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
RMI over IIOP l With RMI-IIOP, programmers can create applications in RMI that include CORBA connections l Developed by IBM and Sun, with the cooperation of the Object Management Group (OMG) l CORBA RMI is (relatively) easier to implement than CORBA
Background image of page 6
Remote Interfaces, Objects, and Methods l An object becomes remote by implementing a remote interface: ¡ A remote interface extends interface java.rmi.Remote ¡ Each method of the interface declares java.rmi.RemoteException in its throws clause ¡ RMI passes a remote stub for a remote object. The stub is basically a remote reference l The client invokes a method on the local stub, which is responsible for carrying out the method call on the remote object
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
RMI: Tools provided l RMIC ¡ Java RMI Stub compiler l RMIRegistry ¡ Java RMI remote object registry l RMID ¡ Java RMI activation system daemon
Background image of page 8
Stub and Skeleton l RMI Stub ¡ Resides in caller’s local address space ¡ Represents remote object to caller l Implementation of Remote interface l Caller invokes methods of RMI Stub locally ¡ Connects to the remote object ¡ Sends arguments and receive results from remote object l Performs marshaling and unmarshaling l RMI Skeleton ¡ Resides in server’s address space ¡ Receives arguments from caller (RMI Client's Stub) and send results back to caller ¡ In JDK 1.3, RMI Skeleton gets created automatically via reflection
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
RMI Communication Model Caller Remote object Client VM Server VM Stub Skeleton Remote Ifce
Background image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 07/14/2011 for the course COP 4610L taught by Professor Staff during the Spring '09 term at University of Central Florida.

Page1 / 53

LectureSet7 - Remote Method Invocation RMI l Mechanism that...

This preview shows document pages 1 - 11. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online