♻️ 重构代码。重写LCN 部分代码。

This commit is contained in:
冷冷 committed 2018-08-19 01:55:34 +08:00
1 parent 55d98ad2e7
commit f4b25bbb2a
83 files changed
+253 -679

No files matched your search

+5 -5
View File
@@ -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>
@@ -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 {
@@ -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)
@@ -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() {
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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() {
@@ -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 {
@@ -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;
private final MicroService eurekaService;
@Autowired
private MicroService eurekaService;
private final CompensateService compensateService;
@Autowired
private CompensateService compensateService;
private final TxManagerSenderService txManagerSenderService;
@Autowired
private TxManagerSenderService txManagerSenderService;
@Autowired
private ConfigReader configReader;
private final ConfigReader configReader;
@Override
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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");
@@ -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 {
@@ -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 {
@@ -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
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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> {
@@ -27,7 +27,7 @@ import javax.servlet.ServletContextListener;
/**
* Created by lorne on 2017/7/1.
*@author LCN on 2017/7/1.
*/
@Component
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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();
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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());
}
@@ -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();
}
});
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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();
@@ -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 {
@@ -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 {
@@ -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 {