• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown

Client callback

Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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???
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
Alas, poor Yorick, he knew this tiny ad:
a bit of art, as a gift, the permaculture playing cards
    Bookmark Topic Watch Topic
  • New Topic