提交 8b90e3d6 编写于 作者: hlwwx's avatar hlwwx

'修改了上传war,启动判断'

上级 4a3d1ab2
{"node_127.0.0.1.json":"节点配置",
"appStyle.json":"应用样式配置",
"appStyle.json":"移动端应用样式配置",
"centerServer.json":"中心服务配置",
"clientInit.json":"客户端初始化配置",
"collect.json":"连接到云平台配置",
......@@ -7,8 +7,7 @@
"components.json":"组件配置",
"dingding.json":"钉钉配置",
"dumpRestoreData.json":"导出导入数据配置",
"dumpRestoreStorage.json":"导出导入文件配置",
"exmail.json":"邮件配置",
"exmail.json":"腾讯企业邮邮件配置",
"externalDataSources.json":"数据库配置",
"externalDataSources_db2.json":"db2数据库配置",
"externalDataSources_dm.json":"达梦数据库配置",
......@@ -28,11 +27,10 @@
"person.json":"个人信息配置",
"portal.json":"门户配置",
"processPlatform.json":"流程平台配置",
"pushConfig.json":"极光推送配置",
"qiyeweixin.json":"微信配置",
"query.json":"定时任务配置",
"token.json":"sso配置",
"vfs.json":"附件上传配置",
"qiyeweixin.json":"企业微信配置",
"query.json":"数据中心配置",
"token.json":"令牌,密钥配置",
"vfs.json":"虚拟文件存储配置",
"welink.json":"华为WeLink配置",
"workTime.json":"工作时间配置",
"zhengwuDingding.json":"政务钉钉配置"
......
......@@ -493,6 +493,7 @@ public class NodeAgent extends Thread {
File war = new File(Config.dir_custom(true), simpleName + ".war");
File dir = new File(Config.dir_servers_applicationServer_work(), simpleName);
FileUtils.writeByteArrayToFile(war, bytes, false);
boolean isStartApplication = false;//第一次上传
if (Servers.applicationServerIsRunning()) {
GzipHandler gzipHandler = (GzipHandler) Servers.applicationServer.getHandler();
HandlerList hanlderList = (HandlerList) gzipHandler.getHandler();
......@@ -501,16 +502,20 @@ public class NodeAgent extends Thread {
QuickStartWebApp app = (QuickStartWebApp) handler;
if (StringUtils.equals("/" + simpleName, app.getContextPath())) {
app.stop();
logger.print("{} need restart because {} redeployed.", app.getDisplayName(), simpleName);
this.modified(bytes, war, dir);
app.start();
isStartApplication = true;
}
}
}
if(rebootApp) {
if(!isStartApplication) {
Servers.stopApplicationServer();
Thread.sleep(3000);
Servers.startApplicationServer();
}
}
}
}
......@@ -519,6 +524,7 @@ public class NodeAgent extends Thread {
File jar = new File(Config.dir_custom_jars(true), simpleName + ".jar");
FileUtils.writeByteArrayToFile(jar, bytes, false);
List<String> contexts = new ArrayList<>();
boolean isStartApplication = false;
for (String s : Config.dir_custom().list(new WildcardFileFilter("*.war"))) {
contexts.add("/" + FilenameUtils.getBaseName(s));
}
......@@ -530,16 +536,20 @@ public class NodeAgent extends Thread {
QuickStartWebApp app = (QuickStartWebApp) handler;
if (contexts.contains(app.getContextPath()) ) {
app.stop();
logger.print("{} need restart because {} redeployed.", app.getDisplayName(), simpleName);
Thread.sleep(3000);
app.start();
isStartApplication = true;
}
}
}
if(rebootApp) {
if(!isStartApplication) {
Servers.stopApplicationServer();
Thread.sleep(1000);
Servers.startApplicationServer();
}
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册