Java RMI

lecture 4

Features

  • Integrate with Java language and libraries
    • Security, write once run anywhere, multithreaded
    • Object oriented
  • Can pass “behavior”
    • Mobile code
    • Not possible in CORBA, traditional RPC systems
  • Distributed garbage collection
  • Remoteness of objects intentionally not transparent
    • Good for handling failures

Remote Interfaces, Objects, and Methods

  • Object becomes remote by implementing a remote interface
    • A remote interface extends the interface java.rmi.Remote
    • Each method of the interface declares java.rmi.RemoteException in its throws clause in addition to any application-specific clauses

Creating distributed applications using RMI

  1. Define the remote interfaces
  2. Implement the remote objects and server
  3. Implement the client
  4. Compile the remote interface, server and client 
  5. Generate the stub and skeleton using rmic
  6. Start the RMI registry
  7. Start the server
  8. Run the client

Leave a Reply

Your email address will not be published. Required fields are marked *

*