Here you can find the source of createResourceRetrievalService( final String threadName)
Parameter | Description |
---|---|
threadName | the String name for the ExecutorService's thread, may be <code>null</code>. |
public static ScheduledExecutorService createResourceRetrievalService( final String threadName)
//package com.java2s; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ThreadFactory; public class Main { /**//from ww w. j a v a2s. c o m * Convenience method to create a {@link java.util.concurrent.ScheduledExecutorService} which can be used by World * Wind components to schedule periodic resource checks. The returned ExecutorService is backed by a single daemon * thread with minimum priority. * * @param threadName the String name for the ExecutorService's thread, may be <code>null</code>. * @return a new ScheduledExecutorService appropriate for scheduling periodic resource checks. */ public static ScheduledExecutorService createResourceRetrievalService( final String threadName) { ThreadFactory threadFactory = new ThreadFactory() { public Thread newThread(Runnable r) { Thread thread = new Thread(r); thread.setDaemon(true); thread.setPriority(Thread.MIN_PRIORITY); if (threadName != null) { thread.setName(threadName); } return thread; } }; return Executors.newSingleThreadScheduledExecutor(threadFactory); } }