|
@@ -38,6 +38,7 @@ public class ActionControl extends ActionBase {
|
|
|
private static final String CMD_CLH2 = "clh2";
|
|
private static final String CMD_CLH2 = "clh2";
|
|
|
private static final String CMD_UF = "uf";
|
|
private static final String CMD_UF = "uf";
|
|
|
private static final String CMD_DDL = "ddl";
|
|
private static final String CMD_DDL = "ddl";
|
|
|
|
|
+ private static final String CMD_RST = "rst";
|
|
|
|
|
|
|
|
private static final int REPEAT_MAX = 100;
|
|
private static final int REPEAT_MAX = 100;
|
|
|
private static final int REPEAT_MIN = 1;
|
|
private static final int REPEAT_MIN = 1;
|
|
@@ -72,6 +73,8 @@ public class ActionControl extends ActionBase {
|
|
|
uf(cmd);
|
|
uf(cmd);
|
|
|
} else if (cmd.hasOption(CMD_DDL)) {
|
|
} else if (cmd.hasOption(CMD_DDL)) {
|
|
|
ddl(cmd);
|
|
ddl(cmd);
|
|
|
|
|
+ } else if (cmd.hasOption(CMD_RST)) {
|
|
|
|
|
+ rst(cmd);
|
|
|
} else {
|
|
} else {
|
|
|
HelpFormatter formatter = new HelpFormatter();
|
|
HelpFormatter formatter = new HelpFormatter();
|
|
|
formatter.printHelp("control command", options);
|
|
formatter.printHelp("control command", options);
|
|
@@ -95,6 +98,7 @@ public class ActionControl extends ActionBase {
|
|
|
options.addOption(clh2Option());
|
|
options.addOption(clh2Option());
|
|
|
options.addOption(ufOption());
|
|
options.addOption(ufOption());
|
|
|
options.addOption(ddlOption());
|
|
options.addOption(ddlOption());
|
|
|
|
|
+ options.addOption(rstOption());
|
|
|
return options;
|
|
return options;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -161,6 +165,11 @@ public class ActionControl extends ActionBase {
|
|
|
.desc("导出数据定义语句:建表语句:build,数据库创建:createDB,数据库删除dropDB.").build();
|
|
.desc("导出数据定义语句:建表语句:build,数据库创建:createDB,数据库删除dropDB.").build();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private static Option rstOption() {
|
|
|
|
|
+ return Option.builder("rst").longOpt("restartApp").argName("name").hasArg()
|
|
|
|
|
+ .desc("重启指定应用: 应用名称:name, 不带.war").build();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private void ec(CommandLine cmd) throws Exception {
|
|
private void ec(CommandLine cmd) throws Exception {
|
|
|
if (BooleanUtils.isNotTrue(Config.currentNode().getEraseContentEnable())) {
|
|
if (BooleanUtils.isNotTrue(Config.currentNode().getEraseContentEnable())) {
|
|
|
logger.print("erase content is disabled.");
|
|
logger.print("erase content is disabled.");
|
|
@@ -253,6 +262,12 @@ public class ActionControl extends ActionBase {
|
|
|
ddl.execute(type);
|
|
ddl.execute(type);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private void rst(CommandLine cmd) throws Exception {
|
|
|
|
|
+ String name = Objects.toString( cmd.getOptionValue(CMD_RST), "");
|
|
|
|
|
+ RestatWar rst = new RestatWar();
|
|
|
|
|
+ rst.execute(name);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private Integer getArgInteger(CommandLine cmd, String opt, Integer defaultValue) {
|
|
private Integer getArgInteger(CommandLine cmd, String opt, Integer defaultValue) {
|
|
|
Integer repeat = defaultValue;
|
|
Integer repeat = defaultValue;
|
|
|
String r = cmd.getOptionValue(opt);
|
|
String r = cmd.getOptionValue(opt);
|