- java.lang.Object
-
- org.snmp4j.util.DefaultThreadFactory.WorkerThread
-
- All Implemented Interfaces:
Runnable
,WorkerTask
- Enclosing class:
- DefaultThreadFactory
public class DefaultThreadFactory.WorkerThread extends Object implements WorkerTask
-
-
Constructor Summary
Constructors Constructor Description WorkerThread(String name, WorkerTask task)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Thread
getThread()
void
interrupt()
Interrupts this task.void
join()
Waits until this task has been finished.void
run()
void
terminate()
TheWorkerPool
might call this method to hint the activeWorkTask
instance to complete execution as soon as possible.
-
-
-
Constructor Detail
-
WorkerThread
public WorkerThread(String name, WorkerTask task)
-
-
Method Detail
-
terminate
public void terminate()
Description copied from interface:WorkerTask
TheWorkerPool
might call this method to hint the activeWorkTask
instance to complete execution as soon as possible.- Specified by:
terminate
in interfaceWorkerTask
-
join
public void join() throws InterruptedException
Description copied from interface:WorkerTask
Waits until this task has been finished.- Specified by:
join
in interfaceWorkerTask
- Throws:
InterruptedException
- if the join has been interrupted by another thread.
-
interrupt
public void interrupt()
Description copied from interface:WorkerTask
Interrupts this task.- Specified by:
interrupt
in interfaceWorkerTask
- See Also:
Thread.interrupt()
-
getThread
public Thread getThread()
-
-