public class LocalizedTaskWrapper<T,V> extends BackgroundTask<T,V>
BackgroundTask.ProgressListener<T,V>, BackgroundTask.ProgressListenerAdapter<T,V>| Modifier and Type | Method and Description |
|---|---|
void |
canceled()
Called by the execution environment in UI thread if the task is canceled by
BackgroundTaskHandler.cancel() invocation. |
void |
done(V result)
Called by the execution environment in UI thread when the task is completed.
|
java.util.Map<java.lang.String,java.lang.Object> |
getParams()
Called by the execution environment in UI thread to prepare some execution parameters.
|
boolean |
handleException(java.lang.Exception ex)
Called by the execution environment in UI thread if the task
BackgroundTask.run(TaskLifeCycle) method raised an
exception. |
boolean |
handleTimeoutException()
Called by the execution environment in UI thread if the task timeout is exceeded.
|
void |
progress(java.util.List<T> changes)
Called by the execution environment in UI thread on progress change.
|
V |
run(TaskLifeCycle<T> lifeCycle)
Main method that performs a task.
|
addProgressListener, getOwnerFrame, getProgressListeners, getTimeoutMilliseconds, getTimeoutSeconds, removeProgressListenerpublic java.util.Map<java.lang.String,java.lang.Object> getParams()
BackgroundTaskBackgroundTask.run(TaskLifeCycle) method by calling
TaskLifeCycle.getParams().getParams in class BackgroundTask<T,V>public V run(TaskLifeCycle<T> lifeCycle) throws java.lang.Exception
BackgroundTaskTaskLifeCycle.isInterrupted() and return if it is trueInterruptedException - return from the method or don't catch it at allrun in class BackgroundTask<T,V>lifeCycle - lifecycle object that allows the main method to interact with the execution environmentjava.lang.Exception - exception in working threadpublic boolean handleException(java.lang.Exception ex)
BackgroundTaskBackgroundTask.run(TaskLifeCycle) method raised an
exception.handleException in class BackgroundTask<T,V>ex - exceptionpublic boolean handleTimeoutException()
BackgroundTaskhandleTimeoutException in class BackgroundTask<T,V>public void done(V result)
BackgroundTaskdone in class BackgroundTask<T,V>result - result of execution returned by BackgroundTask.run(TaskLifeCycle) methodpublic void canceled()
BackgroundTaskBackgroundTaskHandler.cancel() invocation.
canceled in class BackgroundTask<T,V>public void progress(java.util.List<T> changes)
BackgroundTaskprogress in class BackgroundTask<T,V>changes - list of changes since previous invocation