1. 一个接口多个继承类
继承类中加入 @Service("userServiceImpl1")
@Autowired
@Qualifier("userServiceImpl1")
private UserService userService;
2. @ComponentScan(value = "com.example.IotTest.mqtt")
设置要扫描的包,并加载运行。默认扫描的是本包,及子包。其他包的加载需要@ComponentScan。
3. Springboot+Netty搭建MQTT协议的服务端(基础Demo)
https://blog.csdn.net/myyhtw/article/details/114041042
4. Nutz框架: @IocBean注解
AnnotationIocLoader 根据这个注解来判断哪些类应该被自己加载。
5. Nutz框架: @Inject注解
为对象的字段注入,AnnotationIocLoader 根据这个注解来了解类中的字段,具体的注入方式。
6. Nutz框架:Castors.me().castTo 用法
Boolean b1 = Castors.me().castTo("aa", Boolean.class); true
Boolean b2 = Castors.me().castTo("true", Boolean.class);true
Boolean b3 = Castors.me().castTo("false", Boolean.class); false
Boolean b0 = Castors.me().castTo("False", Boolean.class); false
Boolean ba = Castors.me().castTo("mqttwk.broker.websocket-enabled", Boolean.class);true
Boolean bb = Castors.me().castTo("mqttwk.broker.websocket-disabled", Boolean.class);true
Boolean b4 = Castors.me().castTo("123", Boolean.class);true
Boolean b5 = Castors.me().castTo("0", Boolean.class); false
Boolean b6 = Castors.me().castTo("0.0f", Boolean.class);true
Boolean b7 = Castors.me().castTo("0.0", Boolean.class);true
7. Netty: EpollServerSocketChannel和NioServerSocketChannel的区别
NioServerSocketChannel使用Java NIO作为底层网络I/O模型
EpollServerSocketChannel则使用Linux epoll机制作为底层网络I/O模型。
EpollServerSocketChannel只能运行在Linux平台上。
8. Netty: ServerBootstrap 是服务端启动引导类
9. Arrays.stream(args).noneMatch()
noneMatch:与allMatch相反,判断条件里的元素,所有的都不是,返回true
allMatch:判断条件里的元素,所有的都是,返回true
10. System.arraycopy(Object src, int srcPos, Object dest, int destPos,int length);
Object src : 原数组
int srcPos : 从元数据的起始位置开始
Object dest : 目标数组
int destPos : 目标数组的开始起始位置
int length : 要copy的数组的长度
11. System.exit(1): springboot系统退出的一种方法。
12. Freemarker模版引擎
Springboot集成Freemarker|超级详细
Thymeleaf 为新技术,功能较为强大。
https://blog.csdn.net/heima005/article/details/129435750
13. Cache有时间大小限制,到时间了会自动清理。
14. thingboards的mqtt server是用 netty实现的。
15. @PreDestroy
被@PreDestroy注解标注的方法会在服务器卸载Servlet时运行,并且只会被服务器调用一次,类似于Servlet的destroy()方法;
被@PreDestroy注解标注的方法会在destroy()方法之后运行,在Servlet被彻底卸载之前执行。