public class CockpitNGBackgroundOperation extends Object implements Runnable, Cancellable
Executions.schedule(Desktop, EventListener, Event) method.RuntimeException in
case of error. Executions.schedule(Desktop, EventListener, Event)
nor via Executions.activate(Desktop)| Constructor and Description |
|---|
CockpitNGBackgroundOperation(org.zkoss.zk.ui.Desktop desktop,
RequestOperationContextHolder.ContextRequest contextRequest,
Supplier backgroundTask,
Consumer<Object> onSuccess,
Consumer<Exception> onError)
Creates new instance of
CockpitNGBackgroundOperation |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Cancels the operation.
|
void |
run() |
protected void |
runInternal(org.zkoss.zk.ui.Desktop desktop) |
protected void |
scheduleForUI(Object result,
Consumer consumer) |
public CockpitNGBackgroundOperation(org.zkoss.zk.ui.Desktop desktop,
RequestOperationContextHolder.ContextRequest contextRequest,
Supplier backgroundTask,
Consumer<Object> onSuccess,
Consumer<Exception> onError)
CockpitNGBackgroundOperationcontextRequest - context of currently running server requestbackgroundTask - long running task to be executedonSuccess - callback to be executed after background tasks finishes successfully.Executions.schedule(Desktop, EventListener, Event)onError - callback to be executed on background task error.Executions.schedule(Desktop, EventListener, Event)public void cancel()
Cancellablecancel in interface Cancellableprotected void runInternal(org.zkoss.zk.ui.Desktop desktop)
Copyright © 2018. All rights reserved.