Commit e6e970f1 by huangfusuper

Netty 服务工厂数据校验修改

parent 5deaf41d
package com.byit.factory;
import cn.hutool.core.collection.CollectionUtil;
import com.byit.executor.handler.interfaces.IJobHandler;
import com.byit.model.ServerConfigurationModel;
import com.byit.model.ServiceConfigModel;
......@@ -52,14 +53,16 @@ public class RpcMainPluginServerFactory extends PluginServerFactory {
serverConfigurationModel.getServerEnv(), serverConfigurationModel.getServerBiz(),
pluginServiceRegistryClass,pluginServerClass);
classNames.forEach((key,value) ->{
try {
Object o = Class.forName(value).newInstance();
super.addService(key,o);
} catch (Exception e) {
e.printStackTrace();
}
});
if (CollectionUtil.isNotEmpty(classNames)) {
classNames.forEach((key,value) ->{
try {
Object o = Class.forName(value).newInstance();
super.addService(key,o);
} catch (Exception e) {
e.printStackTrace();
}
});
}
super.start();
}catch (Exception e){
......
......@@ -7,9 +7,16 @@ import com.byit.factory.PluginServerFactory;
* @author huangfu
*/
public class NettyPluginServer extends PluginServer {
private Thread serverThread;
@Override
public void start(PluginServerFactory pluginServerFactory) {
System.out.println("-----com.byit.server.NettyPluginServer.start----");
serverThread = new Thread(() ->{
System.out.println("-----com.byit.server.NettyPluginServer.start----");
});
serverThread.setName("【com.byit.server.NettyPluginServer#start thread run】"+serverThread.hashCode());
serverThread.setDaemon(true);
serverThread.start();
super.onStart();
}
@Override
......
......@@ -10,9 +10,9 @@
<pluginServerClass value="com.byit.server.NettyPluginServer"/>
</serverConfiguration>
<classNames>
<!--<classNames>
<className jobName="demo" class="com.byit.job.DemoJob"/>
<className jobName="demo1" class="com.byit.job.EndNode"/>
<className jobName="demo2" class="com.byit.job.StartNode"/>
</classNames>
</classNames>-->
</executor-plugin>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment