(final Callable<T> clbl)
| 47 | } |
| 48 | |
| 49 | public <T> Future<T> submit(final Callable<T> clbl) |
| 50 | { |
| 51 | return new Future<T>() { |
| 52 | |
| 53 | public boolean cancel(boolean bln) |
| 54 | { |
| 55 | return false; |
| 56 | } |
| 57 | |
| 58 | public boolean isCancelled() |
| 59 | { |
| 60 | return false; |
| 61 | } |
| 62 | |
| 63 | public boolean isDone() |
| 64 | { |
| 65 | return false; |
| 66 | } |
| 67 | |
| 68 | public T get() throws InterruptedException, ExecutionException |
| 69 | { |
| 70 | try |
| 71 | { |
| 72 | return clbl.call(); |
| 73 | } |
| 74 | catch (Exception ex) |
| 75 | { |
| 76 | return null; |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | public T get(long l, TimeUnit tu) throws InterruptedException, ExecutionException, TimeoutException |
| 81 | { |
| 82 | return get(); |
| 83 | } |
| 84 | }; |
| 85 | } |
| 86 | |
| 87 | public <T> Future<T> submit(Runnable r, T t) |
| 88 | { |
no test coverage detected