美文网首页
Spring-6-IoC名词杂记

Spring-6-IoC名词杂记

作者: 宠辱不惊的咸鱼 | 来源:发表于2019-10-04 09:34 被阅读0次

    lazy-init

    <bean lazy-init="true"></bean>
    <beans default-lazy-init="true"><beans>
    
    • 默认false

    scope

    • singleton,prototype,request,session,global session
    • 默认singleton

    autowire

    • no,byName
    • byType:多个匹配抛异常
    • constructor:按参数类型匹配,无匹配抛异常
    • 默认no

    init-method,destroy-method

    <beans default-init-method="" default-destroy-method="" ></beans>
    <bean init-method="" destroy-method=""></bean>
    
    implements InitializingBean
    implements DisposableBean
    
    • default优先级最低,在其余二者存一时失效
    • default即便定义,实际无该方法时,也不报错

    未定义id时

    • 类全称#编号作为beanName

    FactoryBean

    public interface FactoryBean<T> {  
    
        T getObject() throws Exception;  
      
        Class<?> getObjectType();  
    
        boolean isSingleton();  
    }
    
    • &:工厂bean名字前缀

    BeanPostProcessor

    • AdvisorAdapterRegistrationManager是BeanPostProcessor在AOP里的应用,再细看下

    相关文章

      网友评论

          本文标题:Spring-6-IoC名词杂记

          本文链接:https://www.haomeiwen.com/subject/ljwjpctx.html