File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

RMI callback

Jinesh varia
Greenhorn

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:
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

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?
Thanks,
Arsalan
Kunal Aher
Greenhorn

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..


Kunal
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: RMI callback