invokeAll () ist nicht bereit, eine Sammlung anzunehmen <Callable <T >>
Ich verstehe nicht, warum dieser Code nicht kompiliert wird
ExecutorService executor = new ScheduledThreadPoolExecutor(threads);
class DocFeeder implements Callable<Boolean> {....}
...
List<DocFeeder> list = new LinkedList<DocFeeder>();
list.add(new DocFeeder(1));
...
executor.invokeAll(list);
Die Fehlermeldung lautet:
The method invokeAll(Collection<Callable<T>>) in the type ExecutorService is
not applicable for the arguments (List<DocFeeder>)
list
ist einCollection
vonDocFeeder
, das @ implementieCallable<Boolean>
- Was ist los?