Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RMI callback

 
Jinesh varia
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want my server to call client and not vice versa. what we call it a Call back. when we have our conventional RMI "hello world" application we have a Server object which implements a Remote interface and that is binded in the RMI registry which the client looks up. what happens when a Server wants to excecute a method that is on the client. how many remote objects do I need to make and how many do I need to bind. If some one could just give me an example(as a hello world type) I would be more then happy
 
Jim Baiter
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at:
http://151.196.11.50/fall2000/ssj/slides/rmi/callback1.html
Use the "next" link at the bottom - they show the code.
 
Arsalan Madjd
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have tried a simple example for RMI callback. But it does not work if the client is an Applet running in a browser. The problem is when the client creates a Remote object (which is a UnicastRemoteObject) my hostname is encodes in the object rather than the IP address. Therefor when the server tries to invoke a method on it, the following error is generated:
java.net.SocketException: connect (code=10061)
If I use an application for my client (or run my Applet in the appletviewer), IP is encoded in the remote object and everything works. Any suggestion helps?
Thanks,
Arsalan
 
Kunal Aher
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Arsalan , will you have a look at Jason Hunters code from Java Servlet PRogramming . He has used a better way of doing it
Look at chapter 10 Applet Servlet Commn..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic