You are on page 1of 1

Interface

Contract between a client & server what bussiness methods will be available for a
client to call on that particular Remote object
Interface will be available at both client & server
Protocol used f

Client (JVM1)(invoke the method on the server, so i need a


representation of the object on the server)
|
Stub(proxy for Remote object)[client interface class extends
server interface class, client class, stub class will be downloaded dynamically)

Server(JVM2)
|
Skeleton[interface class, imple class, stub class ]

Stub is a proxy to a Remote object

Create an interface (stub) which extends the remote interface (skeleton)


Create a Client program

lookup for the Remote object using the bindname, get the reference of the remote
object type & then invoke the method
Against the bindname a particular object reference is stored

@EJB(Lookup="") ->Lookup into the RMI registry for the specified bindname to which
Remote object is registered.
The Client will Lookup into the registry with the bindname & will return a Remote
type of object
Interace object; Remote type object is downcasted to a Stub type\Interface
type object

Once downcasted, now invoke the method on the Remote object

When we are not maintaining the Stub class at server side:


==========================================================
Java -DJava.rmi.server.codebase=URL ServerProgram
URL can be FTP/HTTP/File
Will dynamically get/download the Stub class

You might also like