17 |
|
import java.util.concurrent.CountDownLatch; |
18 |
|
import java.util.concurrent.Delayed; |
19 |
|
import java.util.concurrent.ExecutionException; |
20 |
– |
import java.util.concurrent.Executors; |
20 |
|
import java.util.concurrent.ExecutorService; |
21 |
|
import java.util.concurrent.Future; |
22 |
|
import java.util.concurrent.RejectedExecutionException; |
44 |
|
} |
45 |
|
|
46 |
|
static class CustomTask<V> implements RunnableScheduledFuture<V> { |
47 |
< |
RunnableScheduledFuture<V> task; |
47 |
> |
private final RunnableScheduledFuture<V> task; |
48 |
|
volatile boolean ran; |
49 |
< |
CustomTask(RunnableScheduledFuture<V> t) { task = t; } |
49 |
> |
CustomTask(RunnableScheduledFuture<V> task) { this.task = task; } |
50 |
|
public boolean isPeriodic() { return task.isPeriodic(); } |
51 |
|
public void run() { |
52 |
|
ran = true; |