• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to let RMI implement broadcast

 
Li Caocao
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If one client modifies the table, the modification will be sent to server.
Then the server will broadcast such modification to all other clients, so that they can update their tables.
Now my problem is: via using Callback RMI,it seems just the client, who sends the modification, gets updated; the others cannot.
Something must be wrong. But I cannot figure it out. Is it the reason that I extend the UnicastRemoteObject?
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12014
220
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Li,
Welcome to JavaRanch.
Extending UnicastRemoteObject should not cause the problem you mention.
Do you have some form of Observer-Observable pattern on the server so that each connected client becomes a registered Observer of the database?
---
I don't think there is any requirement to update all clients dynamically whenever an individual record is booked. I think it is quite acceptable to leave the user with possibly old data, and then display an error message if they attempt to book a record which has been booked by someone else since they did their search.
Regards, Andrew
 
Li Caocao
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, I have got it done. I used CallBack RMI,that the server can call methods on the client.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic