Class AsyncEjbBatchThreadPoolService
- java.lang.Object
-
- org.apache.batchee.tools.services.thread.AsyncEjbBatchThreadPoolService
-
- All Implemented Interfaces:
BatchService,BatchThreadPoolService
public class AsyncEjbBatchThreadPoolService extends Object implements BatchThreadPoolService
This is an implementation of aBatchThreadPoolServicewhich uses an @Asynchronous EJB method to spawn new Threads. The main reason for doing this is to have properly setup JavaEE Threads even in JavaEE 6 environments where BatchEE is not deeply integrated in other ways. Activate this class in a batchee.properties files asBatchThreadPoolService=org.apache.batchee.tools.services.thread.AsyncEjbBatchThreadPoolService
For some containers you might additionally need to enable theUserTransactionTransactionServicefor proper JTA transaction handling.
-
-
Constructor Summary
Constructors Constructor Description AsyncEjbBatchThreadPoolService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecuteTask(Runnable work, Object config)(Required) Runs the given task.voidinit(Properties batchConfig)voidshutdown()
-
-
-
Method Detail
-
init
public void init(Properties batchConfig)
- Specified by:
initin interfaceBatchService
-
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.
-
shutdown
public void shutdown()
- Specified by:
shutdownin interfaceBatchThreadPoolService
-
-