12
Remote Method Invocation by James Hunt, Joel Dominic, and Adam Mcculloch

Remote Method Invocation by James Hunt, Joel Dominic, and Adam Mcculloch

Embed Size (px)

Citation preview

Page 1: Remote Method Invocation by James Hunt, Joel Dominic, and Adam Mcculloch

Remote Method Invocationby James Hunt, Joel Dominic, and

Adam Mcculloch

Page 2: Remote Method Invocation by James Hunt, Joel Dominic, and Adam Mcculloch

CONTENT

What is RMI

Why is it used

How is it used

Page 3: Remote Method Invocation by James Hunt, Joel Dominic, and Adam Mcculloch

WHAT ARE OBJECTSEncapsulation of…

Data• including pointers to other

objects

Methods• used to manipulate the data

Page 4: Remote Method Invocation by James Hunt, Joel Dominic, and Adam Mcculloch

WHAT DOES RMI REALLY MEAN?• RMI stands of Remote Method Invocation

• Essentially allows for a client to perform operations on objects stored on a separate networked machine

• Idea for RMI taken from RPC or Remote Procedure Call

Basically just the Procedural Programming approach to RMI

Allows for procedures to be executed on a separately networked machine

Page 5: Remote Method Invocation by James Hunt, Joel Dominic, and Adam Mcculloch

COMMON USES/INTERFACES FOR RMI

RMI is used in most distributed java applications

Solely in java originally

Has been ported to CORBA (Common Object Request Broker Architecture)

• CORBA allows RMI to be used by non java languages

Page 6: Remote Method Invocation by James Hunt, Joel Dominic, and Adam Mcculloch

HOW IT WORKS A client machine will make a method call for remote objects that reside on a server

The server will then run that method on the object

Finally, the server will return the results of that method to the client

Page 7: Remote Method Invocation by James Hunt, Joel Dominic, and Adam Mcculloch

PASSING OBJECT PARAMETERS

Serializing objects:

• In java (main language for RMI) objects must use the serializable interface

Everything within the object is encoded into a byte

stream Non primitive objects being encoded must also

implement the serializable interface

Page 8: Remote Method Invocation by James Hunt, Joel Dominic, and Adam Mcculloch

STUBS and SKELETONSStubs:• Resides on client machine• Contains:

Parent Object Reference Method call Parameters needed for execution

Skeletons:

• Resides only on the server• Unwraps the stub to be run server side• Translates stubs into actual object calls

Page 9: Remote Method Invocation by James Hunt, Joel Dominic, and Adam Mcculloch

Diagram courtesy of: http://www.cs.uiowa.edu/~slonnegr/wpj/RMI.pdf

Page 10: Remote Method Invocation by James Hunt, Joel Dominic, and Adam Mcculloch

Java code courtesy of: http://download.oracle.com/javase/tutorial/rmi/implementing.html

Page 11: Remote Method Invocation by James Hunt, Joel Dominic, and Adam Mcculloch

SUMMARY

Client machine makes a method request on an object that resides on the Server

Client must pass in serialized objects as parameters and then use Stubs and Skeletons to wrap and unwrap these objects

Server passes information back to the client through serialized objects

Page 12: Remote Method Invocation by James Hunt, Joel Dominic, and Adam Mcculloch

SOURCES• http://www.cs.uiowa.edu/~slonnegr/wpj/RMI.pdf

• http://www.oracle.com/technetwork/java/javase/tech/index-jsp-136424.html

• http://download.oracle.com/javase/tutorial/rmi/index.html

• http://download.oracle.com/javase/tutorial/rmi/implementing.html

• http://www.daimi.au.dk/~mailund/scripting2005/lecture-notes/rmi.html

• http://notes.corewebprogramming.com/student/RMI.pdf

• http://infolab.stanford.edu/CHAIMS/Doc/Details/Protocols/rmi/rmi_description.html

• http://www.javacamp.org/moreclasses/rmi/rmi22.html

• http://www.sentex.net/~pkomisar/RMI.html

• http://java.sun.com/developer/technicalArticles/ALT/sockets/