Do event when variable is modified
-
Hi, I've an aplication client-server, and I need to do an event in the client when one variable is modified in the server. it is posible??? I know that in the server or in the client is posible with propertychangelistener, but I don't know if it is posible by this way and how can I do it. Thank you, so much
-
Hi, I've an aplication client-server, and I need to do an event in the client when one variable is modified in the server. it is posible??? I know that in the server or in the client is posible with propertychangelistener, but I don't know if it is posible by this way and how can I do it. Thank you, so much
Yes, you should set up a custom Listener, which is implemented by Server and Client (a common interface should align those implementations). Both should address the listener - the server to launch the event, the client to react on that. Take a look at these links: http://docs.oracle.com/javase/tutorial/rmi/index.html[^] http://www.javacoffeebreak.com/books/extracts/jini/Event.html[^] http://www.karsten-wolke.de/Diplomarbeit/doc/paper.pdf[^] (PDF)
regards Torsten When I'm not working
-
Yes, you should set up a custom Listener, which is implemented by Server and Client (a common interface should align those implementations). Both should address the listener - the server to launch the event, the client to react on that. Take a look at these links: http://docs.oracle.com/javase/tutorial/rmi/index.html[^] http://www.javacoffeebreak.com/books/extracts/jini/Event.html[^] http://www.karsten-wolke.de/Diplomarbeit/doc/paper.pdf[^] (PDF)
regards Torsten When I'm not working
If I understood good your answer, I can't implement this, becouse I receive the comunication when the client press a button, but this button only press one client, and not all the client. However, to finish the program I need send an message to all client, but if only press the button one client only receive the message this client and not all. Thank you so much, if I wrong, please check me
-
If I understood good your answer, I can't implement this, becouse I receive the comunication when the client press a button, but this button only press one client, and not all the client. However, to finish the program I need send an message to all client, but if only press the button one client only receive the message this client and not all. Thank you so much, if I wrong, please check me
There is no reason this can not work, it does on a lot of software. Is the sequence this: 0. A client initiates an action. 1. The action is sent to the server for processing. 2. All clients receive an update with the result. This is a very simple pattern, think live chat rooms via instant messaging.
Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
-
There is no reason this can not work, it does on a lot of software. Is the sequence this: 0. A client initiates an action. 1. The action is sent to the server for processing. 2. All clients receive an update with the result. This is a very simple pattern, think live chat rooms via instant messaging.
Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
Yes, you are right, but I receive the message from the server in the event of press this button, and not all the client press the button. I need an event that run automatic when a value change in the server, becouse not all the client will receive the value changed.
-
Yes, you are right, but I receive the message from the server in the event of press this button, and not all the client press the button. I need an event that run automatic when a value change in the server, becouse not all the client will receive the value changed.
a Listener implementation works both ways. You can have events launched by a client that the server reacts on. And you can have actions the Server launches and one or all client react on. In the consequence you can also have a client launching an event that causes the server to launch an event that all clients react on. Try first to implement some listener action from server to client and vis-a-vis (a console print out should be enough to see if the server(/client ack the event). After that connect the two listener methods and see what fun it can be.
regards Torsten When I'm not working
-
a Listener implementation works both ways. You can have events launched by a client that the server reacts on. And you can have actions the Server launches and one or all client react on. In the consequence you can also have a client launching an event that causes the server to launch an event that all clients react on. Try first to implement some listener action from server to client and vis-a-vis (a console print out should be enough to see if the server(/client ack the event). After that connect the two listener methods and see what fun it can be.
regards Torsten When I'm not working
Please, can you show me an example?? Thank you so much!
-
Please, can you show me an example?? Thank you so much!
This describes the implementation at a simple point: http://java.sys-con.com/node/46979[^]
regards Torsten When I'm not working