File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Distributed Java and the fly likes How does server call clinet methods? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "How does server call clinet methods?" Watch "How does server call clinet methods?" New topic

How does server call clinet methods?

Elven Cao

Joined: Sep 02, 2003
Posts: 2
I want to pass data between server and client. In RMI, client can call remote server methods, but how can server call client methods?
Michael Ernest
High Plains Drifter

Joined: Oct 25, 2000
Posts: 7292

By reversing the normal process of passing a stub.
A server isn't so much a machine or a process -- it's a role that a program can play in a distributed environment. In this sense with RMI, a server is any process that exports a stub that can be passed to a client for use. A client is any process that is "aware" of the service interface and will use the stub to call on a server's methods.
A typical scenario might look like this:
1) One client process calls a server process and gets a stub.
2) The "initial client" passes a stub to the "initial server" as a parameter via one of the server's exported methods.
3) The initial server calls on the initial client via one of its exported methods, passing data as a parameter.
High-level view, but I hope it gives you the gist.

Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
I agree. Here's the link:
subject: How does server call clinet methods?
It's not a secret anymore!