Spring framework
- BeanPostProcessor
- BeanFactoryPostProcessor
- AutowiredAnnotationBeanPostProcessor
- Bean: 如果用@Bean顯式指定了名稱,就用這個顯式名稱:
@Bean({"b1", "b2"}) // bean available as 'b1' and 'b2', but not 'myBean'
public MyBean myBean() {
// instantiate and configure MyBean obj
return obj;
}
@SpringBootApplication
@Resource
applied to a field or method, the container will inject an instance of the requested resource into the application component when the component is initialized.
applied to the component class, the annotation declares a resource that the application will look up at runtime.