JBoss MicroContainer 学习笔记

阎麒
2023-12-01

JBOSS MicroContainer结构分析
1)Kernel初始化完成后,注册表中八个核心对象:
KernelConfig:配置对象(配置Kernel自身)
KernelInitializer:初始化器对象,用户初始化Kernel
KernelRegistry:注册表对象,用户存储注册Bean
KernelEventManager:事件管理器对象
KernelBus:总线对象,提供对bean的间接调用
KernelConfigurator:配置器对象,用户配置Bean
KernelController:控制器对象,用户控制Bean的状态

MicroContainer Bean State
JBOSS MicroContainer中Bean的八种状态

NOT_INSTALLED - Metadata describing the bean has been parsed from annotations or a deployment descriptor.
                注释以及部署描述符中的元素都已经被分析
PRE_INSTALL - the scope of the bean within the microcontainer has been discovered and classloading dependencies have been resolved.
                微容器已经确定bean的范围并且指定了ClassLoader
DESCRIBED - Any AOP dependencies have been added.
                完成对bean AOP依赖的添加
INSTANTIATED -All dependencies have been resolved to construct the bean. These include; a classloader exists, the class can be found, a constructor or factory method can be found and any parameter injections can be resolved.
                构造该bean的所有依赖已经确定,包括ClassLoader、class文件、构造方法或者工厂方法、需要注入的全部参数
                即实例化该bean
CONFIGURED - All the property injections can be resolved. This includes any injections within collections.
                完成对实例化的bean所有属性的注入,包括任何集合中的注入
CREATE - All the beans metioned in the @Depends annotation or <depends> element have reached the CREATE state including any parameter injections in the create method.
                依赖(@Depends annotation或<depends>)全部到达CREATE状态,包括create方法中注入的任何参数
START - All the beans metioned in the @Depends annotation or <depends> element have reached the START state including any parameter injections in the start method.
                同上(全部依赖到达START状态)
INSTALLED - Any deployment actions have been processed and the bean has been added to the list of items that the controller supplies.
                全部的部署行为都被处理完成,bean已经被添加到controller的提供项列表中

 类似资料: