1、spring xml文件中有个bean的时候,先设置类中的属性delay,再执行类中的构造函数
2、ApplicationContext
接口IBatchData,
实现类1:A,实现类2:B,
方法:getBeansOfType
eg:Map
3、spring batch:批处理项目(spring子项目之一)
4.spring的IOC容器
IOC:控制反转、依赖注入
spring的IOC容器之beanfactory
插手容器的启动:BeanFactoryPostProcessor,eg:PropertyPlaceholderConfigurer(实现BeanFactoryPostProcessor)配置bean里面的占位符eg:数据库连接信息
spring的IOC容器之application容器,构建于beanfactory之上,提供了许多beanfactory之外的特性。
5、自定义事件发布:java.util.EventListener
6、AOP:
项目中有系统需求和业务需求,系统需求有:写日志、方法访问权限验证、事务提交管理等。
它们都横切在代码中,OOP不能很好的解决这个问题,为了松耦合等,可以把这些系统系统单独抽出来进行编程,aop可以解决问题。
6.1:安全检查eg:资源访问控制,javax.servlet.Filter是servlet规范为我们提供的一种AOP支持。
spring acegi框架可以解决认证、访问控制等一系列问题
6.2:spring缓存(写MAP),EhCache、JBossCache
6.3:实现机制:动态代理模式和字节码生成技术
7、解决jdbc面临的问题:
7.1:基于jdbcTemplate
7.2: 基于操作对象,eg:sqlquery、sqlcall
8、beanfactory和factorybean
beanfactory:
是容器,是个接口,spring中所有的bean都是由它来管理的,包括factorybean
factorybean :
是个bean,是个接口, 不是简单的Bean ,而是一个能生产对象生成的工厂 Bean,一般情况下,Spring 通过反射机制利用
9、
Spring 2.5 中除了提供 @Component 注释外,还定义了几个拥有特殊语义的注释,它们分别是:@Repository、@Service 和 @Controller。
在目前的 Spring 版本中,这 3 个注释和 @Component 是等效的,但是从注释类的命名上,很容易看出这 3 个注释分别和持久层、业务层和控制层(Web 层)相对应。
虽然目前这3 个注释和 @Component 相比没有什么新意,但 Spring 将在以后的版本中为它们添加特殊的功能。
所以,如果 Web 应用程序采用了经典的三层分层结构的话,最好在持久层、业务层和控制层分别采用上述注解对分层中的类进行注释。
@Service用于标注业务层组件
@Controller用于标注控制层组件(如struts中的action)
@Repository用于标注数据访问组件,即DAO组件
@Component泛指组件,当组件不好归类的时候,我们可以使用这个注解进行标注。
http://blog.csdn.net/zhang854429783/article/details/6785574
11、数据库事物
1、ACID:原子性、一致性、隔离性、持久性,隔离性越高,并发性越差、但一致性越高
12、spring集成了jms、email(javamail虽强大,但api使用繁琐,开发过程中使用麻烦)、quartz
13、
https://www.cnblogs.com/leiOOlei/p/3713989.html
https://stackoverflow.com/questions/7414794/difference-between-contextannotation-config-vs-contextcomponent-scan/
14.ibatis
https://www.cnblogs.com/yjmyzz/p/3448330.html
15.
default-lazy-init 与 lazy-init
https://blog.csdn.net/lushuaiyin/article/details/7394618
16.
一:
BeanDefinitionRegistryPostProcessor: 编码方式动态注册bean到beanDefinitionMap
二:mybatis
public class MapperScannerConfigurer implements BeanDefinitionRegistryPostProcessor, InitializingBean, ApplicationContextAware, BeanNameAware {
https://blog.csdn.net/u011396199/article/details/77719181
17.AOP
https://www.cnblogs.com/cndota/p/6129244.html
与:通知与切点
https://blog.csdn.net/u011983531/article/details/70504281/
https://www.cnblogs.com/xiaoxi/p/5981514.html
18.default-autowire="byName":按照名字去注入或找到其它的bean,eg:
19.
public class BizExecutorFactory {
private static final String KEY_SPLIT = "|";
@Autowired
private List extends BaseExecutor> executors; //autowired自动装载ZaHealthEndorsementInitializer 放到executors
public interface BaseExecutor {
}
public class ZaHealthEndorsementInitializer implements BusinessInitializer {
public interface BusinessInitializer extends BaseExecutor {
BizConfig initConfig(BizContent bizContent);
}