Java ThreadFactory createThreadFactory(String namePrefix)

Here you can find the source of createThreadFactory(String namePrefix)

Description

create Thread Factory

License

Apache License

Declaration

public static ThreadFactory createThreadFactory(String namePrefix) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import com.google.common.util.concurrent.ThreadFactoryBuilder;
import java.util.concurrent.ThreadFactory;

public class Main {
    public static ThreadFactory createThreadFactory(String namePrefix) {
        return new ThreadFactoryBuilder().setDaemon(true).setNameFormat(namePrefix + "-%d").build();
    }/*from  w  w  w . j  av  a 2 s. c  om*/
}

Related

  1. createNamedThreadFactory(final String threadName)
  2. createSimpleThreadFactory(final String name)
  3. createThreadFactory(final String threadName, final int stackSize)
  4. CreateThreadFactory(final ThreadGroup tg, final String threadName)
  5. createThreadFactory(String nameFormat, Thread.UncaughtExceptionHandler exceptionHandler)
  6. createThreadFactoryBuilder(final String baseName, final String componentName)
  7. getThreadFactory(final String THREAD_NAME, final boolean IS_DAEMON)