Package org.adempiere.webui.util
Class ServerPushTemplate
java.lang.Object
org.adempiere.webui.util.ServerPushTemplate
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
execute
(IServerPushCallback callback) Execute synchronous task in UI (event listener) thread.void
executeAsync
(IServerPushCallback callback) Execute asynchronous task in UI (event listener) thread.org.zkoss.zk.ui.Desktop
Get desktop
-
Constructor Details
-
ServerPushTemplate
public ServerPushTemplate(org.zkoss.zk.ui.Desktop desktop) - Parameters:
desktop
-
-
-
Method Details
-
executeAsync
Execute asynchronous task in UI (event listener) thread. This is implemented using Executions.schedule and will return immediately.- Parameters:
callback
-
-
execute
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
-