feat: change the invokeonStartingDoipServer function name

This commit is contained in:
haoeliu@foxmail.com 2023-02-20 15:59:36 +08:00
parent 838b2e77c8
commit fdb652880b

View File

@ -685,7 +685,7 @@ public class ContractProcess {
public void invokeOnStartingDoipServer(ContractNode cn, JsonElement arg) { public void invokeOnStartingDoipServer(ContractNode cn, JsonElement arg) {
ContractRequest onStartingDoipServer = new ContractRequest(); ContractRequest onStartingDoipServer = new ContractRequest();
onStartingDoipServer.setAction("invokeOnStartingDoipServer"); onStartingDoipServer.setAction("onServerStart");
if (arg == null) { if (arg == null) {
if (engine != null && engine.getManifest() != null && engine.getManifest().createParam != null) if (engine != null && engine.getManifest() != null && engine.getManifest().createParam != null)
arg = engine.getManifest().createParam; arg = engine.getManifest().createParam;
@ -700,7 +700,7 @@ public class ContractProcess {
} else { } else {
onStartingDoipServer.setRequesterDOI("empty"); onStartingDoipServer.setRequesterDOI("empty");
} }
FunctionNode funNode = cn.getFunction("invokeOnStartingDoipServer"); FunctionNode funNode = cn.getFunction("onServerStart");
try { try {
JsonElement onStartingDoipServerRes = invoke(onStartingDoipServer, funNode).result; JsonElement onStartingDoipServerRes = invoke(onStartingDoipServer, funNode).result;
@ -725,7 +725,7 @@ public class ContractProcess {
} }
} catch (Exception e) { } catch (Exception e) {
LOGGER.error("DoipLocalSingleton cannot starts properly, plz check the invokeOnStartingDoipServer function"); LOGGER.error("DoipLocalSingleton cannot starts properly, plz check the onServerStart function");
e.printStackTrace(); e.printStackTrace();
} }
} }
@ -739,7 +739,7 @@ public class ContractProcess {
} else { } else {
funcArgs[2] = "empty"; funcArgs[2] = "empty";
} }
Object result = engine.invokeFunction("invokeOnStartingDoipServer", funcArgs); Object result = engine.invokeFunction("onServerStart", funcArgs);
Map<String, String> resMap = (Map<String, String>) result; Map<String, String> resMap = (Map<String, String>) result;
try { try {
if (!resMap.containsKey("doipAddr")) { if (!resMap.containsKey("doipAddr")) {
@ -748,7 +748,7 @@ public class ContractProcess {
DoipClusterServer.startDoipServer(resMap.get("doipAddr")); DoipClusterServer.startDoipServer(resMap.get("doipAddr"));
} }
} catch (Exception e) { } catch (Exception e) {
LOGGER.error("DoipLocalSingleton cannot starts properly, plz check the invokeOnStartingDoipServer function"); LOGGER.error("DoipLocalSingleton cannot starts properly, plz check the onServerStart function");
e.printStackTrace(); e.printStackTrace();
} }
} }