Class BackgroundWorkerImpl
java.lang.Object
io.jmix.flowui.backgroundtask.impl.BackgroundWorkerImpl
- All Implemented Interfaces:
BackgroundWorker
@Component("flowui_BackgroundWorkerImpl")
public class BackgroundWorkerImpl
extends Object
implements BackgroundWorker
Implementation of
BackgroundWorker
.-
Field Summary
Modifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationEventPublisher
protected BackgroundTaskWatchDog
protected CurrentAuthentication
protected ExecutorService
protected UiBackgroundTaskProperties
protected TimeSource
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
protected void
void
destroy()
Obtains UI access for later use from background thread.<T,
V> BackgroundTaskHandler<V> handle
(BackgroundTask<T, V> task) Creates handler for a background task.void
setProperties
(UiBackgroundTaskProperties properties)
-
Field Details
-
backgroundTaskWatchDog
-
currentAuthentication
-
applicationEventPublisher
@Autowired protected org.springframework.context.ApplicationEventPublisher applicationEventPublisher -
timeSource
-
properties
-
executorService
-
-
Constructor Details
-
BackgroundWorkerImpl
public BackgroundWorkerImpl()
-
-
Method Details
-
setProperties
-
createThreadPoolExecutor
protected void createThreadPoolExecutor() -
destroy
@PreDestroy public void destroy() -
handle
Description copied from interface:BackgroundWorker
Creates handler for a background task. The handler is used to control the task execution.- Specified by:
handle
in interfaceBackgroundWorker
- Type Parameters:
T
- progress measure unitV
- task result type- Parameters:
task
- background task instance- Returns:
- task handler
-
getUIAccessor
Description copied from interface:BackgroundWorker
Obtains UI access for later use from background thread. Can be invoked only from UI thread.- Specified by:
getUIAccessor
in interfaceBackgroundWorker
- Returns:
- ui accessor object that allows to read/write state of UI
-
checkUIAccess
public void checkUIAccess()- Specified by:
checkUIAccess
in interfaceBackgroundWorker
-