Java 类org.springframework.beans.factory.xml.XmlBeanFactory 实例源码

项目:springTest    文件:Spring加载配置.java   
@Test
public void testClassPathResource()
{
    Resource cr = null;
    try
    {
        cr = new ClassPathResource("app-context.xml");
        BeanFactory bf = new XmlBeanFactory(cr); // �Ѿ�����
        SayHello sayHello = (SayHello) bf.getBean("sayHello");
        System.out.println(sayHello.toString());
    }
    catch (Exception ex)
    {
        fail("error : " + ex.getMessage());
    }
    finally
    {
    }

    Assert.assertFalse(false);
}
项目:onecmdb    文件:Startup.java   
public static void main(String argv[]) {
    Resource res1 = new ClassPathResource("onecmdb.xml");
    XmlBeanFactory beanFactory1 = new XmlBeanFactory(res1);
    GenericApplicationContext svrctx1 = new GenericApplicationContext(
            beanFactory1);

    IOneCmdbContext ctx = (IOneCmdbContext) svrctx1.getBean("onecmdb");
    ISession session = ctx.createSession();

    // Startup Spring context.
    Resource res2 = new ClassPathResource("bean-provider-application.xml");
    XmlBeanFactory beanFactory2 = new XmlBeanFactory(res2);
    GenericApplicationContext svrctx2 = new GenericApplicationContext(
            beanFactory2);

    BeanScope scope = (BeanScope) svrctx2.getBean("xmlToRfc");
    scope.process();

    ImportRfcs importRfcs = (ImportRfcs) svrctx2.getBean("rfcSender");
    importRfcs.setSession(session);
    importRfcs.setRfcs(scope.getRFCs());
    importRfcs.run();
}
项目:sakai    文件:FactoryUtil.java   
public static IntegrationContextFactory lookup() throws Exception
{
  // the instance is provided by Spring-injection
  if (useLocator)
  {

  SpringBeanLocator locator = SpringBeanLocator.getInstance();
  return
    (IntegrationContextFactory) locator.getBean("integrationContextFactory");
  }
  else // unit testing
  {
    Resource res = new ClassPathResource(CONFIGURATION);
    BeanFactory factory = new XmlBeanFactory(res);
    return
      (IntegrationContextFactory) factory.getBean("integrationContextFactory");
  }

}
项目:sakai    文件:FactoryUtil.java   
public static SamigoApiFactory lookup() throws Exception
{
  // the instance is provided by Spring-injection
  if (useLocator)
  {

  SpringBeanLocator locator = SpringBeanLocator.getInstance();
  return
    (SamigoApiFactory) locator.getBean("samigoApiFactory");
  }
  else // unit testing
  {
    Resource res = new ClassPathResource(CONFIGURATION);
    BeanFactory factory = new XmlBeanFactory(res);
    return
      (SamigoApiFactory) factory.getBean("samigoApiFactory");
  }

}
项目:OneCMDBwithMaven    文件:Startup.java   
public static void main(String argv[]) {
    Resource res1 = new ClassPathResource("onecmdb.xml");
    XmlBeanFactory beanFactory1 = new XmlBeanFactory(res1);
    GenericApplicationContext svrctx1 = new GenericApplicationContext(
            beanFactory1);

    IOneCmdbContext ctx = (IOneCmdbContext) svrctx1.getBean("onecmdb");
    ISession session = ctx.createSession();

    // Startup Spring context.
    Resource res2 = new ClassPathResource("bean-provider-application.xml");
    XmlBeanFactory beanFactory2 = new XmlBeanFactory(res2);
    GenericApplicationContext svrctx2 = new GenericApplicationContext(
            beanFactory2);

    BeanScope scope = (BeanScope) svrctx2.getBean("xmlToRfc");
    scope.process();

    ImportRfcs importRfcs = (ImportRfcs) svrctx2.getBean("rfcSender");
    importRfcs.setSession(session);
    importRfcs.setRfcs(scope.getRFCs());
    importRfcs.run();
}
项目:sakai    文件:FactoryUtil.java   
public static IntegrationContextFactory lookup() throws Exception
{
  // the instance is provided by Spring-injection
  if (useLocator)
  {

  SpringBeanLocator locator = SpringBeanLocator.getInstance();
  return
    (IntegrationContextFactory) locator.getBean("integrationContextFactory");
  }
  else // unit testing
  {
    Resource res = new ClassPathResource(CONFIGURATION);
    BeanFactory factory = new XmlBeanFactory(res);
    return
      (IntegrationContextFactory) factory.getBean("integrationContextFactory");
  }

}
项目:Learning-Spring-5.0    文件:TestBeanFactory.java   
public static void main(String[] args) {
    // TODO Auto-generated method stub

    BeanFactory beanFactory=new XmlBeanFactory(new ClassPathResource("beans_classpath.xml"));
    BeanFactory beanFactory1=new XmlBeanFactory(new FileSystemResource("d:\\beans_fileSystem.xml"));
    System.out.println("beanfactory created successfully");

}
项目:topicrawler    文件:SentenceWriterTest.java   
@Test
public void testbean(){
    Resource xmlResource = new FileSystemResource("jobs/profile-ltbot-default-seedfile/profile-crawler-beans-ltbot.cxml");
    BeanFactory factory = new XmlBeanFactory(xmlResource);
    SentenceWriter w = (SentenceWriter)factory.getBean("sentenceWriterHtml");
    SentenceMaker m = (SentenceMaker)factory.getBean("sentenceMaker");

}
项目:whatsmars    文件:BeanFactoryTest.java   
private static void testXml() {
    ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
    Resource res = resolver.getResource("classpath:spring-context.xml");
    BeanFactory bf = new XmlBeanFactory(res);
    System.out.println("init BeanFactory");

    Mars mars = bf.getBean("mars", Mars.class);
    System.out.println(mars.getCnName() + ":" + mars.getAge());
}
项目:redis-sentinel-client    文件:SpringTest.java   
public static ShardedJedisSentinelPool init() {
    // 初始化连接池
    BeanFactory bf = new XmlBeanFactory(new ClassPathResource("applicationContext.xml"));
    ShardedJedisSentinelPool pool = bf.getBean("shardedJedisSentinelPool",
            ShardedJedisSentinelPool.class);

    System.out.println("init ShardedJedisSentinelPool success...");
    return pool;

}
项目:bd-codes    文件:FXmain.java   
public static void iocDoInstance() {
    // BeanFactory方式启动
    ConfigurableListableBeanFactory beanFactory = new XmlBeanFactory(
            new ClassPathResource("spring.xml"));
    beanFactory.addBeanPostProcessor(new PasswordDecodePostProcessor());

    DowJonesNewsListener newsListener = (DowJonesNewsListener) beanFactory
            .getBean("djNewsListener");
    System.out.println(newsListener.getEncodedPassword());

    // 容器退出之前,销毁singleton的实例
    beanFactory.destroySingletons();
    // 2.0,销毁实现
    // ((AbstractApplicationContext)beanFactory).registerShutdownHook();
}
项目:bd-codes    文件:FXmain.java   
public static void iocStart() {
    // BeanFactory方式启动
    ConfigurableListableBeanFactory beanFactory = new XmlBeanFactory(
            new ClassPathResource("spring.xml"));

    // 读取外部properties文件属性值填充xml中的bean,property
    PropertyPlaceholderConfigurer propertyPlaceholderConfigurer = new PropertyPlaceholderConfigurer();
    propertyPlaceholderConfigurer.setLocation(new ClassPathResource(
            "config.properties"));
    // 应用postProcessBeanFactory
    propertyPlaceholderConfigurer.postProcessBeanFactory(beanFactory);

    // 读取外部properties文件,覆盖xml中bean指定的property值
    PropertyOverrideConfigurer propertyOverrideConfigurer = new PropertyOverrideConfigurer();
    propertyOverrideConfigurer.setLocation(new ClassPathResource(
            "spring-adjustment.properties"));
    propertyOverrideConfigurer.postProcessBeanFactory(beanFactory);

    // CustomEditorConfigurer,对bean的property值,做类型转换支持
    CustomEditorConfigurer customEditorConfigurer = new CustomEditorConfigurer();
    Map customEditors = new HashMap();
    customEditors.put(Date.class, new DatePropertyEditor());
    customEditorConfigurer.setCustomEditors(customEditors);
    customEditorConfigurer.postProcessBeanFactory(beanFactory);

    FXNewsProvider newsProvider = (FXNewsProvider) beanFactory
            .getBean("newsProvider");
    System.out.println(newsProvider.getClientId());
    System.out.println(newsProvider.getBaseUrl());
    System.out.println(newsProvider.getAddDate().toLocaleString());
}
项目:bd-codes    文件:FXmain.java   
public static BeanFactory bindViaXml(BeanDefinitionRegistry registry) {
    // XmlBeanDefinitionReader reader = new
    // XmlBeanDefinitionReader(registry);
    // reader.loadBeanDefinitions("classpath:/spring.xml");
    // return (BeanFactory) registry;

    // 以上,等同于下句
    return new XmlBeanFactory(new ClassPathResource("spring.xml"));
}
项目:dkpro-jwpl    文件:SpringFactory.java   
private static XmlBeanFactory getBeanFactory() {
    File outerContextFile = new File(OUTER_APPLICATION_CONTEXT);
    boolean outerContextFileProper = outerContextFile.exists()
            && outerContextFile.isFile() && outerContextFile.canRead();
    Resource res = (outerContextFileProper) ? new FileSystemResource(
            outerContextFile) : new ClassPathResource(
            INNER_APPLICATION_CONTEXT);
    return new XmlBeanFactory(res);
}
项目:ephesoft    文件:ApplicationContextUtil.java   
/**
 * To initialize the beans.
 * @param <T> the type of beans to be created (for type safety in caller method).
 * @param context the context
 * @param res the resource containing new context information
 * @return initialized beans from definitions in {@code res} initialized with {@code context}
 */
public static <T> Map<String, T> initializeBeans(ConfigurableApplicationContext context, Resource res) {
    BeanDefinitionRegistry beanDefinitionRegistry = (BeanDefinitionRegistry) context.getBeanFactory();

    XmlBeanFactory factory = new XmlBeanFactory(res);
    String[] names = factory.getBeanDefinitionNames();
    for (String name : names) {
        beanDefinitionRegistry.registerBeanDefinition(name, factory.getBeanDefinition(name));
    }

    return getBeansFromContext(context, names);
}
项目:onecmdb    文件:Runtime.java   
public void setUp() {
    // Resource res = new
    // ClassPathResource("org/onecmdb/core/example/application.xml");
    Resource res = new ClassPathResource("application2.xml");
    XmlBeanFactory beanFactory = new XmlBeanFactory(res);
    svrctx = new GenericApplicationContext(beanFactory);

    // PropertyPlaceholderConfigurer cfg = new
    // PropertyPlaceholderConfigurer();
    // cfg.setLocation(new ClassPathResource("jdbc.properties"));
    // cfg.postProcessBeanFactory(beanFactory);

    final IOneCmdbContext cmdb = (IOneCmdbContext) svrctx
            .getBean("onecmdb");

    session = cmdb.createSession();
    IModelService cisvc = (IModelService) session
            .getService(IModelService.class);

    // well known name is ``root''
    ciRoot = cisvc.getRoot();

    assertNotNull(ciRoot);
    System.out.println(ciRoot.toString());
    // Dump offsprings...
    System.out.println(dumpOffsprings(ciRoot, 0));

    IReferenceService refSvc = (IReferenceService) session
            .getService(IReferenceService.class);

    ciRelationRoot = refSvc.getRootReference();
    assertNotNull(ciRelationRoot);

    System.out.println(ciRelationRoot.toString());
}
项目:onecmdb    文件:Validate.java   
public static void main(String argv[]) {
    // Startup Spring context.
    Resource res2 = new ClassPathResource("bean-provider-application.xml");
    XmlBeanFactory beanFactory2 = new XmlBeanFactory(res2);
    GenericApplicationContext svrctx2 = new GenericApplicationContext(
            beanFactory2);

    BeanScope scope = (BeanScope) svrctx2.getBean("importer");
    scope.process();
}
项目:onecmdb    文件:TestDataCenter.java   
public void setUp() {
    // Resource res = new
    // ClassPathResource("org/onecmdb/core/example/application.xml");
    Resource res = new ClassPathResource("onecmdb.xml");
    XmlBeanFactory beanFactory = new XmlBeanFactory(res);
    GenericApplicationContext svrctx = new GenericApplicationContext(
            beanFactory);

    final IOneCmdbContext cmdb = (IOneCmdbContext) svrctx
            .getBean("onecmdb");

    session = cmdb.createSession();
    IModelService modelsvc = (IModelService) session
            .getService(IModelService.class);

    // well known name is ``root''
    ICi root = modelsvc.getRoot();
    assertNotNull(root);

    ICiService cisvc = (ICiService) session.getService(ICiService.class);

    // well known name is ``CI''
    ciRoot = cisvc.getRootCi();
    assertNotNull(ciRoot);

    IReferenceService refsvc = (IReferenceService) session
            .getService(IReferenceService.class);

    ciRelationRoot = refsvc.getRootReference();
    assertNotNull(ciRelationRoot);
}
项目:onecmdb    文件:TestStartOneCmdb.java   
public void setUp() {
    Resource res = new ClassPathResource("onecmdb.xml");
    XmlBeanFactory beanFactory = new XmlBeanFactory(res);
    springctx = new GenericApplicationContext(beanFactory);

    onecmdb = (IOneCmdbContext) springctx.getBean("onecmdb");
}
项目:pinenut    文件:BeanFactoryTest.java   
public static void main(String[] args) {
    @SuppressWarnings("")
    BeanFactory bf = new XmlBeanFactory(new ClassPathResource("framework/c2/beanFactory.xml"));

    MyTestBean myTestBean = bf.getBean("myTestBean", MyTestBean.class);
    System.out.println(myTestBean.getTeststr());

}
项目:pinenut    文件:SpringTest.java   
public void testXmlBeanFactory(){
    XmlBeanFactory beanFactory= new XmlBeanFactory(new ClassPathResource("src/main/resources/spring-chapt2.xml"));

    TestBean testBean = beanFactory.getBean("testBean",TestBean.class);
    testBean.hello();
    testBean = beanFactory.getBean("abcbean",TestBean.class);
    testBean.hello();
    testBean = beanFactory.getBean("abean",TestBean.class);
    testBean.hello();
}
项目:Java-Lessons-Project    文件:TimexTestCase.java   
protected TimexTestCase()
{
    FileSystemResource res = new FileSystemResource("src/conf/timex2-servlet.xml");
    springFactory = new XmlBeanFactory(res);
    departmentManager = (DepartmentManager)springFactory.getBean("departmentManagerProxy");
    employeeManager = (EmployeeManager)springFactory.getBean("employeeManagerProxy");
    timesheetManager = (TimesheetManager)springFactory.getBean("timesheetManagerProxy");
    applicationSecurityManager = (ApplicationSecurityManager)springFactory.getBean("applicationSecurityManager");
}
项目:OneCMDBwithMaven    文件:Validate.java   
public static void main(String argv[]) {
    // Startup Spring context.
    Resource res2 = new ClassPathResource("bean-provider-application.xml");
    XmlBeanFactory beanFactory2 = new XmlBeanFactory(res2);
    GenericApplicationContext svrctx2 = new GenericApplicationContext(
            beanFactory2);

    BeanScope scope = (BeanScope) svrctx2.getBean("importer");
    scope.process();
}
项目:OneCMDBwithMaven    文件:TestDataCenter.java   
public void setUp() {
    // Resource res = new
    // ClassPathResource("org/onecmdb/core/example/application.xml");
    Resource res = new ClassPathResource("onecmdb.xml");
    XmlBeanFactory beanFactory = new XmlBeanFactory(res);
    GenericApplicationContext svrctx = new GenericApplicationContext(
            beanFactory);

    final IOneCmdbContext cmdb = (IOneCmdbContext) svrctx
            .getBean("onecmdb");

    session = cmdb.createSession();
    IModelService modelsvc = (IModelService) session
            .getService(IModelService.class);

    // well known name is ``root''
    ICi root = modelsvc.getRoot();
    assertNotNull(root);

    ICiService cisvc = (ICiService) session.getService(ICiService.class);

    // well known name is ``CI''
    ciRoot = cisvc.getRootCi();
    assertNotNull(ciRoot);

    IReferenceService refsvc = (IReferenceService) session
            .getService(IReferenceService.class);

    ciRelationRoot = refsvc.getRootReference();
    assertNotNull(ciRelationRoot);
}
项目:OneCMDBwithMaven    文件:TestStartOneCmdb.java   
public void setUp() {
    Resource res = new ClassPathResource("onecmdb.xml");
    XmlBeanFactory beanFactory = new XmlBeanFactory(res);
    springctx = new GenericApplicationContext(beanFactory);

    onecmdb = (IOneCmdbContext) springctx.getBean("onecmdb");
}
项目:LaToe    文件:SpringFactory.java   
private static XmlBeanFactory getBeanFactory() {
    File outerContextFile = new File(OUTER_APPLICATION_CONTEXT);
    boolean outerContextFileProper = outerContextFile.exists()
            && outerContextFile.isFile() && outerContextFile.canRead();
    Resource res = (outerContextFileProper) ? new FileSystemResource(
            outerContextFile) : new ClassPathResource(
            INNER_APPLICATION_CONTEXT);
    return new XmlBeanFactory(res);
}
项目:SpringTutorial    文件:BeanRefTestClient.java   
public static void main(String[] args) {


        BeanFactory ctxStatic = new XmlBeanFactory(
        new ClassPathResource("com/springtraining/beanref/staticbeans.xml"));

        ConfigurableBeanFactory parent = new XmlBeanFactory(
                new ClassPathResource("com/springtraining/beanref/projectConfig.xml"),ctxStatic);

        ConfigurableBeanFactory child = new XmlBeanFactory(
                new ClassPathResource("com/springtraining/beanref/childConfig.xml"));

        child.setParentBeanFactory(parent);

        Payment pmt = (Payment) child.getBean("pmnt");
        pmt.pay();
    }
项目:appBack    文件:SessionFactoryCache.java   
public synchronized static SessionFactory getSessionFactoryByDsName(String dataSourceName) {
    Map map = (Map) SessionContext.getAttributeForServletContext(SESSIONFACTORY);
    if (map == null) {
        SessionContext.setAttributeForServletContext(SESSIONFACTORY, new HashMap());
        map = (Map) SessionContext.getAttributeForServletContext(SESSIONFACTORY);
    }
    SessionFactory sessionFactory = (SessionFactory) map.get(dataSourceName);
    if (sessionFactory == null) {
        try {
            DocumentBuilderFactory dbf = new org.apache.xerces.jaxp.DocumentBuilderFactoryImpl();
            DocumentBuilder db = dbf.newDocumentBuilder();
            db.setEntityResolver(new EntityResolver() {
                public InputSource resolveEntity(String publicId, String systemId) throws IOException, SAXException {
                    InputSource inputsource = new InputSource();
                    inputsource.setByteStream(XmlBeanFactory.class.getResource("spring-beans.dtd").openStream());
                    return inputsource;
                }
            });
            String path = ServerBeanFactoryUtils.getApplicationContext().getServletContext().getRealPath("");
            String initParameter = ServerBeanFactoryUtils.getApplicationContext().getServletContext().getInitParameter("contextConfigLocation");
            String res[] = initParameter.split(" ");
            for(String r : res) {
                if(r.contains("applicationContext")){
                    path = path + r;
                    break;
                }
            }
            Document doc = db.parse(path);
            NodeList list = (NodeList) doc.getElementsByTagName("list");
            NodeList values = ((Element) list.item(0)).getElementsByTagName("value");
            String[] hbm = new String[values.getLength()];
            for (int i = 0; i < hbm.length; i++) {
                hbm[i] = values.item(i).getFirstChild().getNodeValue();
            }

            LocalSessionFactoryBean bean = new LocalSessionFactoryBean();
            bean.setDataSource(DataSourceUtils.findDataSource(dataSourceName));
            bean.setMappingResources(hbm);
            Properties porp = new Properties();
            porp.setProperty("hibernate.dialect", "org.hibernate.dialect.SQLServerDialect");
            porp.setProperty("hibernate.show_sql", "true");
            porp.setProperty("hibernate.generate_statistics", "ture");
            bean.setHibernateProperties(porp);
            bean.afterPropertiesSet();
            sessionFactory = (SessionFactory) bean.getObject();
            map.put(dataSourceName,sessionFactory);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    return sessionFactory;
}
项目:bd-codes    文件:FXmain.java   
public static BeanFactory iocInit() {
    return new XmlBeanFactory(new ClassPathResource("spring.xml"));
}
项目:bd-codes    文件:SpringUtils.java   
public static BeanFactory beanIocStart() {
    return new XmlBeanFactory(new ClassPathResource("spring.xml"));
}
项目:ignite    文件:GridUriDeploymentSpringDocument.java   
/**
 * Creates new instance of configuration helper with given configuration.
 *
 * @param factory Configuration factory.
 */
GridUriDeploymentSpringDocument(XmlBeanFactory factory) {
    assert factory != null;

    this.factory = factory;
}
项目:jetstream    文件:SpringBeanDeserializer.java   
public Map<String, Object> deserialize(final String content) {
  DefaultListableBeanFactory beanfactory = new XmlBeanFactory(new Resource() {
    public long contentLength() throws IOException {
      // TODO Auto-generated method stub
      return 0;
    }

    public Resource createRelative(String relativePath) throws IOException {
      throw notSupported();
    }

    public boolean exists() {
      return false;
    }

    public String getDescription() {
      return null;
    }

    public File getFile() throws IOException {
      throw notSupported();
    }

    public String getFilename() {
      return null;
    }

    public InputStream getInputStream() throws IOException {
      StringBuilder sb = new StringBuilder();
      sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
      sb.append("<!DOCTYPE beans PUBLIC \"-//SPRING//DTD BEAN 2.0//EN\" \"http://www.springframework.org/dtd/spring-beans-2.0.dtd\">");
      sb.append("<beans default-lazy-init=\"true\">");
      sb.append(content);
      sb.append("</beans>");
      return new ByteArrayInputStream(sb.toString().getBytes(Charsets.UTF_8));
    }

    public URI getURI() throws IOException {
      throw notSupported();
    }

    public URL getURL() throws IOException {
      throw notSupported();
    }

    public boolean isOpen() {
      return false;
    }

    public boolean isReadable() {
      return false;
    }

    public long lastModified() throws IOException {
      return -1;
    }

    private IOException notSupported() {
      return new IOException("not supported");
    }
  });

  Map<String, Object> result = new HashMap<String, Object>();
  for (String beanName : beanfactory.getBeanDefinitionNames()) {
    result.put(beanName, beanfactory.getBean(beanName));
  }

  return result;
}
项目:gnvc-ims    文件:DaoFactory.java   
public static BrineFreezingDao createBrineFreezingDao() {
    BeanFactory bf = new XmlBeanFactory(new ClassPathResource("dao-beans.xml"));
    return (BrineFreezingDao) bf.getBean("BrineFreezingDao");
}
项目:gnvc-ims    文件:DaoFactory.java   
public static FishBadStockDetailDao createFishBadStockDetailDao() {
    BeanFactory bf = new XmlBeanFactory(new ClassPathResource("dao-beans.xml"));
    return (FishBadStockDetailDao) bf.getBean("FishBadStockDetailDao");
}
项目:gnvc-ims    文件:DaoFactory.java   
public static PtsDtlDao createPtsDtlDao() {
    BeanFactory bf = new XmlBeanFactory(new ClassPathResource("dao-beans.xml"));
    return (PtsDtlDao) bf.getBean("PtsDtlDao");
}
项目:gnvc-ims    文件:DaoFactory.java   
public static FishRrDao createFishRrDao() {
    BeanFactory bf = new XmlBeanFactory(new ClassPathResource("dao-beans.xml"));
    return (FishRrDao) bf.getBean("FishRrDao");
}
项目:snipsnap    文件:SpringContainer.java   
public void init() {
    ClassPathResource res = new ClassPathResource("conf/beans.xml");
    factory = new XmlBeanFactory(res);
}
项目:gnvc-ims    文件:DaoFactory.java   
public static AssignCanvasserDtlDao createAssignCanvasserDtlDao() {
    BeanFactory bf = new XmlBeanFactory(new ClassPathResource("dao-beans.xml"));
    return (AssignCanvasserDtlDao) bf.getBean("AssignCanvasserDtlDao");
}
项目:gnvc-ims    文件:DaoFactory.java   
/**
 *
 */
public static AppMenuGroupDao createAppMenuGroupDao() {
    BeanFactory bf = new XmlBeanFactory(new ClassPathResource("dao-beans.xml"));
    return (AppMenuGroupDao) bf.getBean("AppMenuGroupDao");
}
项目:gnvc-ims    文件:DaoFactory.java   
public static FGPalletTransferDao createFGPalletTransferDao() {
    BeanFactory bf = new XmlBeanFactory(new ClassPathResource("dao-beans.xml"));
    return (FGPalletTransferDao) bf.getBean("FGPalletTransferDao");
}