Interface TaskManager

All Known Implementing Classes:
DefaultTaskManager

public interface TaskManager
Manages background task ran using ExecutorService.

It can be treated as adapter on ExecutorService, that adds support for:

  • task monitoring,
  • system wide thread pool,
  • manageable pool size,
  • throttling,
  • easy scheduling and conditioning.

Overall it is always preferable to use TaskManager instead of ExecutorService or Thread. It is designed for short tasks, tasks that share the same memory pool (JVM) as main job, tasks that blocks request execution and all other kinds of light tasks, that don't need to be plugin state aware.

If you need support for long running tasks, tasks that must work even after restart, tasks that may wait for execution, or even can be started on different machine, you should consider using BackgroundJobManager. It provides support for heavy jobs and is plugin aware.

Usage:

         Some source code here
     

See Also: