Class ServerPushTemplate

java.lang.Object
org.adempiere.webui.util.ServerPushTemplate

public class ServerPushTemplate extends Object
Zk UI update must be done in UI (event listener) thread. This class help to implement that base on spring's jdbc template pattern.
Author:
hengsin
  • Constructor Details

    • ServerPushTemplate

      public ServerPushTemplate(org.zkoss.zk.ui.Desktop desktop)
      Parameters:
      desktop -
  • Method Details

    • executeAsync

      public void executeAsync(IServerPushCallback callback)
      Execute asynchronous task in UI (event listener) thread. This is implemented using Executions.schedule and will return immediately.
      Parameters:
      callback -
    • execute

      public void execute(IServerPushCallback callback)
      Execute synchronous task in UI (event listener) thread. This is implemented using Executions.activate/deactivate and will only return after the invoked task have ended.

      For better scalability, if possible, you should use executeAsync(IServerPushCallback) instead.

      Parameters:
      callback -
    • getDesktop

      public org.zkoss.zk.ui.Desktop getDesktop()
      Get desktop
      Returns:
      desktop