Package bitronix.tm.twopc.executor
Class AsyncExecutor
java.lang.Object
bitronix.tm.twopc.executor.AsyncExecutor
This implementation executes submitted jobs using a
java.util.concurrent cached thread pool.- Author:
- lorban
-
Constructor Summary
Constructors -
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.
-
Constructor Details
-
AsyncExecutor
public AsyncExecutor()
-
-
Method Details
-
submit
Description copied from interface:ExecutorSubmit a job to be executed by the thread pool. -
waitFor
Description copied from interface:ExecutorWait 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.- Specified by:
waitForin interfaceExecutor- Parameters:
future- the future representing the job as returned byExecutor.submit(bitronix.tm.twopc.executor.Job).timeout- if the job did not finish during the specified timeout in milliseconds, this method returns anyway.
-
isDone
Description copied from interface:ExecutorCheck if the thread pool has terminated the execution of the job represented by a future.- Specified by:
isDonein interfaceExecutor- Parameters:
future- the future representing the job as returned byExecutor.submit(bitronix.tm.twopc.executor.Job).- Returns:
- true if the job is done, false otherwise.
-
shutdown
public void shutdown()Description copied from interface:ExecutorShutdown the thead pool.
-