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注释

你可能感兴趣的:(depend-on)