File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes A mechanism to push the changes between clients Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "A mechanism to push the changes between clients" Watch "A mechanism to push the changes between clients" New topic
Author

A mechanism to push the changes between clients

Joao Sov
Greenhorn

Joined: May 09, 2011
Posts: 9
In my implementation I'm using sockets for the communications because it gives me more freedom to implement my thread manager and a lot of control in my communication objects/commands.

My question is, how do I implement a mechanism to push the changes between clients?
Possible solutions:
1 - Create a socket in each client to receive the changes made by another user?
2 - Use RMI and use UnicastRemoteObject with a subscription mechanism instead of using sockets at all?
3 - Use a mechanism in which Client A requests a room that is already booked (Client B booked it) but in the interface it appears that it is still free. When Client A selects the option to book an error/warning message occurs and an update package comes from the response object.

I'm more inclined in using option 3. But still thinking in what should be the better solution.
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5278
    
  13

I don't push changes at all. When a room is booked by another client the client will be informed that the room was already booked and he needs to book another room.

Please, do not hijack other threads for a complete different question. Just start a new thread (with an appropriate meaningful title) and you'll get an answer in (very) short notice.


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
Joao Sov
Greenhorn

Joined: May 09, 2011
Posts: 9
Ok, I'm sorry. I thought that the other user was with a similar question.

Regarding the mechanism, I will follow your advice and use no mechanism at all. Many thanks for the fast reply.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: A mechanism to push the changes between clients