invokeAll () não está disposto a aceitar uma coleção <Callable <T>>
Não consigo entender por que esse código não será compilado
ExecutorService executor = new ScheduledThreadPoolExecutor(threads);
class DocFeeder implements Callable<Boolean> {....}
...
List<DocFeeder> list = new LinkedList<DocFeeder>();
list.add(new DocFeeder(1));
...
executor.invokeAll(list);
A mensagem de erro é:
The method invokeAll(Collection<Callable<T>>) in the type ExecutorService is
not applicable for the arguments (List<DocFeeder>)
list
é umCollection
doDocFeeder
, que implementaCallable<Boolean>
- O que está acontecendo?!