Class DefaultThreadFactory.WorkerThread
java.lang.Object
org.snmp4j.util.DefaultThreadFactory.WorkerThread
- All Implemented Interfaces:
Runnable, WorkerTask
- Enclosing class:
DefaultThreadFactory
- Since:
- 1.8
- Version:
- 3.9.0
- Author:
- Frank Fock
-
Constructor Summary
Constructors -
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.voidrun()voidshutdown()Gracefully shuts down this task.voidTheWorkerPoolmight call this method to hint the activeWorkTaskinstance to complete execution as soon as possible.
-
Constructor Details
-
WorkerThread
-
-
Method Details
-
shutdown
public void shutdown()Description copied from interface:WorkerTaskGracefully shuts down this task. All pending operations should be finished, but no new operations should be accepted.- Specified by:
shutdownin interfaceWorkerTask
-
terminate
public void terminate()Description copied from interface:WorkerTaskTheWorkerPoolmight call this method to hint the activeWorkTaskinstance to complete execution as soon as possible.- Specified by:
terminatein interfaceWorkerTask
-
join
Description copied from interface:WorkerTaskWaits until this task has been finished.- Specified by:
joinin interfaceWorkerTask- Throws:
InterruptedException- if the join has been interrupted by another thread.
-
join
Description copied from interface:WorkerTaskWaits until this task has been finished or the specified timeout has elapsed.- Specified by:
joinin interfaceWorkerTask- 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.
-
run
-
interrupt
public void interrupt()Description copied from interface:WorkerTaskInterrupts this task.- Specified by:
interruptin interfaceWorkerTask- See Also:
-
getThread
-