dcsimg
RMI registry and client callback
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   ranadhir_nag
Posted On:   Friday, December 29, 2006 04:53 AM

We have an applet which acts as a callback client for an RMI server. The applet registers itself with the RMI server for callback . The RMI Server and the registry is running on the host on which the applet is downloaded. Teh code for registering the applet as a callback client is as follows: Registry registry = LocateRegistry.getRegistry(getCodeBase().getHost(), RMIInterface.REGISTRY_PORT); RMIInterface remoteReference = (RMIInterface) registry.lookup(RMIInterface.REGISTRY_NAME); try { System.out.println("Registering for notification"); UnicastRemoteObject.exportObject(this); remoteReference.registerForNotification(this); } In the java    More>>

We have an applet which acts as a callback client for an RMI server.
The applet registers itself with the RMI server for callback .
The RMI Server and the registry is running on the host on which the applet is downloaded.
Teh code for registering the applet as a callback client is as follows:
Registry registry =
LocateRegistry.getRegistry(getCodeBase().getHost(), RMIInterface.REGISTRY_PORT);
RMIInterface remoteReference =
(RMIInterface) registry.lookup(RMIInterface.REGISTRY_NAME);

try {

System.out.println("Registering for notification");
UnicastRemoteObject.exportObject(this);
remoteReference.registerForNotification(this);
}

In the java console ,we notice that the rmiregistry connects to the document root of the Applet URL for getting the client stub on UnicastRemoteObject.exportObject(this).
Is this because we have specified the applet as:

WIDTH = 500 HEIGHT = 50
id="Fractal">
How can we specify the rmiregistry to look for the client stub at an alternate location,rather than going to the webserver hosting the applet ,to retrieve it?
In this case ,we need the rmiregistry to pick up the client stub from the local machine on which the applet is downloaded.
How can that be done?

   <<Less
About | Sitemap | Contact