Class NamedThreadFactory

  • All Implemented Interfaces:
    java.util.concurrent.ThreadFactory

    public class NamedThreadFactory
    extends java.lang.Object
    implements java.util.concurrent.ThreadFactory
    • Constructor Summary

      Constructors 
      Constructor Description
      NamedThreadFactory​(java.lang.String prefix)
      Create a new ThreadFactory with the specified prefix as name
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Thread newThread​(java.lang.Runnable r)
      create a new named thread
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NamedThreadFactory

        public NamedThreadFactory​(java.lang.String prefix)
        Create a new ThreadFactory with the specified prefix as name
        Parameters:
        prefix - Text to be displayed before the thread number
    • Method Detail

      • newThread

        public java.lang.Thread newThread​(java.lang.Runnable r)
        create a new named thread
        Specified by:
        newThread in interface java.util.concurrent.ThreadFactory
        Parameters:
        r - Runnable
        Returns:
        created thread