ITeye博客

Spring Factory config

youshini · 2011-07-19 13:57 · Spring · 编程语言 · Markdown

Spring config:

 

<bean id="hbmModel" scope="singleton" class="HbmModel" factory-method="instance">
            <constructor-arg ref="entityDefinitionLoader" />
    </bean>

 entityDefinitionLoader:

 

public class EntityDefinitionLoader implements InitializingBean

 ###

 Spring InitialingBean :

     Spirng的InitializingBean为bean提供了定义初始化方法的方式。InitializingBean是一个接口,它仅仅包含一个方法:afterPropertiesSet()。

     link:http://blog.csdn.net/hhdem/article/details/1802701

 

###

 Spring factory-method:

  一般情况下,应用程序有自己的工厂对象来创建bean.如果将应用程序自己的工厂对象交给Spring管理,那么Spring管理的就 不是普通的bean,而是工厂Bean.

调用getBean()方法,Spring返回的不是直接创建的Bean的实例,而是由工厂Bean创建的Bean实例.

   link:http://blog.sina.com.cn/s/blog_5f1fe33f0100hyx7.html

###

  Spring util:list    关于spring中<util:**/>的配置

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。