Interface WorkerTask
- All Superinterfaces:
Runnable
- All Known Subinterfaces:
SchedulerTask
- All Known Implementing Classes:
AbstractTransportServerThread, DefaultTcpTransportMapping.ServerThread, DefaultThreadFactory.WorkerThread, DefaultUdpTransportMapping.ListenThread, TLSTM.ServerThread
This models a
WorkerTask instance that would be executed by a
WorkerPool upon submission.- Since:
- 1.9
- Version:
- 3.10.0
- Author:
- Frank Fock
-
Method Summary
Modifier and TypeMethodDescriptionvoidInterrupts this task.voidjoin()Waits until this task has been finished.booleanjoin(long timeout) Waits until this task has been finished or the specified timeout has elapsed.voidshutdown()Gracefully shuts down this task.voidTheWorkerPoolmight call this method to hint the activeWorkTaskinstance to complete execution as soon as possible.
-
Method Details
-
shutdown
void shutdown()Gracefully shuts down this task. All pending operations should be finished, but no new operations should be accepted.- Since:
- 3.10.0
-
terminate
void terminate()TheWorkerPoolmight call this method to hint the activeWorkTaskinstance to complete execution as soon as possible. -
join
Waits until this task has been finished.- Throws:
InterruptedException- if the join has been interrupted by another thread.
-
join
Waits until this task has been finished or the specified timeout has elapsed.- Parameters:
timeout- the maximum time to wait in milliseconds.- Returns:
trueif the task has been finished,falseotherwise.- Throws:
InterruptedException- if the join has been interrupted by another thread.- Since:
- 3.10.0
-
interrupt
void interrupt()Interrupts this task.- See Also:
-