Module org.snmp4j

Interface ThreadFactory

All Superinterfaces:
ThreadFactory
All Known Implementing Classes:
DefaultThreadFactory

public interface ThreadFactory extends ThreadFactory
The ThreadFactory describes a factory for threads of execution modeled as WorkerTasks.
Since:
1.9
Version:
3.9.0
Author:
Frank Fock
  • Method Details

    • createWorkerThread

      WorkerTask createWorkerThread(String name, WorkerTask task, boolean daemon)
      Creates a new thread of execution for the supplied task. The returned WorkerTask is a symmetric wrapper for the supplied one. When the returned task is being run, the supplied one will be executed in a new thread of execution until it either terminates or the WorkerTask.terminate() method has been called.
      Parameters:
      name - the name of the execution thread.
      task - the task to be executed in the new thread.
      daemon - indicates whether the new thread is a daemon (true or an user thread (false).
      Returns:
      the WorkerTask wrapper to control start and termination of the thread.
    • newThread

      default Thread newThread(Runnable r)
      Create a new thread for the given runnable.
      Specified by:
      newThread in interface ThreadFactory
      Parameters:
      r - a runnable to be executed by new thread instance
      Returns:
      the new Thread instance.
      Since:
      3.9.0