• Post Reply Bookmark Topic Watch Topic
  • New Topic

Rmi Call Back Issue!!!  RSS feed

 
Muhammad Ammad Husain
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have written Rmi Server and Client , and need to cordiante in Both way, that is Client have to respond back to server in order to continue.But problem is that when Client have to respond back to Server, then client become server and server become client.Every thing is Ok here, but problem rises that, isn't there is any way that we dont have to start Rmiregistry on Both side?But only on single side, or not even any side but there is some other substitute for Look up,assmue i have bunch of ports avaialble.
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The answer is Jini. Jini supports a ServiceRegistrar that can manage callbacks on a system that both client and server use to find each other.
 
Chris De Vries
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is possible to stay within the realm of RMI and not run another rmiregisty on the client and still have callbacks. For example, let's say that we have an RMI server bound to rmiregistry which increments every second and we want it to send a callback to any client which contacts it every time it increments. The Interface for the Server could be:

RemoteEventListener is also an RMI interface, which could be defined as:

Now a client could register a callback with the server by running through a sequence like this:

As long as ClientCallback is a class which extends UnicastRemoteObject and implements RemoteEventListener. The difficult part of course is making sure the client and the server have access to the right stubs and if the client program is running behind a firewall the server will not be able to make the callbacks.
I hope this helps, I know it's a rather hasty explanation, but hopefully it's enough to get you started.
Chris
[ December 30, 2002: Message edited by: Chris De Vries ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!