Bladeren bron

:recycle: 重构代码。重写LCN 部分代码。

冷冷 7 jaren geleden
bovenliggende
commit
f4b25bbb2a
83 gewijzigde bestanden met toevoegingen van 253 en 679 verwijderingen
  1. 5 0
      pigx-common/pigx-common-core/src/main/java/com/pig4cloud/pigx/common/core/constant/ServiceNameConstant.java
  2. 23 0
      pigx-common/pigx-common-transaction/pom.xml
  3. 3 6
      pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/TransactionConfiguration.java
  4. 18 22
      pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/ribbon/loadbalancer/LcnNoOpLoadBalancerProxy.java
  5. 48 0
      pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/rewrite/TxManagerTxUrlServiceImpl.java
  6. 0 111
      pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/ribbon/LcnLoadBalancerRule.java
  7. 0 51
      pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/ribbon/LcnNoOpLoadBalancerProxy.java
  8. 0 52
      pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/ribbon/LcnRibbonConfiguration.java
  9. 0 59
      pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/ribbon/LcnZoneAwareLoadBalancerProxy.java
  10. 0 111
      pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/ribbon/loadbalancer/LcnLoadBalancerRule.java
  11. 0 52
      pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/ribbon/loadbalancer/LcnRibbonConfiguration.java
  12. 0 59
      pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/ribbon/loadbalancer/LcnZoneAwareLoadBalancerProxy.java
  13. 1 1
      pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/RequestInterceptorConfiguration.java
  14. 1 1
      pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/springcloud/feign/TransactionRestTemplateInterceptor.java
  15. 1 1
      pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/springcloud/http/TransactionHttpRequestInterceptor.java
  16. 1 1
      pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/springcloud/interceptor/TransactionAspect.java
  17. 1 1
      pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/springcloud/interceptor/TxManagerInterceptor.java
  18. 1 1
      pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/springcloud/service/impl/ModelNameServiceImpl.java
  19. 1 1
      pigx-common/pigx-common-transaction/src/main/resources/META-INF/spring.factories
  20. 6 0
      pigx-upms/pigx-upms-biz/pom.xml
  21. 5 5
      pigx-visual/pigx-tx-manager/pom.xml
  22. 5 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/PigxTxManagerApplication.java
  23. 8 8
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/api/controller/AdminController.java
  24. 7 6
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/api/controller/TxManagerController.java
  25. 2 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/api/service/ApiAdminService.java
  26. 2 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/api/service/ApiModelService.java
  27. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/api/service/ApiTxManagerService.java
  28. 9 12
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/api/service/impl/ApiAdminServiceImpl.java
  29. 2 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/api/service/impl/ApiModelServiceImpl.java
  30. 11 14
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/api/service/impl/ApiTxManagerServiceImpl.java
  31. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/compensate/dao/CompensateDao.java
  32. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/compensate/dao/impl/CompensateDaoImpl.java
  33. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/compensate/model/TransactionCompensateMsg.java
  34. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/compensate/model/TxModel.java
  35. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/compensate/service/CompensateService.java
  36. 10 9
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/compensate/service/impl/CompensateServiceImpl.java
  37. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/config/ConfigReader.java
  38. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/config/CorsConfig.java
  39. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/config/RestConfig.java
  40. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/framework/utils/Constants.java
  41. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/framework/utils/SocketManager.java
  42. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/framework/utils/SocketUtils.java
  43. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/listener/ApplicationStartListener.java
  44. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/listener/ServerListener.java
  45. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/listener/service/InitService.java
  46. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/listener/service/impl/InitServiceImpl.java
  47. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/manager/ModelInfoManager.java
  48. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/manager/service/LoadBalanceService.java
  49. 2 2
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/manager/service/MicroService.java
  50. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/manager/service/TxManagerSenderService.java
  51. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/manager/service/TxManagerService.java
  52. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/manager/service/impl/LoadBalanceServiceImpl.java
  53. 2 2
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/manager/service/impl/MicroServiceImpl.java
  54. 25 36
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/manager/service/impl/TxManagerSenderServiceImpl.java
  55. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/manager/service/impl/TxManagerServiceImpl.java
  56. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/model/ChannelSender.java
  57. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/model/LoadBalanceInfo.java
  58. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/model/ModelInfo.java
  59. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/model/ModelName.java
  60. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/model/TxServer.java
  61. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/model/TxState.java
  62. 3 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/handler/TxCoreServerHandler.java
  63. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/model/TxGroup.java
  64. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/model/TxInfo.java
  65. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/service/IActionService.java
  66. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/service/NettyServerService.java
  67. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/service/NettyService.java
  68. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/service/impl/ActionATGServiceImpl.java
  69. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/service/impl/ActionCGServiceImpl.java
  70. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/service/impl/ActionCKGServiceImpl.java
  71. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/service/impl/ActionCServiceImpl.java
  72. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/service/impl/ActionCTGServiceImpl.java
  73. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/service/impl/ActionGLBServiceImpl.java
  74. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/service/impl/ActionHServiceImpl.java
  75. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/service/impl/ActionPLBServiceImpl.java
  76. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/service/impl/ActionRGServiceImpl.java
  77. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/service/impl/ActionTServiceImpl.java
  78. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/service/impl/ActionUMIServiceImpl.java
  79. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/service/impl/BaseSignalTaskService.java
  80. 2 2
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/service/impl/NettyServerServiceImpl.java
  81. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/service/impl/NettyServiceImpl.java
  82. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/redis/RedisServerService.java
  83. 1 1
      pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/redis/impl/RedisServerServiceImpl.java

+ 5 - 0
pigx-common/pigx-common-core/src/main/java/com/pig4cloud/pigx/common/core/constant/ServiceNameConstant.java

@@ -34,4 +34,9 @@ public interface ServiceNameConstant {
 	 * UMPS模块
 	 */
 	String UMPS_SERVICE = "pigx-upms";
+
+	/**
+	 * 分布式事务协调服务
+	 */
+	String  TX_MANAGER = "pigx-tx-manager";
 }

+ 23 - 0
pigx-common/pigx-common-transaction/pom.xml

@@ -15,16 +15,39 @@
 	<description>pigx lcn transaction</description>
 
 	<dependencies>
+		<dependency>
+			<groupId>com.pig4cloud</groupId>
+			<artifactId>pigx-common-core</artifactId>
+			<version>${pigx.version}</version>
+		</dependency>
 		<!--lcn 模块端控制依赖-->
 		<dependency>
 			<groupId>com.codingapi</groupId>
 			<artifactId>tx-client</artifactId>
 			<version>${lcn.version}</version>
+			<exclusions>
+				<exclusion>
+					<groupId>org.slf4j</groupId>
+					<artifactId>*</artifactId>
+				</exclusion>
+			</exclusions>
+		</dependency>
+		<dependency>
+			<groupId>com.codingapi</groupId>
+			<artifactId>tx-plugins-db</artifactId>
+			<version>${lcn.version}</version>
+			<exclusions>
+				<exclusion>
+					<groupId>org.slf4j</groupId>
+					<artifactId>*</artifactId>
+				</exclusion>
+			</exclusions>
 		</dependency>
 		<!--feign 依赖-->
 		<dependency>
 			<groupId>org.springframework.cloud</groupId>
 			<artifactId>spring-cloud-starter-openfeign</artifactId>
 		</dependency>
+
 	</dependencies>
 </project>

+ 3 - 6
pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/TransactionConfiguration.java

@@ -15,23 +15,20 @@
  * Author: lengleng (wangiegie@gmail.com)
  */
 
-package com.pig4cloud.pigx.common.transaction.tx;
+package com.pig4cloud.pigx.common.transaction;
 
-import com.pig4cloud.pigx.common.transaction.ribbon.loadbalancer.LcnRibbonConfiguration;
-import org.springframework.cloud.netflix.ribbon.RibbonClients;
 import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.Configuration;
 
 /**
- * Created by lorne on 2017/6/26.
+ *@author LCN on 2017/6/26.
  *
  * @author LCN
  * @since 4.1.0
  */
 
 @Configuration
-@ComponentScan
-@RibbonClients(defaultConfiguration = LcnRibbonConfiguration.class)
+@ComponentScan({"com.codingapi.tx", "com.pig4cloud.pigx.common.transaction"})
 public class TransactionConfiguration {
 
 

+ 18 - 22
pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/ribbon/loadbalancer/LcnNoOpLoadBalancerProxy.java

@@ -15,37 +15,33 @@
  * Author: lengleng (wangiegie@gmail.com)
  */
 
-package com.pig4cloud.pigx.common.transaction.ribbon.loadbalancer;
+package com.pig4cloud.pigx.common.transaction.rewrite;
 
-import com.netflix.loadbalancer.NoOpLoadBalancer;
-import com.netflix.loadbalancer.Server;
+import com.codingapi.tx.netty.service.TxManagerHttpRequestService;
+import com.lorne.core.framework.utils.http.HttpUtils;
 import lombok.extern.slf4j.Slf4j;
-
-import java.util.ArrayList;
-import java.util.List;
+import org.springframework.stereotype.Service;
 
 /**
- * created by foxdd 2017-12-05
- *
- * @author LCN
- * @since 4.1.0
+ * @author lengleng
+ * @date 2018/8/19
+ * 请求tx-manager接口实现
  */
 @Slf4j
-public class LcnNoOpLoadBalancerProxy extends NoOpLoadBalancer {
+@Service
+public class TxManagerHttpRequestServiceImpl implements TxManagerHttpRequestService {
 
-	private LcnLoadBalancerRule lcnLoadBalancerRule = new LcnLoadBalancerRule();
-
-	public LcnNoOpLoadBalancerProxy() {
-		super();
+	@Override
+	public String httpGet(String url) {
+		String res = HttpUtils.get(url);
+		log.debug("请求接口 {},响应报文:{}", url, res);
+		return res;
 	}
 
 	@Override
-	public Server chooseServer(Object key) {
-		log.debug("enter chooseServer method, key:" + key);
-
-		List<Server> serverList = new ArrayList<Server>();
-		return lcnLoadBalancerRule.proxy(serverList, super.chooseServer(key));
-
+	public String httpPost(String url, String params) {
+		String res = HttpUtils.post(url, params);
+		log.debug("请求接口 {},响应报文:{}", url, res);
+		return res;
 	}
-
 }

+ 48 - 0
pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/rewrite/TxManagerTxUrlServiceImpl.java

@@ -0,0 +1,48 @@
+/*
+ *    Copyright (c) 2018-2025, lengleng All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the pig4cloud.com developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: lengleng (wangiegie@gmail.com)
+ */
+
+package com.pig4cloud.pigx.common.transaction.rewrite;
+
+import com.codingapi.tx.config.service.TxManagerTxUrlService;
+import com.pig4cloud.pigx.common.core.constant.ServiceNameConstant;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.cloud.client.ServiceInstance;
+import org.springframework.cloud.client.loadbalancer.LoadBalancerClient;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author lengleng
+ * @date 2018/8/19
+ * 使用服务发现重写 Txmanager 获取规则
+ */
+@Slf4j
+@Service
+@AllArgsConstructor
+public class TxManagerTxUrlServiceImpl implements TxManagerTxUrlService {
+	private final LoadBalancerClient loadBalancerClient;
+
+	@Override
+	public String getTxUrl() {
+		ServiceInstance serviceInstance = loadBalancerClient.choose(ServiceNameConstant.TX_MANAGER);
+		String host = serviceInstance.getHost();
+		Integer port = serviceInstance.getPort();
+		String url = String.format("http://%s:%s/tx/manager/", host, port);
+		log.info("tm.manager.url -> {}", url);
+		return url;
+	}
+}

+ 0 - 111
pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/ribbon/LcnLoadBalancerRule.java

@@ -1,111 +0,0 @@
-/*
- *    Copyright (c) 2018-2025, lengleng All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * Neither the name of the pig4cloud.com developer nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * Author: lengleng (wangiegie@gmail.com)
- */
-
-package com.pig4cloud.pigx.common.transaction.ribbon;
-
-
-import com.codingapi.tx.aop.bean.TxTransactionLocal;
-import com.lorne.core.framework.utils.encode.MD5Util;
-import com.netflix.loadbalancer.Server;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang.StringUtils;
-
-import java.util.List;
-
-/**
- * created by foxdd 2017-12-05
- *
- * @author LCN
- * @since 4.1.0
- */
-@Slf4j
-public class LcnLoadBalancerRule {
-
-	public Server proxy(List<Server> servers, Server server) {
-
-		TxTransactionLocal txTransactionLocal = TxTransactionLocal.current();
-		if (txTransactionLocal == null) {
-			return server;
-		}
-
-		try {
-			log.debug("LCNBalanceProxy - > start");
-
-			String groupId = txTransactionLocal.getGroupId();
-
-			//取出组件的appName
-			String appName = server.getMetaInfo().getAppName();
-
-
-			String key = MD5Util.md5((groupId + "_" + appName).getBytes());
-
-			//如果只有一个可调用模块,则用当前的,且需要将数据记录到redis中
-			if (servers.size() == 1) {
-				putServer(key, txTransactionLocal, server);
-				log.debug("LCNBalanceProxy -> only one server available");
-				return server;
-			}
-
-			Server oldServer = getServer(txTransactionLocal, servers, key);
-			if (oldServer != null) {
-				log.debug("LCNBalanceProxy - > load old server ");
-				return server;
-			}
-
-			putServer(key, txTransactionLocal, server);
-			log.debug("LCNBalanceProxy - > load new server ");
-
-			return server;
-		} finally {
-			log.debug("LCNBalanceProxy - > end");
-		}
-	}
-
-
-	private void putServer(String key, TxTransactionLocal txTransactionLocal, Server server) {
-		String serviceName = server.getMetaInfo().getAppName();
-		String address = server.getHostPort();
-
-		String md5 = MD5Util.md5((address + serviceName).getBytes());
-
-		log.debug("putServer->address->" + address + ",md5-->" + md5);
-
-		txTransactionLocal.putLoadBalance(key, md5);
-	}
-
-
-	private Server getServer(TxTransactionLocal txTransactionLocal, List<Server> servers, String key) {
-		String val = txTransactionLocal.getLoadBalance(key);
-		if (StringUtils.isEmpty(val)) {
-			return null;
-		}
-		for (Server server : servers) {
-			String serviceName = server.getMetaInfo().getAppName();
-			String address = server.getHostPort();
-
-			String md5 = MD5Util.md5((address + serviceName).getBytes());
-
-			log.debug("getServer->address->" + address + ",md5-->" + md5);
-
-			if (val.equals(md5)) {
-				return server;
-			}
-		}
-		return null;
-	}
-
-}

+ 0 - 51
pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/ribbon/LcnNoOpLoadBalancerProxy.java

@@ -1,51 +0,0 @@
-/*
- *    Copyright (c) 2018-2025, lengleng All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * Neither the name of the pig4cloud.com developer nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * Author: lengleng (wangiegie@gmail.com)
- */
-
-package com.pig4cloud.pigx.common.transaction.ribbon;
-
-import com.netflix.loadbalancer.NoOpLoadBalancer;
-import com.netflix.loadbalancer.Server;
-import lombok.extern.slf4j.Slf4j;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * created by foxdd 2017-12-05
- *
- * @author LCN
- * @since 4.1.0
- */
-@Slf4j
-public class LcnNoOpLoadBalancerProxy extends NoOpLoadBalancer {
-
-	private LcnLoadBalancerRule lcnLoadBalancerRule = new LcnLoadBalancerRule();
-
-	public LcnNoOpLoadBalancerProxy() {
-		super();
-	}
-
-	@Override
-	public Server chooseServer(Object key) {
-		log.debug("enter chooseServer method, key:" + key);
-
-		List<Server> serverList = new ArrayList<Server>();
-		return lcnLoadBalancerRule.proxy(serverList, super.chooseServer(key));
-
-	}
-
-}

+ 0 - 52
pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/ribbon/LcnRibbonConfiguration.java

@@ -1,52 +0,0 @@
-/*
- *    Copyright (c) 2018-2025, lengleng All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * Neither the name of the pig4cloud.com developer nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * Author: lengleng (wangiegie@gmail.com)
- */
-
-package com.pig4cloud.pigx.common.transaction.ribbon;
-
-import com.netflix.client.config.IClientConfig;
-import com.netflix.loadbalancer.*;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-/**
- * @author LCN
- * @since 4.1.0
- */
-@Configuration
-public class LcnRibbonConfiguration {
-
-	/**
-	 * 为ribbon的loadbalancer做代理,相比于重写IRULE,重写loadbalancer更有利于用户自选LB算法,而且有默认LB算法可用
-	 *
-	 * @param config
-	 * @param serverList
-	 * @param serverListFilter
-	 * @param rule
-	 * @param ping
-	 * @param serverListUpdater
-	 * @return
-	 */
-	@Bean
-	public ILoadBalancer ribbonLoadBalancer(IClientConfig config,
-											ServerList<Server> serverList, ServerListFilter<Server> serverListFilter,
-											IRule rule, IPing ping, ServerListUpdater serverListUpdater) {
-		return new LcnZoneAwareLoadBalancerProxy(config, rule, ping, serverList,
-			serverListFilter, serverListUpdater);
-	}
-
-
-}

+ 0 - 59
pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/ribbon/LcnZoneAwareLoadBalancerProxy.java

@@ -1,59 +0,0 @@
-/*
- *    Copyright (c) 2018-2025, lengleng All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * Neither the name of the pig4cloud.com developer nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * Author: lengleng (wangiegie@gmail.com)
- */
-
-package com.pig4cloud.pigx.common.transaction.ribbon;
-
-import com.netflix.client.config.IClientConfig;
-import com.netflix.loadbalancer.*;
-import lombok.extern.slf4j.Slf4j;
-
-import java.util.List;
-
-/**
- * created by foxdd 2017-12-05
- *
- * @author LCN
- * @since 4.1.0
- */
-@Slf4j
-public class LcnZoneAwareLoadBalancerProxy extends ZoneAwareLoadBalancer<Server> {
-
-	LcnLoadBalancerRule lcnLoadBalancerRule = new LcnLoadBalancerRule();
-
-	public LcnZoneAwareLoadBalancerProxy(IClientConfig clientConfig, IRule rule,
-										 IPing ping, ServerList<Server> serverList, ServerListFilter<Server> filter,
-										 ServerListUpdater serverListUpdater) {
-		super(clientConfig, rule, ping, serverList, filter, serverListUpdater);
-	}
-
-	@Override
-	public Server chooseServer(Object key) {
-		log.info("enter chooseServer method, key:" + key);
-		//利用Dynamic负载类中的方法,可以在运行时更新服务实例清单
-		List<Server> serverList;
-		//获取处理之后的serverlist
-		serverList = super.getServerListImpl().getUpdatedListOfServers();
-		//获取过滤之后的serverlist
-		serverList = super.getFilter().getFilteredListOfServers(serverList);
-		if (null == serverList || serverList.isEmpty()) {
-			return super.chooseServer(key);
-		}
-		return lcnLoadBalancerRule.proxy(serverList, super.chooseServer(key));
-
-	}
-
-}

+ 0 - 111
pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/ribbon/loadbalancer/LcnLoadBalancerRule.java

@@ -1,111 +0,0 @@
-/*
- *    Copyright (c) 2018-2025, lengleng All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * Neither the name of the pig4cloud.com developer nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * Author: lengleng (wangiegie@gmail.com)
- */
-
-package com.pig4cloud.pigx.common.transaction.ribbon.loadbalancer;
-
-
-import com.codingapi.tx.aop.bean.TxTransactionLocal;
-import com.lorne.core.framework.utils.encode.MD5Util;
-import com.netflix.loadbalancer.Server;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang.StringUtils;
-
-import java.util.List;
-
-/**
- * created by foxdd 2017-12-05
- *
- * @author LCN
- * @since 4.1.0
- */
-@Slf4j
-public class LcnLoadBalancerRule {
-
-	public Server proxy(List<Server> servers, Server server) {
-
-		TxTransactionLocal txTransactionLocal = TxTransactionLocal.current();
-		if (txTransactionLocal == null) {
-			return server;
-		}
-
-		try {
-			log.debug("LCNBalanceProxy - > start");
-
-			String groupId = txTransactionLocal.getGroupId();
-
-			//取出组件的appName
-			String appName = server.getMetaInfo().getAppName();
-
-
-			String key = MD5Util.md5((groupId + "_" + appName).getBytes());
-
-			//如果只有一个可调用模块,则用当前的,且需要将数据记录到redis中
-			if (servers.size() == 1) {
-				putServer(key, txTransactionLocal, server);
-				log.debug("LCNBalanceProxy -> only one server available");
-				return server;
-			}
-
-			Server oldServer = getServer(txTransactionLocal, servers, key);
-			if (oldServer != null) {
-				log.debug("LCNBalanceProxy - > load old server ");
-				return server;
-			}
-
-			putServer(key, txTransactionLocal, server);
-			log.debug("LCNBalanceProxy - > load new server ");
-
-			return server;
-		} finally {
-			log.debug("LCNBalanceProxy - > end");
-		}
-	}
-
-
-	private void putServer(String key, TxTransactionLocal txTransactionLocal, Server server) {
-		String serviceName = server.getMetaInfo().getAppName();
-		String address = server.getHostPort();
-
-		String md5 = MD5Util.md5((address + serviceName).getBytes());
-
-		log.debug("putServer->address->" + address + ",md5-->" + md5);
-
-		txTransactionLocal.putLoadBalance(key, md5);
-	}
-
-
-	private Server getServer(TxTransactionLocal txTransactionLocal, List<Server> servers, String key) {
-		String val = txTransactionLocal.getLoadBalance(key);
-		if (StringUtils.isEmpty(val)) {
-			return null;
-		}
-		for (Server server : servers) {
-			String serviceName = server.getMetaInfo().getAppName();
-			String address = server.getHostPort();
-
-			String md5 = MD5Util.md5((address + serviceName).getBytes());
-
-			log.debug("getServer->address->" + address + ",md5-->" + md5);
-
-			if (val.equals(md5)) {
-				return server;
-			}
-		}
-		return null;
-	}
-
-}

+ 0 - 52
pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/ribbon/loadbalancer/LcnRibbonConfiguration.java

@@ -1,52 +0,0 @@
-/*
- *    Copyright (c) 2018-2025, lengleng All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * Neither the name of the pig4cloud.com developer nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * Author: lengleng (wangiegie@gmail.com)
- */
-
-package com.pig4cloud.pigx.common.transaction.ribbon.loadbalancer;
-
-import com.netflix.client.config.IClientConfig;
-import com.netflix.loadbalancer.*;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-/**
- * @author LCN
- * @since 4.1.0
- */
-@Configuration
-public class LcnRibbonConfiguration {
-
-	/**
-	 * 为ribbon的loadbalancer做代理,相比于重写IRULE,重写loadbalancer更有利于用户自选LB算法,而且有默认LB算法可用
-	 *
-	 * @param config
-	 * @param serverList
-	 * @param serverListFilter
-	 * @param rule
-	 * @param ping
-	 * @param serverListUpdater
-	 * @return
-	 */
-	@Bean
-	public ILoadBalancer ribbonLoadBalancer(IClientConfig config,
-											ServerList<Server> serverList, ServerListFilter<Server> serverListFilter,
-											IRule rule, IPing ping, ServerListUpdater serverListUpdater) {
-		return new LcnZoneAwareLoadBalancerProxy(config, rule, ping, serverList,
-			serverListFilter, serverListUpdater);
-	}
-
-
-}

+ 0 - 59
pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/ribbon/loadbalancer/LcnZoneAwareLoadBalancerProxy.java

@@ -1,59 +0,0 @@
-/*
- *    Copyright (c) 2018-2025, lengleng All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * Neither the name of the pig4cloud.com developer nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * Author: lengleng (wangiegie@gmail.com)
- */
-
-package com.pig4cloud.pigx.common.transaction.ribbon.loadbalancer;
-
-import com.netflix.client.config.IClientConfig;
-import com.netflix.loadbalancer.*;
-import lombok.extern.slf4j.Slf4j;
-
-import java.util.List;
-
-/**
- * created by foxdd 2017-12-05
- *
- * @author LCN
- * @since 4.1.0
- */
-@Slf4j
-public class LcnZoneAwareLoadBalancerProxy extends ZoneAwareLoadBalancer<Server> {
-
-	LcnLoadBalancerRule lcnLoadBalancerRule = new LcnLoadBalancerRule();
-
-	public LcnZoneAwareLoadBalancerProxy(IClientConfig clientConfig, IRule rule,
-										 IPing ping, ServerList<Server> serverList, ServerListFilter<Server> filter,
-										 ServerListUpdater serverListUpdater) {
-		super(clientConfig, rule, ping, serverList, filter, serverListUpdater);
-	}
-
-	@Override
-	public Server chooseServer(Object key) {
-		log.info("enter chooseServer method, key:" + key);
-		//利用Dynamic负载类中的方法,可以在运行时更新服务实例清单
-		List<Server> serverList;
-		//获取处理之后的serverlist
-		serverList = super.getServerListImpl().getUpdatedListOfServers();
-		//获取过滤之后的serverlist
-		serverList = super.getFilter().getFilteredListOfServers(serverList);
-		if (null == serverList || serverList.isEmpty()) {
-			return super.chooseServer(key);
-		}
-		return lcnLoadBalancerRule.proxy(serverList, super.chooseServer(key));
-
-	}
-
-}

+ 1 - 1
pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/RequestInterceptorConfiguration.java

@@ -23,7 +23,7 @@ import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 
 /**
- * create by lorne on 2018/1/18
+ * @author LCN on 2018/1/18
  *
  * @author LCN
  * @since 4.1.0

+ 1 - 1
pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/springcloud/feign/TransactionRestTemplateInterceptor.java

@@ -25,7 +25,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Created by lorne on 2017/6/26.
+ *@author LCN on 2017/6/26.
  *
  * @author LCN
  * @since 4.1.0

+ 1 - 1
pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/springcloud/http/TransactionHttpRequestInterceptor.java

@@ -27,7 +27,7 @@ import org.springframework.http.client.ClientHttpResponse;
 import java.io.IOException;
 
 /**
- * Created by lorne on 2017/7/3.
+ *@author LCN on 2017/7/3.
  *
  * @author LCN
  * @since 4.1.0

+ 1 - 1
pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/springcloud/interceptor/TransactionAspect.java

@@ -27,7 +27,7 @@ import org.springframework.stereotype.Component;
 
 /**
  * LCN 事务拦截器
- * create by lorne on 2018/1/5
+ * @author LCN on 2018/1/5
  *
  * @author LCN
  * @since 4.1.0

+ 1 - 1
pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/springcloud/interceptor/TxManagerInterceptor.java

@@ -28,7 +28,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
 import javax.servlet.http.HttpServletRequest;
 
 /**
- * Created by lorne on 2017/6/7.
+ *@author LCN on 2017/6/7.
  *
  * @author LCN
  * @since 4.1.0

+ 1 - 1
pigx-common/pigx-common-transaction/src/main/java/com/pig4cloud/pigx/common/transaction/tx/springcloud/service/impl/ModelNameServiceImpl.java

@@ -29,7 +29,7 @@ import java.net.InetAddress;
 import java.net.UnknownHostException;
 
 /**
- * Created by lorne on 2017/7/12.
+ *@author LCN on 2017/7/12.
  *
  * @author LCN
  * @since 4.1.0

+ 1 - 1
pigx-common/pigx-common-transaction/src/main/resources/META-INF/spring.factories

@@ -1 +1 @@
-org.springframework.boot.autoconfigure.EnableAutoConfiguration=com.pig4cloud.pigx.common.transaction.tx.TransactionConfiguration
+org.springframework.boot.autoconfigure.EnableAutoConfiguration=com.pig4cloud.pigx.common.transaction.TransactionConfiguration

+ 6 - 0
pigx-upms/pigx-upms-biz/pom.xml

@@ -102,6 +102,12 @@
 			<groupId>org.springframework.boot</groupId>
 			<artifactId>spring-boot-starter-undertow</artifactId>
 		</dependency>
+		<!--分布式事务依赖-->
+		<dependency>
+			<groupId>com.pig4cloud</groupId>
+			<artifactId>pigx-common-transaction</artifactId>
+			<version>${pigx.version}</version>
+		</dependency>
 	</dependencies>
 
 	<build>

+ 5 - 5
pigx-visual/pigx-tx-manager/pom.xml

@@ -33,6 +33,11 @@
 			<groupId>org.springframework.boot</groupId>
 			<artifactId>spring-boot-starter-undertow</artifactId>
 		</dependency>
+		<!--eureka-->
+		<dependency>
+			<groupId>org.springframework.cloud</groupId>
+			<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
+		</dependency>
 		<!--配置中心客户端-->
 		<dependency>
 			<groupId>org.springframework.cloud</groupId>
@@ -56,11 +61,6 @@
 			<artifactId>netty-all</artifactId>
 			<version>4.1.12.Final</version>
 		</dependency>
-		<!--eureka-->
-		<dependency>
-			<groupId>org.springframework.cloud</groupId>
-			<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
-		</dependency>
 		<!--工具类核心包-->
 		<dependency>
 			<groupId>com.pig4cloud</groupId>

+ 5 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/PigxTxManagerApplication.java

@@ -21,7 +21,11 @@ import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 
-
+/**
+ * @author LCN
+ * @author lengleng
+ * tx-manager ,进行了代码逻辑和代码规范重构
+ */
 @SpringBootApplication
 @EnableDiscoveryClient
 public class PigxTxManagerApplication {

+ 8 - 8
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/api/controller/AdminController.java

@@ -24,7 +24,7 @@ import com.pig4cloud.pigx.manager.compensate.model.TxModel;
 import com.pig4cloud.pigx.manager.model.ModelInfo;
 import com.pig4cloud.pigx.manager.model.ModelName;
 import com.pig4cloud.pigx.manager.model.TxState;
-import org.springframework.beans.factory.annotation.Autowired;
+import lombok.AllArgsConstructor;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
@@ -33,17 +33,17 @@ import org.springframework.web.bind.annotation.RestController;
 import java.util.List;
 
 /**
- * Created by lorne on 2017/7/1.
+ *@author LCN on 2017/7/1.
+ *
+ * @author LCN
+ * @author lengleng
  */
 @RestController
+@AllArgsConstructor
 @RequestMapping("/admin")
 public class AdminController {
-
-	@Autowired
-	private ApiAdminService apiAdminService;
-
-	@Autowired
-	private ApiModelService apiModelService;
+	private final ApiAdminService apiAdminService;
+	private final ApiModelService apiModelService;
 
 
 	@RequestMapping(value = "/onlines", method = RequestMethod.GET)

+ 7 - 6
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/api/controller/TxManagerController.java

@@ -20,21 +20,22 @@ package com.pig4cloud.pigx.manager.api.controller;
 import com.pig4cloud.pigx.manager.api.service.ApiTxManagerService;
 import com.pig4cloud.pigx.manager.model.TxServer;
 import com.pig4cloud.pigx.manager.model.TxState;
-import org.springframework.beans.factory.annotation.Autowired;
+import lombok.AllArgsConstructor;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 /**
- * Created by lorne on 2017/7/1.
+ *@author LCN on 2017/7/1.
+ *
+ * @author LCN
+ * @author lengleng
  */
 @RestController
+@AllArgsConstructor
 @RequestMapping("/tx/manager")
 public class TxManagerController {
-
-	@Autowired
-	private ApiTxManagerService apiTxManagerService;
-
+	private final ApiTxManagerService apiTxManagerService;
 
 	@RequestMapping("/getServer")
 	public TxServer getServer() {

+ 2 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/api/service/ApiAdminService.java

@@ -25,7 +25,8 @@ import com.pig4cloud.pigx.manager.model.TxState;
 import java.util.List;
 
 /**
- * create by lorne on 2017/11/12
+ * @author LCN on 2017/11/12
+ * @author LCN
  */
 public interface ApiAdminService {
 

+ 2 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/api/service/ApiModelService.java

@@ -22,7 +22,8 @@ import com.pig4cloud.pigx.manager.model.ModelInfo;
 import java.util.List;
 
 /**
- * create by lorne on 2017/11/13
+ * @author LCN on 2017/11/13
+ * @author LCN
  */
 public interface ApiModelService {
 

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/api/service/ApiTxManagerService.java

@@ -21,7 +21,7 @@ import com.pig4cloud.pigx.manager.model.TxServer;
 import com.pig4cloud.pigx.manager.model.TxState;
 
 /**
- * Created by lorne on 2017/7/1.
+ *@author LCN on 2017/7/1.
  */
 public interface ApiTxManagerService {
 

+ 9 - 12
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/api/service/impl/ApiAdminServiceImpl.java

@@ -26,26 +26,23 @@ import com.pig4cloud.pigx.manager.manager.service.MicroService;
 import com.pig4cloud.pigx.manager.model.ModelName;
 import com.pig4cloud.pigx.manager.model.TxState;
 import com.pig4cloud.pigx.manager.redis.RedisServerService;
-import org.springframework.beans.factory.annotation.Autowired;
+import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
 
 /**
- * create by lorne on 2017/11/12
+ * @author LCN on 2017/11/12
+ *
+ * @author LCN
+ * @author lengleng
  */
 @Service
+@AllArgsConstructor
 public class ApiAdminServiceImpl implements ApiAdminService {
-
-
-	@Autowired
-	private MicroService eurekaService;
-
-	@Autowired
-	private RedisServerService redisServerService;
-
-	@Autowired
-	private CompensateService compensateService;
+	private final MicroService eurekaService;
+	private final RedisServerService redisServerService;
+	private final CompensateService compensateService;
 
 	@Override
 	public TxState getState() {

+ 2 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/api/service/impl/ApiModelServiceImpl.java

@@ -25,7 +25,8 @@ import org.springframework.stereotype.Service;
 import java.util.List;
 
 /**
- * create by lorne on 2017/11/13
+ * @author LCN on 2017/11/13
+ * @author LCN
  */
 @Service
 public class ApiModelServiceImpl implements ApiModelService {

+ 11 - 14
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/api/service/impl/ApiTxManagerServiceImpl.java

@@ -27,31 +27,28 @@ import com.pig4cloud.pigx.manager.manager.service.TxManagerSenderService;
 import com.pig4cloud.pigx.manager.manager.service.TxManagerService;
 import com.pig4cloud.pigx.manager.model.TxServer;
 import com.pig4cloud.pigx.manager.model.TxState;
-import org.springframework.beans.factory.annotation.Autowired;
+import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 
 /**
- * Created by lorne on 2017/7/1.
+ *@author LCN on 2017/7/1.
+ *
+ * @author LCN
+ * @author lengleng
  */
 @Service
+@AllArgsConstructor
 public class ApiTxManagerServiceImpl implements ApiTxManagerService {
 
+	private final TxManagerService managerService;
 
-	@Autowired
-	private TxManagerService managerService;
-
-	@Autowired
-	private MicroService eurekaService;
-
-	@Autowired
-	private CompensateService compensateService;
+	private final MicroService eurekaService;
 
+	private final CompensateService compensateService;
 
-	@Autowired
-	private TxManagerSenderService txManagerSenderService;
+	private final TxManagerSenderService txManagerSenderService;
 
-	@Autowired
-	private ConfigReader configReader;
+	private final ConfigReader configReader;
 
 
 	@Override

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/compensate/dao/CompensateDao.java

@@ -22,7 +22,7 @@ import com.pig4cloud.pigx.manager.compensate.model.TransactionCompensateMsg;
 import java.util.List;
 
 /**
- * create by lorne on 2017/11/11
+ * @author LCN on 2017/11/11
  */
 public interface CompensateDao {
 

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/compensate/dao/impl/CompensateDaoImpl.java

@@ -30,7 +30,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 /**
- * create by lorne on 2017/11/11
+ * @author LCN on 2017/11/11
  */
 @Service
 public class CompensateDaoImpl implements CompensateDao {

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/compensate/model/TransactionCompensateMsg.java

@@ -20,7 +20,7 @@ package com.pig4cloud.pigx.manager.compensate.model;
 import com.pig4cloud.pigx.manager.netty.model.TxGroup;
 
 /**
- * create by lorne on 2017/11/11
+ * @author LCN on 2017/11/11
  */
 public class TransactionCompensateMsg {
 

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/compensate/model/TxModel.java

@@ -18,7 +18,7 @@
 package com.pig4cloud.pigx.manager.compensate.model;
 
 /**
- * create by lorne on 2017/11/12
+ * @author LCN on 2017/11/12
  */
 public class TxModel {
 

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/compensate/service/CompensateService.java

@@ -26,7 +26,7 @@ import com.pig4cloud.pigx.manager.netty.model.TxGroup;
 import java.util.List;
 
 /**
- * create by lorne on 2017/11/11
+ * @author LCN on 2017/11/11
  */
 public interface CompensateService {
 

+ 10 - 9
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/compensate/service/impl/CompensateServiceImpl.java

@@ -47,12 +47,12 @@ import java.util.concurrent.Executor;
 import java.util.concurrent.Executors;
 
 /**
- * create by lorne on 2017/11/11
+ * @author LCN on 2017/11/11
  */
 @Service
 public class CompensateServiceImpl implements CompensateService {
-
-
+	private static final String SUCCESS = "success";
+	private static final String SUCCESS1 = "SUCCESS";
 	private Logger logger = LoggerFactory.getLogger(CompensateServiceImpl.class);
 
 	@Autowired
@@ -109,7 +109,7 @@ public class CompensateServiceImpl implements CompensateService {
 					logger.error("Compensate Callback Result->" + res);
 					if (configReader.isCompensateAuto()) {
 						//自动补偿,是否自动执行补偿
-						if (res.contains("success") || res.contains("SUCCESS")) {
+						if (res.contains(SUCCESS) || res.contains(SUCCESS1)) {
 							//自动补偿
 							autoCompensate(compensateKey, transactionCompensateMsg);
 						}
@@ -134,7 +134,7 @@ public class CompensateServiceImpl implements CompensateService {
 		boolean autoExecuteRes = false;
 		try {
 			int executeCount = 0;
-			autoExecuteRes = _executeCompensate(json);
+			autoExecuteRes = executeCompensate_(json);
 			logger.info("Automatic Compensate Result->" + autoExecuteRes + ",json->" + json);
 			while (!autoExecuteRes) {
 				logger.info("Compensate Failure, Entering Compensate Queue->" + autoExecuteRes + ",json->" + json);
@@ -148,7 +148,7 @@ public class CompensateServiceImpl implements CompensateService {
 				} catch (InterruptedException e) {
 					e.printStackTrace();
 				}
-				autoExecuteRes = _executeCompensate(json);
+				autoExecuteRes = executeCompensate_(json);
 			}
 
 			//执行成功删除数据
@@ -181,7 +181,7 @@ public class CompensateServiceImpl implements CompensateService {
 	public List<ModelName> loadModelList() {
 		List<String> keys = compensateDao.loadCompensateKeys();
 
-		Map<String, Integer> models = new HashMap<String, Integer>();
+		Map<String, Integer> models = new HashMap<>(16);
 
 		for (String key : keys) {
 			if (key.length() > 36) {
@@ -296,6 +296,7 @@ public class CompensateServiceImpl implements CompensateService {
 		logger.info("Compensate Loaded->" + JSON.toJSONString(txGroup));
 	}
 
+	@Override
 	public TxGroup getCompensateByGroupId(String groupId) {
 		String json = compensateDao.getCompensateByGroupId(groupId);
 		if (json == null) {
@@ -315,7 +316,7 @@ public class CompensateServiceImpl implements CompensateService {
 			throw new ServiceException("no data existing");
 		}
 
-		boolean hasOk = _executeCompensate(json);
+		boolean hasOk = executeCompensate_(json);
 		if (hasOk) {
 			// 删除本地补偿数据
 			compensateDao.deleteCompensateByPath(path);
@@ -326,7 +327,7 @@ public class CompensateServiceImpl implements CompensateService {
 	}
 
 
-	private boolean _executeCompensate(String json) throws ServiceException {
+	private boolean executeCompensate_(String json) throws ServiceException {
 		JSONObject jsonObject = JSON.parseObject(json);
 
 		String model = jsonObject.getString("model");

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/config/ConfigReader.java

@@ -21,7 +21,7 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 
 /**
- * create by lorne on 2017/11/11
+ * @author LCN on 2017/11/11
  */
 @Component
 public class ConfigReader {

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/config/CorsConfig.java

@@ -24,7 +24,7 @@ import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
 import org.springframework.web.filter.CorsFilter;
 
 /**
- * create by lorne on 2017/8/17
+ * @author LCN on 2017/8/17
  */
 @Configuration
 public class CorsConfig {

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/config/RestConfig.java

@@ -23,7 +23,7 @@ import org.springframework.context.annotation.Configuration;
 import org.springframework.web.client.RestTemplate;
 
 /**
- * Created by lorne on 2017/7/5.
+ *@author LCN on 2017/7/5.
  */
 
 @Configuration

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/framework/utils/Constants.java

@@ -18,7 +18,7 @@
 package com.pig4cloud.pigx.manager.framework.utils;
 
 /**
- * Created by lorne on 2017/6/8.
+ *@author LCN on 2017/6/8.
  */
 public class Constants {
 

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/framework/utils/SocketManager.java

@@ -25,7 +25,7 @@ import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.CopyOnWriteArrayList;
 
 /**
- * Created by lorne on 2017/6/30.
+ *@author LCN on 2017/6/30.
  */
 public class SocketManager {
 

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/framework/utils/SocketUtils.java

@@ -24,7 +24,7 @@ import io.netty.channel.ChannelHandlerContext;
 import io.netty.util.ReferenceCountUtil;
 
 /**
- * Created by lorne on 2017/7/6.
+ *@author LCN on 2017/7/6.
  */
 public class SocketUtils {
 

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/listener/ApplicationStartListener.java

@@ -26,7 +26,7 @@ import java.net.InetAddress;
 import java.net.UnknownHostException;
 
 /**
- * create by lorne on 2017/8/7
+ * @author LCN on 2017/8/7
  */
 @Component
 public class ApplicationStartListener implements ApplicationListener<WebServerInitializedEvent> {

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/listener/ServerListener.java

@@ -27,7 +27,7 @@ import javax.servlet.ServletContextListener;
 
 
 /**
- * Created by lorne on 2017/7/1.
+ *@author LCN on 2017/7/1.
  */
 
 @Component

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/listener/service/InitService.java

@@ -18,7 +18,7 @@
 package com.pig4cloud.pigx.manager.listener.service;
 
 /**
- * Created by lorne on 2017/7/4.
+ *@author LCN on 2017/7/4.
  */
 public interface InitService {
 

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/listener/service/impl/InitServiceImpl.java

@@ -26,7 +26,7 @@ import org.springframework.stereotype.Service;
 
 
 /**
- * Created by lorne on 2017/7/4.
+ *@author LCN on 2017/7/4.
  */
 @Service
 public class InitServiceImpl implements InitService {

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/manager/ModelInfoManager.java

@@ -23,7 +23,7 @@ import java.util.List;
 import java.util.concurrent.CopyOnWriteArrayList;
 
 /**
- * create by lorne on 2017/11/13
+ * @author LCN on 2017/11/13
  */
 public class ModelInfoManager {
 

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/manager/service/LoadBalanceService.java

@@ -20,7 +20,7 @@ package com.pig4cloud.pigx.manager.manager.service;
 import com.pig4cloud.pigx.manager.model.LoadBalanceInfo;
 
 /**
- * create by lorne on 2017/12/5
+ * @author LCN on 2017/12/5
  */
 public interface LoadBalanceService {
 

+ 2 - 2
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/manager/service/MicroService.java

@@ -21,11 +21,11 @@ import com.pig4cloud.pigx.manager.model.TxServer;
 import com.pig4cloud.pigx.manager.model.TxState;
 
 /**
- * create by lorne on 2017/11/11
+ * @author LCN on 2017/11/11
  */
 public interface MicroService {
 
-	String tmKey = "tx-manager";
+	String TMKEY = "tx-manager";
 
 	TxServer getServer();
 

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/manager/service/TxManagerSenderService.java

@@ -20,7 +20,7 @@ package com.pig4cloud.pigx.manager.manager.service;
 import com.pig4cloud.pigx.manager.netty.model.TxGroup;
 
 /**
- * Created by lorne on 2017/6/9.
+ *@author LCN on 2017/6/9.
  */
 public interface TxManagerSenderService {
 

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/manager/service/TxManagerService.java

@@ -20,7 +20,7 @@ package com.pig4cloud.pigx.manager.manager.service;
 import com.pig4cloud.pigx.manager.netty.model.TxGroup;
 
 /**
- * Created by lorne on 2017/6/7.
+ *@author LCN on 2017/6/7.
  */
 
 public interface TxManagerService {

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/manager/service/impl/LoadBalanceServiceImpl.java

@@ -25,7 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 /**
- * create by lorne on 2017/12/5
+ * @author LCN on 2017/12/5
  */
 @Service
 public class LoadBalanceServiceImpl implements LoadBalanceService {

+ 2 - 2
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/manager/service/impl/MicroServiceImpl.java

@@ -36,7 +36,7 @@ import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
 /**
- * create by lorne on 2017/11/11
+ * @author LCN on 2017/11/11
  */
 @Service
 public class MicroServiceImpl implements MicroService {
@@ -87,7 +87,7 @@ public class MicroServiceImpl implements MicroService {
 
 	private List<String> getServices() {
 		List<String> urls = new ArrayList<>();
-		List<ServiceInstance> serviceInstances = discoveryClient.getInstances(tmKey);
+		List<ServiceInstance> serviceInstances = discoveryClient.getInstances(TMKEY);
 		for (ServiceInstance instanceInfo : serviceInstances) {
 			urls.add(instanceInfo.getUri().toASCIIString());
 		}

+ 25 - 36
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/manager/service/impl/TxManagerSenderServiceImpl.java

@@ -48,7 +48,7 @@ import java.util.concurrent.*;
 
 
 /**
- * Created by lorne on 2017/6/9.
+ * @author LCN on 2017/6/9.
  */
 @Service
 public class TxManagerSenderServiceImpl implements TxManagerSenderService {
@@ -148,8 +148,8 @@ public class TxManagerSenderServiceImpl implements TxManagerSenderService {
 							final JSONObject jsonObject = new JSONObject();
 							jsonObject.put("a", "t");
 
-
-							if (txGroup.getIsCompensate() == 1) {   //补偿请求
+							//补偿请求
+							if (txGroup.getIsCompensate() == 1) {
 								jsonObject.put("c", txInfo.getIsCommit());
 							} else { //正常业务
 								jsonObject.put("c", checkSate);
@@ -246,21 +246,18 @@ public class TxManagerSenderServiceImpl implements TxManagerSenderService {
 		//创建Task
 		final Task task = ConditionUtils.getInstance().createTask(key);
 
-		threadPool.execute(new Runnable() {
-			@Override
-			public void run() {
-				while (!task.isAwait() && !Thread.currentThread().interrupted()) {
-					try {
-						Thread.sleep(1);
-					} catch (InterruptedException e) {
-						e.printStackTrace();
-					}
+		threadPool.execute(() -> {
+			while (!task.isAwait() && !Thread.interrupted()) {
+				try {
+					Thread.sleep(1);
+				} catch (InterruptedException e) {
+					e.printStackTrace();
 				}
+			}
 
-				Channel channel = SocketManager.getInstance().getChannelByModelName(model);
-				if (channel != null && channel.isActive()) {
-					SocketUtils.sendMsg(channel, msg);
-				}
+			Channel channel = SocketManager.getInstance().getChannelByModelName(model);
+			if (channel != null && channel.isActive()) {
+				SocketUtils.sendMsg(channel, msg);
 			}
 		});
 
@@ -283,28 +280,20 @@ public class TxManagerSenderServiceImpl implements TxManagerSenderService {
 
 
 	private void threadAwaitSend(final Task task, final TxInfo txInfo, final String msg) {
-		threadPool.execute(new Runnable() {
-			@Override
-			public void run() {
-				while (!task.isAwait() && !Thread.currentThread().interrupted()) {
-					try {
-						Thread.sleep(1);
-					} catch (InterruptedException e) {
-						e.printStackTrace();
-					}
+		threadPool.execute(() -> {
+			while (!task.isAwait() && !Thread.interrupted()) {
+				try {
+					Thread.sleep(1);
+				} catch (InterruptedException e) {
+					e.printStackTrace();
 				}
+			}
 
-				if (txInfo != null && txInfo.getChannel() != null) {
-					txInfo.getChannel().send(msg, task);
-				} else {
-					task.setBack(new IBack() {
-						@Override
-						public Object doing(Object... objs) throws Throwable {
-							return "-2";
-						}
-					});
-					task.signalTask();
-				}
+			if (txInfo != null && txInfo.getChannel() != null) {
+				txInfo.getChannel().send(msg, task);
+			} else {
+				task.setBack(objs -> "-2");
+				task.signalTask();
 			}
 		});
 

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/manager/service/impl/TxManagerServiceImpl.java

@@ -35,7 +35,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 /**
- * Created by lorne on 2017/6/7.
+ *@author LCN on 2017/6/7.
  */
 @Service
 public class TxManagerServiceImpl implements TxManagerService {

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/model/ChannelSender.java

@@ -25,7 +25,7 @@ import io.netty.channel.Channel;
 import org.apache.commons.lang.StringUtils;
 
 /**
- * create by lorne on 2017/8/7
+ * @author LCN on 2017/8/7
  */
 public class ChannelSender {
 

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/model/LoadBalanceInfo.java

@@ -19,7 +19,7 @@ package com.pig4cloud.pigx.manager.model;
 
 /**
  * 负载均衡模块信息
- * create by lorne on 2017/12/5
+ * @author LCN on 2017/12/5
  */
 public class LoadBalanceInfo {
 

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/model/ModelInfo.java

@@ -19,7 +19,7 @@ package com.pig4cloud.pigx.manager.model;
 
 /**
  * 模块信息
- * create by lorne on 2017/11/13
+ * @author LCN on 2017/11/13
  */
 public class ModelInfo {
 

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/model/ModelName.java

@@ -20,7 +20,7 @@
 package com.pig4cloud.pigx.manager.model;
 
 /**
- * create by lorne on 2017/11/22
+ * @author LCN on 2017/11/22
  */
 public class ModelName {
 

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/model/TxServer.java

@@ -18,7 +18,7 @@
 package com.pig4cloud.pigx.manager.model;
 
 /**
- * Created by lorne on 2017/7/1.
+ *@author LCN on 2017/7/1.
  */
 public class TxServer {
 

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/model/TxState.java

@@ -20,7 +20,7 @@ package com.pig4cloud.pigx.manager.model;
 import java.util.List;
 
 /**
- * Created by lorne on 2017/7/1.
+ *@author LCN on 2017/7/1.
  */
 public class TxState {
 

+ 3 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/handler/TxCoreServerHandler.java

@@ -18,7 +18,7 @@
 package com.pig4cloud.pigx.manager.netty.handler;
 
 /**
- * Created by lorne on 2017/6/29.
+ * @author LCN on 2017/6/29.
  */
 
 import com.alibaba.fastjson.JSONObject;
@@ -40,6 +40,8 @@ import java.util.concurrent.Executor;
 
 /**
  * Handles a server-side channel.
+ *
+ * @author lengleng
  */
 
 @ChannelHandler.Sharable

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/model/TxGroup.java

@@ -25,7 +25,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 /**
- * Created by lorne on 2017/6/7.
+ *@author LCN on 2017/6/7.
  */
 public class TxGroup {
 

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/model/TxInfo.java

@@ -22,7 +22,7 @@ import com.lorne.core.framework.model.JsonModel;
 import com.pig4cloud.pigx.manager.model.ChannelSender;
 
 /**
- * Created by lorne on 2017/6/7.
+ *@author LCN on 2017/6/7.
  */
 public class TxInfo extends JsonModel {
 

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/service/IActionService.java

@@ -20,7 +20,7 @@ package com.pig4cloud.pigx.manager.netty.service;
 import com.alibaba.fastjson.JSONObject;
 
 /**
- * create by lorne on 2017/11/11
+ * @author LCN on 2017/11/11
  */
 public interface IActionService {
 

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/service/NettyServerService.java

@@ -18,7 +18,7 @@
 package com.pig4cloud.pigx.manager.netty.service;
 
 /**
- * Created by lorne on 2017/6/30.
+ *@author LCN on 2017/6/30.
  */
 public interface NettyServerService {
 

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/service/NettyService.java

@@ -18,7 +18,7 @@
 package com.pig4cloud.pigx.manager.netty.service;
 
 /**
- * create by lorne on 2017/11/11
+ * @author LCN on 2017/11/11
  */
 public interface NettyService {
 

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/service/impl/ActionATGServiceImpl.java

@@ -26,7 +26,7 @@ import org.springframework.stereotype.Service;
 
 /**
  * 添加事务组
- * create by lorne on 2017/11/11
+ * @author LCN on 2017/11/11
  */
 @Service(value = "atg")
 public class ActionATGServiceImpl implements IActionService {

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/service/impl/ActionCGServiceImpl.java

@@ -26,7 +26,7 @@ import org.springframework.stereotype.Service;
 
 /**
  * 创建事务组
- * create by lorne on 2017/11/11
+ * @author LCN on 2017/11/11
  */
 @Service(value = "cg")
 public class ActionCGServiceImpl implements IActionService {

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/service/impl/ActionCKGServiceImpl.java

@@ -25,7 +25,7 @@ import org.springframework.stereotype.Service;
 
 /**
  * 检查事务组
- * create by lorne on 2017/11/11
+ * @author LCN on 2017/11/11
  */
 @Service(value = "ckg")
 public class ActionCKGServiceImpl implements IActionService {

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/service/impl/ActionCServiceImpl.java

@@ -22,7 +22,7 @@ import org.springframework.stereotype.Service;
 
 /**
  * 补偿回调
- * create by lorne on 2017/11/11
+ * @author LCN on 2017/11/11
  */
 @Service(value = "c")
 public class ActionCServiceImpl extends BaseSignalTaskService implements IActionService {

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/service/impl/ActionCTGServiceImpl.java

@@ -25,7 +25,7 @@ import org.springframework.stereotype.Service;
 
 /**
  * 关闭事务组
- * create by lorne on 2017/11/11
+ * @author LCN on 2017/11/11
  */
 @Service(value = "ctg")
 public class ActionCTGServiceImpl implements IActionService {

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/service/impl/ActionGLBServiceImpl.java

@@ -26,7 +26,7 @@ import org.springframework.stereotype.Service;
 
 /**
  * 获取负载模块信息
- * create by lorne on 2017/11/11
+ * @author LCN on 2017/11/11
  */
 @Service(value = "glb")
 public class ActionGLBServiceImpl implements IActionService {

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/service/impl/ActionHServiceImpl.java

@@ -25,7 +25,7 @@ import org.springframework.stereotype.Service;
 
 /**
  * 心跳包
- * create by lorne on 2017/11/11
+ * @author LCN on 2017/11/11
  */
 @Service(value = "h")
 public class ActionHServiceImpl implements IActionService {

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/service/impl/ActionPLBServiceImpl.java

@@ -26,7 +26,7 @@ import org.springframework.stereotype.Service;
 
 /**
  * 添加负载模块信息
- * create by lorne on 2017/11/11
+ * @author LCN on 2017/11/11
  */
 @Service(value = "plb")
 public class ActionPLBServiceImpl implements IActionService {

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/service/impl/ActionRGServiceImpl.java

@@ -25,7 +25,7 @@ import org.springframework.stereotype.Service;
 
 /**
  * 强制回滚事务组
- * create by lorne on 2017/11/11
+ * @author LCN on 2017/11/11
  */
 @Service(value = "rg")
 public class ActionRGServiceImpl implements IActionService {

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/service/impl/ActionTServiceImpl.java

@@ -22,7 +22,7 @@ import org.springframework.stereotype.Service;
 
 /**
  * 通知事务回调
- * create by lorne on 2017/11/11
+ * @author LCN on 2017/11/11
  */
 @Service(value = "t")
 public class ActionTServiceImpl extends BaseSignalTaskService implements IActionService {

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/service/impl/ActionUMIServiceImpl.java

@@ -26,7 +26,7 @@ import org.springframework.stereotype.Service;
 
 /**
  * 上传模块信息
- * create by lorne on 2017/11/11
+ * @author LCN on 2017/11/11
  */
 @Service(value = "umi")
 public class ActionUMIServiceImpl implements IActionService {

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/service/impl/BaseSignalTaskService.java

@@ -23,7 +23,7 @@ import com.lorne.core.framework.utils.task.IBack;
 import com.lorne.core.framework.utils.task.Task;
 
 /**
- * create by lorne on 2017/11/13
+ * @author LCN on 2017/11/13
  */
 public class BaseSignalTaskService {
 

+ 2 - 2
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/service/impl/NettyServerServiceImpl.java

@@ -45,7 +45,7 @@ import java.util.concurrent.Executors;
 import java.util.concurrent.TimeUnit;
 
 /**
- * Created by lorne on 2017/6/30.
+ *@author LCN on 2017/6/30.
  */
 @Service
 public class NettyServerServiceImpl implements NettyServerService, DisposableBean {
@@ -71,7 +71,7 @@ public class NettyServerServiceImpl implements NettyServerService, DisposableBea
 	public void start() {
 		final int heartTime = configReader.getTransactionNettyHeartTime() + 10;
 		txCoreServerHandler = new TxCoreServerHandler(threadPool, nettyService);
-		bossGroup = new NioEventLoopGroup(50); // (1)
+		bossGroup = new NioEventLoopGroup(50);
 		workerGroup = new NioEventLoopGroup();
 		try {
 			ServerBootstrap b = new ServerBootstrap();

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/netty/service/impl/NettyServiceImpl.java

@@ -24,7 +24,7 @@ import org.springframework.context.ApplicationContext;
 import org.springframework.stereotype.Service;
 
 /**
- * create by lorne on 2017/11/11
+ * @author LCN on 2017/11/11
  */
 @Service
 public class NettyServiceImpl implements NettyService {

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/redis/RedisServerService.java

@@ -23,7 +23,7 @@ import com.pig4cloud.pigx.manager.netty.model.TxGroup;
 import java.util.List;
 
 /**
- * create by lorne on 2017/11/11
+ * @author LCN on 2017/11/11
  */
 public interface RedisServerService {
 

+ 1 - 1
pigx-visual/pigx-tx-manager/src/main/java/com/pig4cloud/pigx/manager/redis/impl/RedisServerServiceImpl.java

@@ -35,7 +35,7 @@ import java.util.Set;
 import java.util.concurrent.TimeUnit;
 
 /**
- * create by lorne on 2017/11/11
+ * @author LCN on 2017/11/11
  */
 @Service
 public class RedisServerServiceImpl implements RedisServerService {