Java Thread Executor Create createExecutor()

Here you can find the source of createExecutor()

Description

create Executor

License

Open Source License

Declaration

public static ScheduledExecutorService createExecutor() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ThreadFactory;

public class Main {
    public static ScheduledExecutorService createExecutor() {
        return Executors.newSingleThreadScheduledExecutor(daemonThreadFactory());
    }/*from  w  w w . j a v  a 2 s.  c o  m*/

    public static ThreadFactory daemonThreadFactory() {
        return new ThreadFactory() {
            public Thread newThread(Runnable p_r) {
                Thread thread = new Thread(p_r);
                thread.setDaemon(true);
                return thread;
            }
        };
    }
}

Related

  1. createDaemonThreadFactory()
  2. createDefaultExecutorService()
  3. createDefaultExecutorService(final String threadNamePrefix, final int parallel)
  4. createEventsOrderedDeliveryExecutor()
  5. createExecutor(final String file)
  6. createExecutors(int numThreads)
  7. createExecutorService()
  8. createResourceRetrievalService( final String threadName)