hazelcast/hazelcast — pull request #1406 by noctarius (2013-12-18 12:41:06+00:00)
Title: Implemented ExecutorService::invokeAll(Collection, long, TimeUnit) and f...

...ixed an unexpected CancellationException throw in DistributedExecutorService

For the last one here's a small testapplication using a standard ExecutorService which is not throwing the CancellationException:
```
public class Test {
public static void main(String[] args) throws Exception {
ExecutorService executor = Executors.newFixedThreadPool(5);
ArrayList> tasks = new ArrayList>();
for (int i = 0; i < 1000; i++) {
tasks.add(new ExecutorServiceTest.CancellationAwareTask(i % 5 == 0 ? 0 : 20000));
}

try {
List> futures = executor.invokeAll(tasks, 5, TimeUnit.SECONDS);
System.out.println(futures.size());
for (int i = 0, size = futures.size(); i < size; i++) {
System.out.println(futures.get(i).isCancelled());
}
} catch (Exception e) {
throw e;
} finally {
executor.shutdown();
}
}
}
```