Skip to content

Commit 9ad412e

Browse files
committed
release 1.1.2
1 parent d36784c commit 9ad412e

File tree

8 files changed

+30
-22
lines changed

8 files changed

+30
-22
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ limitations under the License.
2020

2121
<groupId>io.github.lvyahui8</groupId>
2222
<artifactId>spring-boot-data-aggregator</artifactId>
23-
<version>1.1.2</version>
23+
<version>1.1.3-SNAPSHOT</version>
2424
<modules>
2525
<module>spring-boot-data-aggregator-core</module>
2626
<module>spring-boot-data-aggregator-autoconfigure</module>

spring-boot-data-aggregator-autoconfigure/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>spring-boot-data-aggregator</artifactId>
77
<groupId>io.github.lvyahui8</groupId>
8-
<version>1.1.2</version>
8+
<version>1.1.3-SNAPSHOT</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

spring-boot-data-aggregator-autoconfigure/src/main/java/io/github/lvyahui8/spring/autoconfigure/BeanAggregateAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ private void dfs(Map<String,Set<String>> graphAdjMap,Map<String,Integer> visitSt
103103
public DataBeanAggregateQueryService dataBeanAggregateQueryService (
104104
@Qualifier("dataProviderRepository") DataProviderRepository dataProviderRepository) {
105105
if(properties.getBasePackages() != null) {
106-
Map<String,Set<String>> provideDependMap = new HashMap<>();
106+
Map<String,Set<String>> provideDependMap = new HashMap<>(64);
107107
for (String basePackage : properties.getBasePackages()) {
108108
Reflections reflections = new Reflections(basePackage, new MethodAnnotationsScanner());
109109
Set<Method> providerMethods = reflections.getMethodsAnnotatedWith(DataProvider.class);

spring-boot-data-aggregator-core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>spring-boot-data-aggregator</artifactId>
77
<groupId>io.github.lvyahui8</groupId>
8-
<version>1.1.2</version>
8+
<version>1.1.3-SNAPSHOT</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,17 @@
66
* @author lvyahui (lvyahui8@gmail.com,lvyahui8@126.com)
77
* @since 2019/12/25 22:40
88
*/
9-
public abstract class AsyncQueryTask<T> implements Callable<T> {
10-
Thread taskFromThread;
11-
AsyncQueryTaskWrapper asyncQueryTaskWrapper;
9+
public abstract class AbstractAsyncQueryTask<T> implements Callable<T> {
10+
/**
11+
* 任务来源线程
12+
*/
13+
private Thread taskFromThread;
14+
/**
15+
* 异步任务包装器
16+
*/
17+
private AsyncQueryTaskWrapper asyncQueryTaskWrapper;
1218

13-
public AsyncQueryTask(Thread taskFromThread, AsyncQueryTaskWrapper asyncQueryTaskWrapper) {
19+
public AbstractAsyncQueryTask(Thread taskFromThread, AsyncQueryTaskWrapper asyncQueryTaskWrapper) {
1420
this.taskFromThread = taskFromThread;
1521
this.asyncQueryTaskWrapper = asyncQueryTaskWrapper;
1622
}
@@ -30,9 +36,10 @@ public T call() throws Exception {
3036
}
3137

3238
/**
39+
* 异步任务的实际内容
3340
*
34-
* @return
35-
* @throws Exception
41+
* @return 异步任务返回值
42+
* @throws Exception 异步任务允许抛出异常
3643
*/
37-
public abstract T execute() throws Exception;
44+
public abstract T execute() throws Exception;
3845
}

spring-boot-data-aggregator-core/src/main/java/io/github/lvyahui8/spring/aggregate/service/impl/DataBeanAggregateQueryServiceImpl.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import io.github.lvyahui8.spring.aggregate.interceptor.AggregateQueryInterceptorChain;
77
import io.github.lvyahui8.spring.aggregate.model.*;
88
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;
1010
import io.github.lvyahui8.spring.aggregate.service.AsyncQueryTaskWrapper;
1111
import io.github.lvyahui8.spring.aggregate.service.DataBeanAggregateQueryService;
1212
import lombok.Setter;
@@ -151,7 +151,7 @@ private Map<String, Object> getDependObjectMap(Map<String, Object> invokeParams,
151151
throw new RuntimeException("task wrapper instance create failed.",e);
152152
}
153153
taskWrapper.beforeSubmit();
154-
Future<?> future = executorService.submit(new AsyncQueryTask<Object>(Thread.currentThread(),taskWrapper) {
154+
Future<?> future = executorService.submit(new AbstractAsyncQueryTask<Object>(Thread.currentThread(),taskWrapper) {
155155
@Override
156156
public Object execute() throws Exception {
157157
try {
@@ -186,14 +186,15 @@ public Object execute() throws Exception {
186186

187187
private void throwException(ExecutionException e) throws InterruptedException,
188188
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;
195196
} else {
196-
throw (RuntimeException) e.getCause();
197+
throw (RuntimeException) cause;
197198
}
198199
}
199200

spring-boot-data-aggregator-example/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>spring-boot-data-aggregator</artifactId>
77
<groupId>io.github.lvyahui8</groupId>
8-
<version>1.1.2</version>
8+
<version>1.1.3-SNAPSHOT</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

spring-boot-data-aggregator-starter/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>spring-boot-data-aggregator</artifactId>
77
<groupId>io.github.lvyahui8</groupId>
8-
<version>1.1.2</version>
8+
<version>1.1.3-SNAPSHOT</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

0 commit comments

Comments
 (0)