By ApplicationContext
- Create an instance
- Set property of the instance
- *BeanNameAware(Interface) implement to call setBeanName, pass you BeanName
- *BeanFactoryAware(Interface) implement to call setBeanFactory, pass you BeanFactory
- *ApplicationContextAware(Interface) implement to call, pass you ApplicationContext
- *BeanPostProcessor(Interface) postProcessBeforeInitialization(function), any one or more Bean class to implement to call, like filter, remember to return the object. AOP
- *InitializingBean(Interface) implement to call afterPropertiesSet
- *customized function defined by "init-method" in <bean> config, or @PostConstruct
- *BeanPostProcessor(Interface) postProcessAfterInitialization(function)
- Instance Ready to use
- Spring Container closing
- *DisposableBean(Interface) implement to call destroy
- *customized function defined by "destroy-method" in <bean> config, or @PreDestroy
Most common steps: 1,2,6, 9,10,11
* steps: optional
Suggested to use customized function since it's not bonded to Spring
By BeanFactory
Do NOT have ApplicationContext and BeanPostProcessor
Only have 1,2,3,4,7,8,10,11,12,13
No comments:
Post a Comment