RMI - PowerPoint PPT Presentation

1 / 15
About This Presentation
Title:

RMI

Description:

pass/return remote object references ... compile. make classes network accessible. start the application. 1. Design, Implementation ... 2. compile. javac ... – PowerPoint PPT presentation

Number of Views:36
Avg rating:3.0/5.0
Slides: 16
Provided by: csd50
Category:
Tags: rmi | compile

less

Transcript and Presenter's Notes

Title: RMI


1
RMI
  • Remote Method Invocation

2
Client - Server
  • Server creates remote objects
  • Client manipulates the servers objects
  • (ie invokes methods)

3
Distributed Object ApplicationWhats Required?
  • client-server communication
  • protocol
  • remote references

4
  • locate remote objects
  • pass/return remote object references
  • register remote objects via RMI registry
  • communicate with remote objects
  • handled by the RMI facilities (mostly
    transparent to the user)
  • pass objects
  • transmit data and class definitions

5
Distributed Application RMI

6
RMI FeatureDynamic Code Loading
  • transfer
  • data (objects)AND
  • classes (definitions)
  • Why is this a feature?

7
How?
  • Java application
  • Interfaces
  • define methods
  • Classes
  • implement interface methods and, possibly, other
    methods
  • Distributed
  • some implementations reside on different JVMs

8
Remote Objects
  • definition
  • objects with methods that can be invoked across
    different JVMs
  • How to make an object remote
  • implement a remote interface
  • extends the interface java.rmi.Remote
  • each method declares java.rmi.RemoteException(in
    the throws clause)

9
  • RMI passes a remote stub
  • local representative (proxy)
  • client sees this as the remote reference
  • client invokes a method on the stub
  • stub carries out the invocation on the remote
    object

10
Steps for a Distributed Application using RMI
  • design, implement the components
  • compile
  • make classes network accessible
  • start the application

11
1. Design, Implementation
  • Determine local, remote components
  • define remote interfaces
  • implement remote objects
  • implement clients

12
2. compile
  • javac
  • versions prior to Java Platform, Standard Edition
    5.0 require use of the rmic compiler

13
3. Network Accessibility
  • run
  • RMI remote object registry

14
4. Start the application
  • run
  • server
  • client

15
Example(from Java trails)
  • Compute Engine
  • remote object
  • client server
  • new tasks can be created on the fly(aka
    behavior-based application)
Write a Comment
User Comments (0)
About PowerShow.com