启动netty
解码
要点:
1.再要注入bean的类上加上**@Component**
2.spring默认创建的对像是单例的,所以要使用**@Scope(“prototype”)** 每次获取对象都会创建新的对象,不然netty只能创建一个连接,当创建多个的时候报so can’t be added or removed multiple times.异常
3.使用ObjectFactory接口,原因同上
实例化handler,实现ApplicationContextAware类获取bean
工具类
获取bean



