bean容器重构ing

This commit is contained in:
aoshiguchen
2022-07-02 19:59:54 +08:00
parent 9cfbcaba66
commit 1429c78278
18 changed files with 491 additions and 296 deletions
@@ -40,13 +40,17 @@ public class ServerChannelHandler extends SimpleChannelInboundHandler<ProxyMessa
private static volatile Dispatcher<ChannelHandlerContext, ProxyMessage> dispatcher;
public ServerChannelHandler() {
LockUtil.doubleCheckProcess(() -> null == dispatcher,
ServerChannelHandler.class,
() -> {
dispatcher = new DefaultDispatcher<>("消息调度器",
BeanManager.getBeanListBySuperClass(ProxyMessageHandler.class),
proxyMessage -> ProxyDataTypeEnum.of((int)proxyMessage.getType()) == null ? null : ProxyDataTypeEnum.of((int)proxyMessage.getType()).getName());
});
try {
LockUtil.doubleCheckProcess(() -> null == dispatcher,
ServerChannelHandler.class,
() -> {
dispatcher = new DefaultDispatcher<>("消息调度器",
BeanManager.getBeanListBySuperClass(ProxyMessageHandler.class),
proxyMessage -> ProxyDataTypeEnum.of((int)proxyMessage.getType()) == null ? null : ProxyDataTypeEnum.of((int)proxyMessage.getType()).getName());
});
} catch (Exception e) {
e.printStackTrace();
}
}
@Override