Topic: RMI (Remote Method Invocation)
Agenda:
Steps to build an RMI application
Running and compiling an RMI program
Retrieving Marks based on Htno Remotely
Example :
To create a client and Server processess which are capable of communication with each other
Client : Prompts for Htno and display the result....We develope client using SWINGS
Server : Server which is listening at a particular port on a localhost or on a particular ip in a LAN
Receive the Htno and then goes to the database retrive the data and gives to client where client
perform some operations on it and then display it to the user
RMI Idea:
Distribute Objects across different machines to take advantage of hardware and dedicated software
User uses object as though it were a regular, local object
Network connections happen automatically behind the scenes
Java serialization lets you pass complex data structures over the network without writing code
to parse and reconstruct
RMI operations
Stub Operation
Package identifier of remote object
Package method identofier
Marshell parameters
send package to server skeleton
Skeleten Operation
Unmarshell parameters
Calls return value or exception
Marshell method return
send package to client stub
Lets not waste tym ........
lets try playing with RMI
RMI need 4 classes to be built
Client side classes :::
An Interface
And a client program which interacts with user