Package bitronix.tm.twopc.executor
Interface Executor
- All Superinterfaces:
Service
- All Known Implementing Classes:
AsyncExecutor,SyncExecutor
Thread pool interface required by the two-phase commit logic.
- Author:
- lorban
-
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck if the thread pool has terminated the execution of the job represented by a future.voidshutdown()Shutdown the thead pool.Submit a job to be executed by the thread pool.voidWait for the job represented by the future to terminate.
-
Method Details
-
submit
Submit a job to be executed by the thread pool. -
waitFor
Wait for the job represented by the future to terminate. The call to this method will block until the job finished its execution or the specified timeout elapsed.- Parameters:
future- the future representing the job as returned bysubmit(bitronix.tm.twopc.executor.Job).timeout- if the job did not finish during the specified timeout in milliseconds, this method returns anyway.
-
isDone
Check if the thread pool has terminated the execution of the job represented by a future.- Parameters:
future- the future representing the job as returned bysubmit(bitronix.tm.twopc.executor.Job).- Returns:
- true if the job is done, false otherwise.
-
shutdown
void shutdown()Shutdown the thead pool.
-