logo资料库

Spring注解驱动开发.pdf

第1页 / 共1页
资料共1页,全文预览结束
InitializingBean(初始化设置值之后) DisposableBean(销毁) JSR250 @PostConstruct @PreDestroy AnnotationConfigApplicationContext 配置类 包扫描 @ComponentScan 指定初始化销毁 @Bean 初始化其他方式 BeanPostProcessor @Configuration @Component 组件添加 @Service @Controller @Repository @Conditional @Primary @Lazy @Scope @Import 容器 ImportSelector 工厂模式 FactoryBean &beanName获取Factory本身 @Value @Autowired @Qualifier 其他方式 组件赋值 @PropertySource @PropertySources @Resources(JSR250) @Inject(JSR330,需要导入javax.inject) Environment -Dspring.profiles.active=test @Profile 方法参数 构造器注入 组件注入 ApplicationContextAware ApplicationContextAwareProcessor  xxxAware @EnableAspectJAutoProxy AOP @Before/@After/@AfterReturning/@AfterThrowing/@ Around @Pointcut @EnableTransactionManagement 声明式事务 @Transactional BeanFactoryPostProcessor Spring容器标准初始化之后执行(BeanPostProcessor之 前),此时bean还未创建 Spring容器初始化两大步 1、加载保存和读取所有bean配置 2、按照之前的配置创建bean 扩展原理 BeanDefinitionRegistryPostProcessor BeanFactoryPostProcessor子类,可自定义添加bean定义 BeanDefinetionRegistry BeanDefinetionBuilder ApplicationListener @EventListener Spring容器创建过程 ServletContainerInitializer servlet3.0 Registration ServletRegistration FilterRegistration web ServletContext servlet3.0异步处理  异步请求 返回Callable 返回DeferredResult Spring注解驱动开发
分享到:
收藏