mirror of
https://gitee.com/BDWare/agent-backend
synced 2025-04-27 22:52:17 +00:00
fix: plugin null bugs
This commit is contained in:
parent
e1e0435589
commit
e706180493
@ -45,7 +45,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||||||
public class CMHttpServer {
|
public class CMHttpServer {
|
||||||
private static final Logger LOGGER = LogManager.getLogger(CMHttpServer.class);
|
private static final Logger LOGGER = LogManager.getLogger(CMHttpServer.class);
|
||||||
private static final String CONFIG_PATH = "cmconfig.json";
|
private static final String CONFIG_PATH = "cmconfig.json";
|
||||||
public static CMDConf cmdConf;
|
public static CMDConf cmdConf;
|
||||||
public static EventLoopGroup workerGroup = new NioEventLoopGroup();
|
public static EventLoopGroup workerGroup = new NioEventLoopGroup();
|
||||||
public static MultiIndexTimeRocksDBUtil nodeLogDB =
|
public static MultiIndexTimeRocksDBUtil nodeLogDB =
|
||||||
new MultiIndexTimeRocksDBUtil(
|
new MultiIndexTimeRocksDBUtil(
|
||||||
@ -53,6 +53,7 @@ public class CMHttpServer {
|
|||||||
private static SslContext sslContext = null;
|
private static SslContext sslContext = null;
|
||||||
final String PATH = "/SCIDE/SCExecutor";
|
final String PATH = "/SCIDE/SCExecutor";
|
||||||
private final int port;
|
private final int port;
|
||||||
|
|
||||||
private static void parseConf(CMDConf cmdConf) throws IOException {
|
private static void parseConf(CMDConf cmdConf) throws IOException {
|
||||||
if (cmdConf.disableDoRepo) {
|
if (cmdConf.disableDoRepo) {
|
||||||
DoConfig.callContractUsingDOI = false;
|
DoConfig.callContractUsingDOI = false;
|
||||||
@ -215,10 +216,10 @@ public class CMHttpServer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
start(cmdConf.ip, cmdConf.servicePort, cmdConf.doipPort,cmdConf);
|
start(cmdConf.ip, cmdConf.servicePort, cmdConf.doipPort, cmdConf);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void start(String ip, int port, int doipPort,CMDConf cmdConf) throws IOException {
|
public static void start(String ip, int port, int doipPort, CMDConf cmdConf) throws IOException {
|
||||||
if (DoConfig.callContractUsingDOI) {
|
if (DoConfig.callContractUsingDOI) {
|
||||||
ContractManager.threadPool.execute(
|
ContractManager.threadPool.execute(
|
||||||
() -> ContractRepositoryMain.start("tcp://" + ip + ":" + doipPort));
|
() -> ContractRepositoryMain.start("tcp://" + ip + ":" + doipPort));
|
||||||
@ -244,16 +245,20 @@ public class CMHttpServer {
|
|||||||
return pathname.getName().endsWith(".jar");
|
return pathname.getName().endsWith(".jar");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
URL[] urls = new URL[pluginJar.length];
|
if (pluginJar != null && pluginJar.length > 0) {
|
||||||
for (int i=0;i<pluginJar.length;i++){
|
URL[] urls = new URL[pluginJar.length];
|
||||||
try {
|
for (int i = 0; i < pluginJar.length; i++) {
|
||||||
urls[i] = pluginJar[i].toURI().toURL();
|
try {
|
||||||
LOGGER.info("add plugin:"+pluginJar[i].getName());
|
urls[i] = pluginJar[i].toURI().toURL();
|
||||||
} catch (MalformedURLException e) {
|
LOGGER.info("add plugin:" + pluginJar[i].getName());
|
||||||
e.printStackTrace();
|
} catch (MalformedURLException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
pluginLoader = new URLClassLoader(urls, CMHttpServer.class.getClassLoader());
|
||||||
|
} else {
|
||||||
|
pluginLoader = new URLClassLoader(new URL[]{}, CMHttpServer.class.getClassLoader());
|
||||||
}
|
}
|
||||||
pluginLoader = new URLClassLoader(urls,CMHttpServer.class.getClassLoader());
|
|
||||||
if (port >= 18000 && port < 18100) {
|
if (port >= 18000 && port < 18100) {
|
||||||
ContractManager.cPort = new ContractPort(1615 + (port - 18000) * 30);
|
ContractManager.cPort = new ContractPort(1615 + (port - 18000) * 30);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user