Class AbstractThreadPoolService
- java.lang.Object
-
- org.apache.batchee.container.services.executor.AbstractThreadPoolService
-
- All Implemented Interfaces:
BatchService
,BatchThreadPoolService
- Direct Known Subclasses:
BoundedThreadPoolService
,DefaultThreadPoolService
public abstract class AbstractThreadPoolService extends Object implements BatchThreadPoolService
-
-
Field Summary
Fields Modifier and Type Field Description protected ExecutorService
executorService
-
Constructor Summary
Constructors Constructor Description AbstractThreadPoolService()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
executeTask(Runnable work, Object config)
(Required) Runs the given task.void
init(Properties batchConfig)
protected abstract ExecutorService
newExecutorService(Properties batchConfig)
void
shutdown()
String
toString()
-
-
-
Field Detail
-
executorService
protected ExecutorService executorService
-
-
Method Detail
-
newExecutorService
protected abstract ExecutorService newExecutorService(Properties batchConfig)
-
init
public void init(Properties batchConfig) throws BatchContainerServiceException
- Specified by:
init
in interfaceBatchService
- Throws:
BatchContainerServiceException
-
shutdown
public void shutdown() throws BatchContainerServiceException
- Specified by:
shutdown
in interfaceBatchThreadPoolService
- Throws:
BatchContainerServiceException
-
executeTask
public void executeTask(Runnable work, Object config)
Description copied from interface:BatchThreadPoolService
(Required) Runs the given task. A task is usually short lived- Specified by:
executeTask
in interfaceBatchThreadPoolService
- Parameters:
work
- The task to executeconfig
- Optional configuration to customize the execution. The Container always passes a null value. Typically used when other user plugins wish to use the ExecutorService to execute tasks.
-
-