|
6 | 6 | import io.github.lvyahui8.spring.aggregate.interceptor.AggregateQueryInterceptorChain;
|
7 | 7 | import io.github.lvyahui8.spring.aggregate.model.*;
|
8 | 8 | import io.github.lvyahui8.spring.aggregate.repository.DataProviderRepository;
|
9 |
| -import io.github.lvyahui8.spring.aggregate.service.AsyncQueryTask; |
| 9 | +import io.github.lvyahui8.spring.aggregate.service.AbstractAsyncQueryTask; |
10 | 10 | import io.github.lvyahui8.spring.aggregate.service.AsyncQueryTaskWrapper;
|
11 | 11 | import io.github.lvyahui8.spring.aggregate.service.DataBeanAggregateQueryService;
|
12 | 12 | import lombok.Setter;
|
@@ -151,7 +151,7 @@ private Map<String, Object> getDependObjectMap(Map<String, Object> invokeParams,
|
151 | 151 | throw new RuntimeException("task wrapper instance create failed.",e);
|
152 | 152 | }
|
153 | 153 | taskWrapper.beforeSubmit();
|
154 |
| - Future<?> future = executorService.submit(new AsyncQueryTask<Object>(Thread.currentThread(),taskWrapper) { |
| 154 | + Future<?> future = executorService.submit(new AbstractAsyncQueryTask<Object>(Thread.currentThread(),taskWrapper) { |
155 | 155 | @Override
|
156 | 156 | public Object execute() throws Exception {
|
157 | 157 | try {
|
@@ -186,14 +186,15 @@ public Object execute() throws Exception {
|
186 | 186 |
|
187 | 187 | private void throwException(ExecutionException e) throws InterruptedException,
|
188 | 188 | InvocationTargetException, IllegalAccessException {
|
189 |
| - if (e.getCause() instanceof InterruptedException) { |
190 |
| - throw (InterruptedException) e.getCause(); |
191 |
| - } else if (e.getCause() instanceof InvocationTargetException){ |
192 |
| - throw (InvocationTargetException) e.getCause(); |
193 |
| - } else if (e.getCause() instanceof IllegalAccessException) { |
194 |
| - throw (IllegalAccessException) e.getCause(); |
| 189 | + Throwable cause = e.getCause(); |
| 190 | + if (cause instanceof InterruptedException) { |
| 191 | + throw (InterruptedException) cause; |
| 192 | + } else if (cause instanceof InvocationTargetException){ |
| 193 | + throw (InvocationTargetException) cause; |
| 194 | + } else if (cause instanceof IllegalAccessException) { |
| 195 | + throw (IllegalAccessException) cause; |
195 | 196 | } else {
|
196 |
| - throw (RuntimeException) e.getCause(); |
| 197 | + throw (RuntimeException) cause; |
197 | 198 | }
|
198 | 199 | }
|
199 | 200 |
|
|
0 commit comments