@Override public <T> T invokeAny(Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionException { return delegate.invokeAny(tasks); }
@Override public <T> T invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { return delegate.invokeAny(tasks, timeout, unit); }
@Override public <T> T invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { return service.invokeAny(tasks, timeout, unit); }
@Override public <T> T invokeAny(Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionException { return service.invokeAny(tasks); }
/** * {@inheritDoc} */ @Override public <T> T invokeAny(Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionException { submitted.mark(tasks.size()); Collection<? extends Callable<T>> instrumented = instrument(tasks); return delegate.invokeAny(instrumented); }
/** * {@inheritDoc} */ @Override public <T> T invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { submitted.mark(tasks.size()); Collection<? extends Callable<T>> instrumented = instrument(tasks); return delegate.invokeAny(instrumented, timeout, unit); }
/** * {@inheritDoc} */ @Nonnull @Override public <T> T invokeAny(@Nonnull Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionException { submitted.mark(tasks.size()); Collection<? extends Callable<T>> instrumented = instrument(tasks); return delegate.invokeAny(instrumented); }
/** * {@inheritDoc} */ @Override public <T> T invokeAny(@Nonnull Collection<? extends Callable<T>> tasks, long timeout, @Nonnull TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { submitted.mark(tasks.size()); Collection<? extends Callable<T>> instrumented = instrument(tasks); return delegate.invokeAny(instrumented, timeout, unit); }
@Test @SuppressWarnings("unchecked") public void invokeAny() throws Exception { List<Future<Object>> exectedResult = Arrays.asList(expectedFutureObject); List<Callable<Object>> wrappedCallables = Arrays.asList(wrappedCallable); when(delegate.invokeAny(wrappedCallables)).thenReturn(exectedResult); Object result = executor.invokeAny(Arrays.asList(callable)); verify(delegate).invokeAny(wrappedCallables); assertThat(result).isEqualTo(exectedResult); }
@Test @SuppressWarnings("unchecked") public void invokeAnyTimeout() throws Exception { List<Future<Object>> exectedResult = Arrays.asList(expectedFutureObject); List<Callable<Object>> wrappedCallables = Arrays.asList(wrappedCallable); when(delegate.invokeAny(wrappedCallables, 1, TimeUnit.SECONDS)).thenReturn( exectedResult); Object result = executor.invokeAny(Arrays.asList(callable), 1, TimeUnit.SECONDS); verify(delegate).invokeAny(wrappedCallables, 1, TimeUnit.SECONDS); assertThat(result).isEqualTo(exectedResult); }
@Test public void invokeAny() throws InterruptedException, ExecutionException { underTest.invokeAny(callables); verify(executorService).invokeAny(callables); }
@Test public void invokeAny2() throws InterruptedException, ExecutionException, TimeoutException { underTest.invokeAny(callables, timeout, SECONDS); verify(executorService).invokeAny(callables, timeout, SECONDS); }
@Override public <T> T invokeAny(Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionException { List<TrackedCallable<T>> trackedTaskList = executorCore.registerCallableList(tasks); return executor.invokeAny(trackedTaskList); }
@Override public <T> T invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { List<TrackedCallable<T>> trackedTaskList = executorCore.registerCallableList(tasks); return executor.invokeAny(trackedTaskList, timeout, unit); }
public T call() throws Exception { _invokeEntryCount.incrementAndGet(); try { return _current.get().invokeAny(tasks, timeout, unit); } finally { _invokeEntryCount.decrementAndGet(); } }
public T call() throws Exception { _invokeEntryCount.incrementAndGet(); try { return _current.get().invokeAny(tasks, timeout, unit); } finally { _invokeEntryCount.decrementAndGet(); } }
@Override public <T> T invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { return getWrapped().invokeAny(tasks, timeout, unit); }
@Override public <T> T invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { return delegate.invokeAny(TaskConverter.alertingCallables(tasks, handler), timeout, unit); }
@Override public <T> T invokeAny(Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionException { return delegate.invokeAny(TaskConverter.alertingCallables(tasks, handler)); }
/** * {@inheritDoc} */ @Override public <T> T invokeAny(Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionException { submitted.mark(tasks.size()); Collection<? extends Callable<T>> instrumented = instrument(tasks); return delegate.invokeAny(instrumented); }