wood burning stoves 2.0
The moose likes Distributed Java and the fly likes RMI callback Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "RMI callback" Watch "RMI callback" New topic

RMI callback

Jinesh varia

Joined: Feb 14, 2001
Posts: 2
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

Joined: Jan 05, 2001
Posts: 532
Take a look at:
Use the "next" link at the bottom - they show the code.
Arsalan Madjd

Joined: Feb 21, 2001
Posts: 10
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?
Kunal Aher

Joined: Apr 07, 2000
Posts: 20
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..

Consider Paul's rocket mass heater.
subject: RMI callback
It's not a secret anymore!