I have a Java EE application where the model is updated very frequently from various sources. In addition I have a rich client application which triggers some actions via remote EJBs but which should also display the model changes ate least every second.
What is the easiest/ best option for sending the changes from the Java EE application to Java client application? Till now I have the following options:
- polling a remote EJB every second from the client
- polling a servlet (Is it preferable to use json/ xml instead of java object serialization? Any other serialization?)
- websockets (Is it possible to send Java objects here? Or must the result be serialized to Json for for example?)
- tcp socket connection (The server would provide a port where the client connects to on startup. Model changes are send via standard object serialization. Is this "allowed" in a Java EE app?)