Examples of BeanFactory


Examples of org.springframework.beans.factory.BeanFactory

        SpringBeanFactorySource s = p.getBeanFactorySource();

        if (s == null)
            s = _defaultBeanFactorySource;

        BeanFactory f = s.getBeanFactory();

        return f.getBean(beanName, serviceInterface);
    }
View Full Code Here

Examples of org.springframework.beans.factory.BeanFactory

    {
      return beanFactory.getBeanDefinition(name);
    }
    else
    {
      BeanFactory parent = beanFactory.getParentBeanFactory();
      if ((parent != null) && (parent instanceof ConfigurableListableBeanFactory))
      {
        return getBeanDefinition((ConfigurableListableBeanFactory)parent, name);
      }
      else
View Full Code Here

Examples of org.springframework.beans.factory.BeanFactory

    public void testDefaultFactory()
    {
        SpringLookupFactory lf = new SpringLookupFactory();

        BeanFactory beanFactory = (BeanFactory) newMock(BeanFactory.class);

        ServiceImplementationFactoryParameters fp = (ServiceImplementationFactoryParameters) newMock(ServiceImplementationFactoryParameters.class);

        lf.setDefaultBeanFactory(beanFactory);

        SpringBeanParameter param = buildParameter("fred", null);

        Object fred = new Object();

        beanFactory.getBean("fred", List.class);
        setReturnValue(beanFactory, fred);

        fp.getFirstParameter();
        setReturnValue(fp, param);
View Full Code Here

Examples of org.springframework.beans.factory.BeanFactory

    }

    public void testBeanSpecificFactory()
    {
        SpringLookupFactory lf = new SpringLookupFactory();
        BeanFactory beanFactory = (BeanFactory) newMock(BeanFactory.class);

        ServiceImplementationFactoryParameters fp = (ServiceImplementationFactoryParameters) newMock(ServiceImplementationFactoryParameters.class);

        SpringBeanParameter param = buildParameter("fred", beanFactory);

        Object fred = new Object();

        beanFactory.getBean("fred", List.class);
        setReturnValue(beanFactory, fred);

        fp.getFirstParameter();
        setReturnValue(fp, param);
View Full Code Here

Examples of org.springframework.beans.factory.BeanFactory

        // Spring setup

        ClassPathResource springBeansResource = new ClassPathResource("SpringBeans.xml",
                TestSpringLookupFactory.class);

        BeanFactory beanFactory = new XmlBeanFactory(springBeansResource);

        Registry r = buildFrameworkRegistry("SpringIntegration.xml");

        SpringBeanFactoryHolder h = (SpringBeanFactoryHolder) r.getService(
                "hivemind.lib.DefaultSpringBeanFactoryHolder",
View Full Code Here

Examples of org.springframework.beans.factory.BeanFactory

            ServiceImplementationFactoryParameters factoryParameters)
    {
        SpringBeanParameter p = (SpringBeanParameter) factoryParameters.getFirstParameter();
        String beanName = p.getName();

        BeanFactory f = p.getBeanFactory();

        if (f == null)
            f = _defaultBeanFactory;

        return f.getBean(beanName, factoryParameters.getServiceInterface());
    }
View Full Code Here

Examples of org.springframework.beans.factory.BeanFactory

{
    public void testBasic()
    {
        Object bean = new Object();
        MockControl control = newControl(BeanFactory.class);
        BeanFactory bf = (BeanFactory) control.getMock();

        bf.getBean("fred");
        control.setReturnValue(bean);

        replayControls();

        SpringObjectProvider p = new SpringObjectProvider();
View Full Code Here

Examples of org.springframework.beans.factory.BeanFactory

        // Spring setup

        ClassPathResource springBeansResource = new ClassPathResource("SpringBeans.xml",
                TestSpringLookupFactory.class);

        BeanFactory beanFactory = new XmlBeanFactory(springBeansResource);

        Registry r = buildFrameworkRegistry("SpringProvider.xml");

        SpringBeanFactoryHolder h = (SpringBeanFactoryHolder) r.getService(
                "hivemind.lib.DefaultSpringBeanFactoryHolder",
View Full Code Here

Examples of org.springframework.beans.factory.BeanFactory

{
    public void testBasic()
    {
        Object bean = new Object();
        MockControl control = newControl(BeanFactory.class);
        BeanFactory bf = (BeanFactory) control.getMock();

        bf.getBean("fred");
        control.setReturnValue(bean);

        replayControls();

        SpringObjectProvider p = new SpringObjectProvider();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.