| | |
| | | import java.util.concurrent.Executors; |
| | | |
| | | public class JobQueue<T> { |
| | | private static final int MAX_OLD_JOBS_SIZE = 50; |
| | | private static final int MAX_OLD_JOBS_SIZE = 10; |
| | | private static long jobSequence = 0; |
| | | private Logger log = LoggerFactory.getLogger(JobQueue.class); |
| | | private List<AbstractJob<T>> queue = new ArrayList<>(); |
| | |
| | | } |
| | | } |
| | | |
| | | public Iterator<AbstractJob<T>> getOldJobsIterator() { |
| | | synchronized (oldJobs) { |
| | | return Collections.unmodifiableList(oldJobs).iterator(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Searches only for queued jobs (not done jobs). |
| | | * |