@Override public void stop() throws InterruptedException { latch.countDown(); }
public RunApp(final String mId, final String mainClass, final Set<File> cp, final String includes, final String excludes, final List<File> watchDirs) { this.mId = mId; this.mainClass = mainClass; this.cp = cp.toArray(new File[cp.size()]); this.includes = includes; this.excludes = excludes; this.watchDirs = watchDirs; latch = new CountDownLatch(1); }
@Override public void execute() throws Exception { Main launcher = new Main(mId, mainClass, watchDirs, cp); if (includes != null) { launcher.includes(includes); } if (excludes != null) { launcher.excludes(excludes); } launcher.run(); latch.await(); }
public void clear() { for (ConcurrentSkipListMap.Node n = loNode(); isBeforeEnd(n); n = n.next) { if (n.getValidValue() != null) m.remove(n.key); } }
public int size() { long count = 0; for (ConcurrentSkipListMap.Node n = loNode(); isBeforeEnd(n); n = n.next) { if (n.getValidValue() != null) ++count; } return count >= Integer.MAX_VALUE? Integer.MAX_VALUE : (int)count; }
private Map.Entry highestEntry() { for (;;) { ConcurrentSkipListMap.Node n = hiNode(); if (n == null || !inBounds(n.key)) return null; Map.Entry e = n.createSnapshot(); if (e != null) return e; } }
private Map.Entry lowestEntry() { for (;;) { ConcurrentSkipListMap.Node n = loNode(); if (!isBeforeEnd(n)) return null; Map.Entry e = n.createSnapshot(); if (e != null) return e; } }
/** * @throws ClassCastException {@inheritDoc} * @throws NullPointerException if {@code fromElement} is null * @throws IllegalArgumentException {@inheritDoc} */ public NavigableSet tailSet(Object fromElement, boolean inclusive) { return new ConcurrentSkipListSet( (ConcurrentNavigableMap)m.tailMap(fromElement, inclusive)); }
/** * @throws ClassCastException {@inheritDoc} * @throws NullPointerException if {@code toElement} is null * @throws IllegalArgumentException {@inheritDoc} */ public NavigableSet headSet(Object toElement, boolean inclusive) { return new ConcurrentSkipListSet( (ConcurrentNavigableMap)m.headMap(toElement, inclusive)); }
public Object invokeAny(Collection tasks, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { return doInvokeAny(tasks, true, unit.toNanos(timeout)); }
public NavigableSet subSet(Object fromElement, boolean fromInclusive, Object toElement, boolean toInclusive) { return new ConcurrentSkipListSet ((ConcurrentNavigableMap) m.subMap(fromElement, fromInclusive, toElement, toInclusive)); } public NavigableSet headSet(Object toElement, boolean inclusive) {
private RunnableFuture newTaskFor(Callable task) { if (aes == null) return new FutureTask(task); else return aes.newTaskFor(task); }
/** * Creates with given first task and thread from ThreadFactory. * @param firstTask the first task (null if none) */ Worker(Runnable firstTask) { this.firstTask = firstTask; this.thread = getThreadFactory().newThread(this); }
public Object next() { HashEntry e = super.nextEntry(); return new WriteThroughEntry(e.key, e.value); } }
public void clear() { for (ConcurrentSkipListMap.Node n = loNode(); isBeforeEnd(n); n = n.next) { if (n.getValidValue() != null) m.remove(n.key); } }
public NavigableSet tailSet(Object fromElement, boolean inclusive) { return new ConcurrentSkipListSet( (ConcurrentNavigableMap)m.tailMap(fromElement, inclusive)); } public SortedSet subSet(Object fromElement, Object toElement) {
public NavigableSet headSet(Object toElement, boolean inclusive) { return new ConcurrentSkipListSet( (ConcurrentNavigableMap)m.headMap(toElement, inclusive)); } public NavigableSet tailSet(Object fromElement, boolean inclusive) {
public void clear() { for (ConcurrentSkipListMap.Node n = loNode(); isBeforeEnd(n); n = n.next) { if (n.getValidValue() != null) m.remove(n.key); } }