Class NamedThreadFactory

java.lang.Object
org.gbif.utils.concurrent.NamedThreadFactory
All Implemented Interfaces:
ThreadFactory

public class NamedThreadFactory extends Object implements ThreadFactory
Modified Executors DefaultThreadFactory to allow custom named thread pools. Otherwise, this factory yields the same semantics as the thread factory returned by Executors.defaultThreadFactory(). Optionally a priority or daemon flag can be provided.
  • Constructor Details

    • NamedThreadFactory

      public NamedThreadFactory(String poolName)
      Creates a new named user thread factory using a normal priority.
      Parameters:
      poolName - the name prefix of the thread pool which will be appended -number for the individual thread
    • NamedThreadFactory

      public NamedThreadFactory(String poolName, int priority, boolean daemon)
      Creates a new named thread factory using explicit priority and daemon settings.
  • Method Details