Class DefaultTaskManager
java.lang.Object
eu.rarogsoftware.rarog.platform.core.task.DefaultTaskManager
- All Implemented Interfaces:
TaskManager
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultTaskManager
(MetricsService metricsService, ApplicationSettings applicationSettings) -
Method Summary
Modifier and TypeMethodDescriptionReturnsScheduledExecutorService
that provide the same functionality asTaskManager
ReturnsThreadFactory
that provide the same functionality asTaskManager
createThread
(Runnable task) Start new monitored thread outside of thread pool.Future<?>
Runs provided task as soon as there is free thread in the pool.<T> Future<T>
Runs provided task as soon as there is free thread in the pool.scheduleTask
(Runnable task, ScheduleConfig<Void> scheduleConfig) Runs provided task using provided config<T> ScheduledFuture<T>
scheduleTask
(Callable<T> task, ScheduleConfig<T> scheduleConfig) Runs provided task using provided config
-
Constructor Details
-
DefaultTaskManager
-
-
Method Details
-
createThread
Description copied from interface:TaskManager
Start new monitored thread outside of thread pool. It's equivalent ofThread(Runnable)
- Specified by:
createThread
in interfaceTaskManager
- Parameters:
task
- task to run- Returns:
- not started thread with monitoring
-
runTask
Description copied from interface:TaskManager
Runs provided task as soon as there is free thread in the pool.- Specified by:
runTask
in interfaceTaskManager
- Parameters:
task
- task to run- Returns:
- the same
Future
that would be returned byExecutorService
-
runTask
Description copied from interface:TaskManager
Runs provided task as soon as there is free thread in the pool.- Specified by:
runTask
in interfaceTaskManager
- Parameters:
task
- task to run- Returns:
- the same
Future
that would be returned byExecutorService
-
scheduleTask
Description copied from interface:TaskManager
Runs provided task using provided config- Specified by:
scheduleTask
in interfaceTaskManager
- Parameters:
task
- task to runscheduleConfig
- config for scheduling task- Returns:
- controller for scheduled task
-
scheduleTask
Description copied from interface:TaskManager
Runs provided task using provided config- Specified by:
scheduleTask
in interfaceTaskManager
- Parameters:
task
- task to runscheduleConfig
- config for scheduling task- Returns:
- controller for scheduled task
-
asThreadFactory
Description copied from interface:TaskManager
ReturnsThreadFactory
that provide the same functionality asTaskManager
- Specified by:
asThreadFactory
in interfaceTaskManager
- Returns:
ThreadFactory
-
asExecutorService
Description copied from interface:TaskManager
ReturnsScheduledExecutorService
that provide the same functionality asTaskManager
- Specified by:
asExecutorService
in interfaceTaskManager
- Returns:
ScheduledExecutorService
-