使用FactoryBean是最简单的解决方案-您可以描述所需的任何算法。有关更多信息,请访问
http://docs.spring.io/spring/docs/current/javadoc-
api/org/springframework/beans/factory/FactoryBean.html
http://docs.spring.io/spring/docs/current/spring-framework-
reference/html/beans.html#beans-factory-extension-
factorybean



