Class NamedPriorityThreadFactory

java.lang.Object
org.serviceconnector.util.NamedPriorityThreadFactory
All Implemented Interfaces:
ThreadFactory

public class NamedPriorityThreadFactory extends Object implements ThreadFactory
A ThreadFactory that sets names and priority to the threads created by this factory. Threads created by this factory will take names in the form of the string namePrefix + " thread-" + threadNum where threadNum is the count of threads created by this type of factory.
  • Constructor Details

    • NamedPriorityThreadFactory

      public NamedPriorityThreadFactory(String namePrefix, int threadPrio)
      Constructor accepting the prefix and priority of the threads that will be created by this ThreadFactory
      Parameters:
      namePrefix - Prefix for names of threads
    • NamedPriorityThreadFactory

      public NamedPriorityThreadFactory(String namePrefix)
      Constructor accepting the prefix of the threads that will be created by this ThreadFactory
      Parameters:
      namePrefix - the name prefix
  • Method Details

    • newThread

      public Thread newThread(Runnable runnable)
      Returns a new thread using a name and priority as specified by this factory
      Specified by:
      newThread in interface ThreadFactory