Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Client callback

 
supratim chaudhury
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone plz tell what is client side callback?
Can anyone give some code to illustrate the explanation?
actually,what i have come to know that client acts as the server
and it extends unicastremote...or uses exportobject...
also client class needs to implement another remote interface....
But after that i miss the obvious point...
Where actually does the server invoke a method on the client just as client
explicitly calls a method on remote object of server???
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If both Client and Server are Remote objects -

That means they both have "Remote" interfaces - let's call them "Client" and "Server".

The actual implementations, let's call "ClientImpl" and "ServerImpl".

One of the methods on the "Server" should be something like -


When ClientImpl gets a reference to Server (through Naming.lookup()) it can them call register() and pass a reference to itself in:



Then, inside ServerImpl, the register() method will receive the stub to "ClientImpl" - hidden behind a "Client" remote interface - and can save a reference to it...


assuming the "Client" interface has the following method -


Later - the ServerImpl can use these references to make calls to all the clients - something like -


[ May 03, 2006: Message edited by: Nathan Pruett ]
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!