depend-on

           depend-on用来表示一个Bean的实例化依靠另外一个Bean先实例化。

     < bean  id = "emailUtils"  class = "com.trinitesolutions.core.utils.EmailUtils"  depends-on = "originZoneRepository"  >
           < property  name =  "jdbcTemplate"  ref = "jdbcTemplate"  />
           < property  name =  "velocityEngine"  ref = "velocityEngine"  />
           < property  name =  "freemarkerConfiguration"  ref = "freemarkerConfiguration"  />
           < property  name =  "originZoneService"  ref = "originZoneService"  />
     </ bean  >

    也可使用@DependsOn注释

本站公众号
   欢迎关注本站公众号,获取更多信息