Win a copy of Spring Boot in Practice this week in the Spring forum!
  • 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

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 ]
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic