Package org.adempiere.webui.util
Class ServerPushTemplate
- java.lang.Object
-
- org.adempiere.webui.util.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 Summary
Constructors Constructor Description ServerPushTemplate(org.zkoss.zk.ui.Desktop desktop)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute(IServerPushCallback callback)
Execute synchronous task in UI thread.void
executeAsync(IServerPushCallback callback)
Execute asynchronous task in UI thread.org.zkoss.zk.ui.Desktop
getDesktop()
-
-
-
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
-
-