71 |
|
return new FutureTask<T>(callable); |
72 |
|
} |
73 |
|
|
74 |
+ |
/** |
75 |
+ |
* @throws RejectedExecutionException {@inheritDoc} |
76 |
+ |
* @throws NullPointerException {@inheritDoc} |
77 |
+ |
*/ |
78 |
|
public Future<?> submit(Runnable task) { |
79 |
|
if (task == null) throw new NullPointerException(); |
80 |
|
RunnableFuture<Object> ftask = newTaskFor(task, null); |
82 |
|
return ftask; |
83 |
|
} |
84 |
|
|
85 |
+ |
/** |
86 |
+ |
* @throws RejectedExecutionException {@inheritDoc} |
87 |
+ |
* @throws NullPointerException {@inheritDoc} |
88 |
+ |
*/ |
89 |
|
public <T> Future<T> submit(Runnable task, T result) { |
90 |
|
if (task == null) throw new NullPointerException(); |
91 |
|
RunnableFuture<T> ftask = newTaskFor(task, result); |
93 |
|
return ftask; |
94 |
|
} |
95 |
|
|
96 |
+ |
/** |
97 |
+ |
* @throws RejectedExecutionException {@inheritDoc} |
98 |
+ |
* @throws NullPointerException {@inheritDoc} |
99 |
+ |
*/ |
100 |
|
public <T> Future<T> submit(Callable<T> task) { |
101 |
|
if (task == null) throw new NullPointerException(); |
102 |
|
RunnableFuture<T> ftask = newTaskFor(task); |