springContextStati是一个实现了Applicationcontextaware的类的名字,可以getBean(..)
RegistryTask是一个在RegistryServer调用netty封装的channelinitializer时候,的clienthandler被触发读事件的时候 new 的
@Component
@DependsOn(value={"springContextStatic","normalConfig","channelCache","serviceAddrCache"})
DependsOn的参数都是String字符串,类的名称,后面在RegistryTask的构造函数中,必须用appcontext.getBean(String name)获得bean,否则阻塞。
public class RegistryServer {
.....
......
@PostConstruct
private void doRunServer() {
try {
此处被注释的代码部分如果不执行,那么后面一个RegistryTask阻塞在构造函数上
执行此处getBean(Class<T>)代码的意义是什么?加载?玄。。
/*LOGGER.info("doRunServer:appctx:{}",SpringContextStatic.getApplicationContext());
LOGGER.info("normalconfig:{}",SpringContextStatic.getBean(NormalConfig.class));
LOGGER.info("channelcache:{}",SpringContextStatic.getBean(ChannelCache.class));
LOGGER.info("serviceaddrcache:{}",SpringContextStatic.getBean(ServiceAddrCache.class