Class SimpleThreadFactory

java.lang.Object
tnx.lab.thread.SimpleThreadFactory
All Implemented Interfaces:
ThreadFactory

public class SimpleThreadFactory extends Object implements ThreadFactory
The simplest ThreadFactory imaginable. This class exists just so that you understand what a ThreadFactory is, and so that you understand what code would be necessary for you to write if you aren't given a ThreadFactory.
Author:
__STUDENT_NAME__, Dennis Cosgrove (http://www.cse.wustl.edu/~cosgroved/)
  • Constructor Details

    • SimpleThreadFactory

      public SimpleThreadFactory()
  • Method Details

    • newThread

      public Thread newThread​(Runnable target)
      Should construct a new Thread. This thread should not be running, and should not have already run. You are just setting up a thread with the given runnable so that another class can use it.
      Specified by:
      newThread in interface ThreadFactory
      Returns:
      constructed thread