Package ar.app.util

Source Code of ar.app.util.MostRecentOnlyExecutor

package ar.app.util;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

import ar.util.NamedThreadFactory;

public class MostRecentOnlyExecutor extends ThreadPoolExecutor {
  public MostRecentOnlyExecutor(int corePoolSize, String threadNameBase) {
    super(corePoolSize, corePoolSize,
        1, TimeUnit.SECONDS,
        new ArrayBlockingQueue<Runnable>(1),
        new NamedThreadFactory(threadNameBase, true),
        new ThreadPoolExecutor.DiscardOldestPolicy());
  }
}
TOP

Related Classes of ar.app.util.MostRecentOnlyExecutor

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.