D
Derek Smith
We have created a Swing based application which involves many clients
looking at, and changing, the same data.
Each time a client makes a change to data, we want this to be
reflected immediately in all the other clients.
To achieve this we have used the Observer design pattern - each client
registers itself with a server object via RMI.
When a client makes a change to a piece of data, it informs the server
object of the change. The server then informs all other clients via an
RMI callback.
This calls a method on the client which updates the Swing interface.
However, this often causes a client to freeze permanently.
We have read on the Sun Web site that a callback affecting a Swing
interface must run in the event-dispatching thread to avoid deadlock.
Therefore, our code on the client uses the SwingUtilities
..invokeLater() method (we have also tried invokeAndWait).
Unfortunately, clients still freeze regularly.
Can anyone help?
looking at, and changing, the same data.
Each time a client makes a change to data, we want this to be
reflected immediately in all the other clients.
To achieve this we have used the Observer design pattern - each client
registers itself with a server object via RMI.
When a client makes a change to a piece of data, it informs the server
object of the change. The server then informs all other clients via an
RMI callback.
This calls a method on the client which updates the Swing interface.
However, this often causes a client to freeze permanently.
We have read on the Sun Web site that a callback affecting a Swing
interface must run in the event-dispatching thread to avoid deadlock.
Therefore, our code on the client uses the SwingUtilities
..invokeLater() method (we have also tried invokeAndWait).
Unfortunately, clients still freeze regularly.
Can anyone help?