一。Spring基础
【
(1)Spring模块
【
1.核心容器(core Container)
2.AOP
3.消息
4.Web
】
(2)依赖注入
【
1.声明Bean的注解(@Compoent @service @Repository @controller)
2.注入Bean的注解(@Autowired @Inject @Resource)
】
(3)配置
【
1.java配置(@Configuration,@Bean)
2.注解配置(@Service,@Component,@Repository,@Controller)
】
(4)AOP(面向切面编程,oop面向对象编程)
【
1.注解拦截
2.方法规则拦截
】
】
二。Spring 常用配置
【
(1)Scope(Singleton,Prototype,Request,Session,GlobalSession)
(2)Spring EL和资源调用(支持在xml和注解中使用)
【eg:@value(“I love you”)】
(3)Bean的初始化和销毁
【
1.java配置(initMethod,destoryMethod)
2.注解方式(@PostConstruct ,@PreDestroy)
】
(4)Profile
【
1.@Profile(“”)
2. context.getEnviroment().setActiveProfiles(“ ”)
】
(5)事件(Application Event)
【
1.自定义事件
2.定义事件监听器
3.使用容器发布事件
】
】
三。Spring 高级话题
(1)Spring Aware
【
1.BeanNameAware
2.BeanFactoryAware
3.ApplicationContextAware
4.MessageSourceAware
】
(2)多线程
【
1.@EnableAsync,重写getAsyncExecutor()
2.@Async
】
(3)计划任务
【
1.配置类注解@EnableScheduing
2.方法上注解@Scheduled
】
(4)条件注解@Conditional
【
1.判断调教(继承Condition)
2.配置类(@Conditional(条件.class))
】
(5)组合注解与元注解
【eg:组合注解类@Configuration,@CompentScan,配置类@组合注解类类名】
(6)@Enable*注解工作原理
【
1.直接导入配置类{eg:@Import(类名)}
2.依据条件选择配置类{@Import(配置类名),配置类中有判断}
3.动态注册Bean{@Import(配置类名),配置类中重写registerBeanDefinitions()}
】