Java ThreadFactory CreateThreadFactory(final ThreadGroup tg, final String threadName)

Here you can find the source of CreateThreadFactory(final ThreadGroup tg, final String threadName)

Description

Create Thread Factory

License

Open Source License

Declaration

public static ThreadFactory CreateThreadFactory(final ThreadGroup tg,
            final String threadName) 

Method Source Code

//package com.java2s;

import java.util.concurrent.ThreadFactory;

public class Main {
    public static ThreadFactory CreateThreadFactory(final ThreadGroup tg,
            final String threadName) {
        final ThreadFactory threadFactory = new ThreadFactory() {
            public Thread newThread(Runnable command) {
                Thread thread = new Thread(tg, command, threadName);
                thread.setDaemon(true);//ww w.  j  a  v a 2 s . co m
                return thread;
            }
        };
        return threadFactory;
    }
}

Related

  1. createDaemonThreadFactory(final int threadPriority, final ThreadGroup group, final ClassLoader contextClassLoader)
  2. createFactory(final String threadName)
  3. createNamedThreadFactory(final String threadName)
  4. createSimpleThreadFactory(final String name)
  5. createThreadFactory(final String threadName, final int stackSize)
  6. createThreadFactory(String nameFormat, Thread.UncaughtExceptionHandler exceptionHandler)
  7. createThreadFactory(String namePrefix)
  8. createThreadFactoryBuilder(final String baseName, final String componentName)
  9. getThreadFactory(final String THREAD_NAME, final boolean IS_DAEMON)