2930313233343536373839
if (beanFactory != null) { return; } // 如果传入的工厂为空将采用默认的工厂模式 if (StringUtil.isEmptyAndNull(factoryName)) { beanFactory = new DefaultBeanFactory(); return; } beanFactory = (BeanFactory)RefObjectUtil.loadClass(factoryName); }
41424344454647
/** *获取指定全局bean工厂的实现类 * @return */ public static BeanFactory getBeanFactory() { return beanFactory == null ? new DefaultBeanFactory() : beanFactory; }