Skip to content

Commit 5af680e

Browse files
committed
tx:txc upgrade
1 parent d4b1e01 commit 5af680e

4 files changed

Lines changed: 15 additions & 6 deletions

File tree

example/spring-demo-client/src/main/resources/application-ujued.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@ spring.datasource.password=123456
22

33
tx-lcn.logger.enabled=true
44

5+
spring.datasource.hikari.maximum-pool-size=5
6+
57
#spring.cloud.consul.discovery.health-check-url=http://127.0.0.1:${server.port}/actuator/health
68
#logging.level.com.codingapi.tx.client=DEBUG

example/spring-demo-d/src/main/resources/application-ujued.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22

33
spring.datasource.password=123456
44

5+
spring.datasource.hikari.maximum-pool-size=5
6+
57
tx-lcn.logger.enabled=true
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#spring.cloud.consul.discovery.health-check-url=http://127.0.0.1:${server.port}/actuator/health
22
spring.datasource.password=123456
33

4+
spring.datasource.hikari.maximum-pool-size=5
5+
46
tx-lcn.logger.enabled=true

tx-client/src/main/java/com/codingapi/tx/client/aspect/DataSourceAspect.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.codingapi.tx.client.aspect;
22

3+
import com.codingapi.tx.client.aspect.weave.DTXResourceWeaver;
34
import com.codingapi.tx.client.config.TxClientConfig;
45
import lombok.extern.slf4j.Slf4j;
56
import org.aspectj.lang.ProceedingJoinPoint;
@@ -12,23 +13,25 @@
1213
/**
1314
* create by lorne on 2018/1/5
1415
*/
15-
16-
1716
@Aspect
1817
@Component
1918
@Slf4j
2019
public class DataSourceAspect implements Ordered {
2120

22-
@Autowired
23-
private TxClientConfig txClientConfig;
21+
private final TxClientConfig txClientConfig;
22+
23+
private final DTXResourceWeaver dtxResourceWeaver;
2424

2525
@Autowired
26-
private com.codingapi.tx.client.aspect.weave.DTXResourceWeaver DTXResourceWeaver;
26+
public DataSourceAspect(TxClientConfig txClientConfig, DTXResourceWeaver dtxResourceWeaver) {
27+
this.txClientConfig = txClientConfig;
28+
this.dtxResourceWeaver = dtxResourceWeaver;
29+
}
2730

2831

2932
@Around("execution(* javax.sql.DataSource.getConnection(..))")
3033
public Object around(ProceedingJoinPoint point) throws Throwable {
31-
return DTXResourceWeaver.around(point);
34+
return dtxResourceWeaver.around(point);
3235
}
3336

3437

0 commit comments

Comments
 (0)