|
|
|
@ -1,6 +1,5 @@
|
|
|
|
|
package com.docus.server.common.netty.client;
|
|
|
|
|
|
|
|
|
|
import com.docus.core.util.json.JSON;
|
|
|
|
|
import com.docus.server.common.CommMsg;
|
|
|
|
|
import com.docus.server.common.netty.event.StartUpEvent;
|
|
|
|
|
import com.docus.server.common.netty.server.CollectorChannelCacheMap;
|
|
|
|
@ -37,6 +36,9 @@ public class NettyClient {
|
|
|
|
|
@Value("${spring.application.name}")
|
|
|
|
|
private String appName;
|
|
|
|
|
|
|
|
|
|
@Value("${docus.terminal-restart-bat}")
|
|
|
|
|
private String terminalRestartBat;
|
|
|
|
|
|
|
|
|
|
private SocketChannel socketChannel;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
@ -57,7 +59,7 @@ public class NettyClient {
|
|
|
|
|
* @param message 消息内容
|
|
|
|
|
*/
|
|
|
|
|
public void sendMessage(CommMsg message) {
|
|
|
|
|
boolean success = socketChannel.writeAndFlush(JSON.toJSON(message)).isSuccess();
|
|
|
|
|
boolean success = socketChannel.writeAndFlush(message).isSuccess();
|
|
|
|
|
if (success) {
|
|
|
|
|
log.info("发送消息成功");
|
|
|
|
|
}
|
|
|
|
@ -106,4 +108,12 @@ public class NettyClient {
|
|
|
|
|
public String getSaveCollectorPackagePath() {
|
|
|
|
|
return saveCollectorPackagePath;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getAppName() {
|
|
|
|
|
return this.appName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getTerminalRestartBat() {
|
|
|
|
|
return this.terminalRestartBat;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|