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 ExecutorServiceexecutorService
-
Constructor Summary
Constructors Constructor Description AbstractThreadPoolService()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidexecuteTask(Runnable work, Object config)(Required) Runs the given task.voidinit(Properties batchConfig)protected abstract ExecutorServicenewExecutorService(Properties batchConfig)voidshutdown()StringtoString()
-
-
-
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:
initin interfaceBatchService- Throws:
BatchContainerServiceException
-
shutdown
public void shutdown() throws BatchContainerServiceException- Specified by:
shutdownin 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:
executeTaskin 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.
-
-