Class ServerPushTemplate


  • public class ServerPushTemplate
    extends Object
    Zk UI update must be done in either UI thread or using server push. This class help to implement that base on spring's jdbctemplate pattern.
    Author:
    hengsin
    • Constructor Detail

      • ServerPushTemplate

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

      • executeAsync

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

        public void execute​(IServerPushCallback callback)
        Execute synchronous task in UI 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 instead.
        Parameters:
        callback -
      • getDesktop

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