Skip to content

生命周期 ​

tio-boot 框架的生命周期如下

  • 初始化 Bean 容器
  • 扫描所有 Class,查找 AopClass,初始化@nexus.io.annotation.BeforeStartConfiguration 标记的类
  • 启动服务器,监听端口
  • 初始化@nexus.io.annotation.Configuration 标记的配置类,如连接数据库,连接 redis
  • 初始化组件类 如 Controller,Service,Respository,HttpApi
  • 扫描路由,配置 http 路由
  • 运行,接受请求和处理请求
  • 关闭

源码请参考 nexus.io.tio.boot.context.TioApplicationContext.run(Class<?>[], String[])

MIT Licensed