Code example for ThreadFactory

Methods: newThread

	private static class MinPriorityThreadFactory implements ThreadFactory {
		private final ThreadFactory myDefaultThreadFactory = Executors.defaultThreadFactory();
		public Thread newThread(Runnable r) {
			final Thread th = myDefaultThreadFactory.newThread(r);
			return th;
	private static final int IMAGE_LOADING_THREADS_NUMBER = 3; // TODO: how many threads ???
	private final ExecutorService myPool = Executors.newFixedThreadPool(IMAGE_LOADING_THREADS_NUMBER, new MinPriorityThreadFactory());
	private final ExecutorService mySinglePool = Executors.newFixedThreadPool(1, new MinPriorityThreadFactory());
	private final HashMap<String, LinkedList<Runnable>> myOnImageSyncRunnables = new HashMap<String, LinkedList<Runnable>>();
	private class ImageSynchronizedHandler extends Handler {
Connect your IDE to all the code out there  Get Codota for Java