52 |
|
super(executor); |
53 |
|
e = executor; |
54 |
|
} |
55 |
< |
public ScheduledFuture<Boolean> schedule(Runnable command, long delay, TimeUnit unit) { |
55 |
> |
public ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit) { |
56 |
|
return e.schedule(command, delay, unit); |
57 |
|
} |
58 |
|
public <V> ScheduledFuture<V> schedule(Callable<V> callable, long delay, TimeUnit unit) { |
59 |
|
return e.schedule(callable, delay, unit); |
60 |
|
} |
61 |
< |
public ScheduledFuture<Boolean> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) { |
61 |
> |
public ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) { |
62 |
|
return e.scheduleAtFixedRate(command, initialDelay, period, unit); |
63 |
|
} |
64 |
< |
public ScheduledFuture<Boolean> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) { |
64 |
> |
public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) { |
65 |
|
return e.scheduleWithFixedDelay(command, initialDelay, delay, unit); |
66 |
|
} |
67 |
|
} |
218 |
|
* @param executor the Executor to which the task will be submitted |
219 |
|
* @param task the task to submit |
220 |
|
* @return a Future representing pending completion of the task, |
221 |
< |
* and whose <tt>get()</tt> method will return <tt>Boolean.TRUE</tt> |
221 |
> |
* and whose <tt>get()</tt> method will return an arbitrary value |
222 |
|
* upon completion |
223 |
|
* @throws RejectedExecutionException if task cannot be scheduled |
224 |
|
* for execution |
225 |
|
*/ |
226 |
< |
public static Future<Boolean> execute(Executor executor, Runnable task) { |
227 |
< |
FutureTask<Boolean> ftask = new FutureTask<Boolean>(task, Boolean.TRUE); |
226 |
> |
public static Future<?> execute(Executor executor, Runnable task) { |
227 |
> |
FutureTask<?> ftask = new FutureTask<Boolean>(task, Boolean.TRUE); |
228 |
|
executor.execute(ftask); |
229 |
|
return ftask; |
230 |
|
} |
276 |
|
*/ |
277 |
|
public static void invoke(Executor executor, Runnable task) |
278 |
|
throws ExecutionException, InterruptedException { |
279 |
< |
FutureTask<Boolean> ftask = new FutureTask<Boolean>(task, Boolean.TRUE); |
279 |
> |
FutureTask<?> ftask = new FutureTask<Boolean>(task, Boolean.TRUE); |
280 |
|
executor.execute(ftask); |
281 |
|
ftask.get(); |
282 |
|
} |