search

Home  >  Q&A  >  body text

java - spring BeanFactory getbean方法是怎么搜索出对应的类的

PHP中文网PHP中文网2945 days ago287

reply all(2)I'll reply

  • PHP中文网

    PHP中文网2017-04-18 10:42:46

    This is the mechanism for assembling Beans. The second getBean(Class<> clzss)明显是按照类型 获取,比方说,你要提取的Bean的类型是com.abc.def.test.service.LoginService
    你只需要在这里给定参数是: getBean(com.abc.def.test.service.LoginService.class)
    就可以得到一个LoginService object instance

    reply
    0
  • 阿神

    阿神2017-04-18 10:42:46

    BeanFactory has a Map from Class to bean_id

    reply
    0
  • Cancelreply