public class AsyncEjbBatchThreadPoolService extends Object implements BatchThreadPoolService
BatchThreadPoolService
which 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 as
BatchThreadPoolService=org.apache.batchee.tools.services.thread.AsyncEjbBatchThreadPoolServiceFor some containers you might additionally need to enable the
UserTransactionTransactionService
for
proper JTA transaction handling.Constructor and Description |
---|
AsyncEjbBatchThreadPoolService() |
Modifier and Type | Method and Description |
---|---|
void |
executeTask(Runnable work,
Object config)
(Required) Runs the given task.
|
void |
init(Properties batchConfig) |
void |
shutdown() |
public void init(Properties batchConfig)
init
in interface BatchService
public void executeTask(Runnable work, Object config)
BatchThreadPoolService
executeTask
in interface BatchThreadPoolService
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.public void shutdown()
shutdown
in interface BatchThreadPoolService
Copyright © 2017 The Apache Software Foundation. All rights reserved.