Examples of containsBean()


Examples of org.springframework.beans.factory.BeanFactory.containsBean()

      throw new BuildException("Cannot execute a null expression");
    }

    BeanFactory beanFactory = getBeanFactory();

    if ((name == null) || !beanFactory.containsBean(name)) {
      throw new BuildException(
          "The BeanFactory does not contain the required bean: ["
              + name + "]");
    }
View Full Code Here

Examples of org.springframework.beans.factory.BeanFactory.containsBean()

                }

                //
                // Check absolute ID first, then relative ID for a match
                //
                if (fullID != null && beanFactory.containsBean(fullID))
                    bean = (T)beanFactory.getBean(fullID, beanClass);
                else if (beanFactory.containsBean(id))
                    bean = (T)beanFactory.getBean(id, beanClass);
            }
View Full Code Here

Examples of org.springframework.beans.factory.BeanFactory.containsBean()

                //
                // Check absolute ID first, then relative ID for a match
                //
                if (fullID != null && beanFactory.containsBean(fullID))
                    bean = (T)beanFactory.getBean(fullID, beanClass);
                else if (beanFactory.containsBean(id))
                    bean = (T)beanFactory.getBean(id, beanClass);
            }

            //
            // Look for a match based upon bean class name
View Full Code Here

Examples of org.springframework.beans.factory.BeanFactory.containsBean()

            //
            // Look for a match based upon bean class name
            //
            String beanClassName = beanClass.getName();
            if (bean == null && beanFactory.containsBean(beanClassName))
                bean = (T)beanFactory.getBean(beanClassName, beanClass);

            if (bean != null)
            {
                //
View Full Code Here

Examples of org.springframework.beans.factory.BeanFactory.containsBean()

    DependenciesBean rod5 = (DependenciesBean) xbf.getBean("rod5");
    // Should not have been autowired
    assertNull(rod5.getSpouse());

    BeanFactory appCtx = (BeanFactory) xbf.getBean("childAppCtx");
    assertTrue(appCtx.containsBean("rod1"));
    assertTrue(appCtx.containsBean("jenny"));
  }

  public void testAutowireWithDefault() throws Exception {
    XmlBeanFactory xbf = new XmlBeanFactory(new ClassPathResource("default-autowire.xml", getClass()));
View Full Code Here

Examples of org.springframework.beans.factory.BeanFactory.containsBean()

    // Should not have been autowired
    assertNull(rod5.getSpouse());

    BeanFactory appCtx = (BeanFactory) xbf.getBean("childAppCtx");
    assertTrue(appCtx.containsBean("rod1"));
    assertTrue(appCtx.containsBean("jenny"));
  }

  public void testAutowireWithDefault() throws Exception {
    XmlBeanFactory xbf = new XmlBeanFactory(new ClassPathResource("default-autowire.xml", getClass()));
View Full Code Here

Examples of org.springframework.beans.factory.config.AutowireCapableBeanFactory.containsBean()

       
        final AutowireCapableBeanFactory beanFactory = getApplicationContext().getAutowireCapableBeanFactory();
       
        AbstractThymeleafView view = BeanUtils.instantiateClass(getViewClass());

        if (beanFactory.containsBean(viewName)) {
            final Class<?> viewBeanType = beanFactory.getType(viewName);
            // viewBeanType could be null if bean is abstract (just a set of properties)
            if (viewBeanType != null && AbstractThymeleafView.class.isAssignableFrom(viewBeanType)) {
                view = (AbstractThymeleafView) beanFactory.configureBean(view, viewName);
            } else {
View Full Code Here

Examples of org.springframework.beans.factory.config.AutowireCapableBeanFactory.containsBean()

       
        final AutowireCapableBeanFactory beanFactory = getApplicationContext().getAutowireCapableBeanFactory();
       
        AbstractThymeleafView view = BeanUtils.instantiateClass(getViewClass());

        if (beanFactory.containsBean(viewName)) {
            final Class<?> viewBeanType = beanFactory.getType(viewName);
            // viewBeanType could be null if bean is abstract (just a set of properties)
            if (viewBeanType != null && AbstractThymeleafView.class.isAssignableFrom(viewBeanType)) {
                view = (AbstractThymeleafView) beanFactory.configureBean(view, viewName);
            } else {
View Full Code Here

Examples of org.springframework.beans.factory.config.ConfigurableBeanFactory.containsBean()

    }

    if (factory instanceof ConfigurableBeanFactory) {
      ConfigurableBeanFactory beanFactory = (ConfigurableBeanFactory) factory;
      for (String autowiredBeanName : autowiredBeanNames) {
        if (beanFactory.containsBean(autowiredBeanName)) {
          beanFactory.registerDependentBean(autowiredBeanName, requestingBeanName);
        }
      }
    }
View Full Code Here

Examples of org.springframework.beans.factory.support.DefaultListableBeanFactory.containsBean()

    lbf.preInstantiateSingletons();

    assertTrue("prototype not instantiated", !DummyFactory.wasPrototypeCreated());
    lbf.getBean("x1");
    assertEquals(TestBean.class, lbf.getType("x1"));
    assertTrue(lbf.containsBean("x1"));
    assertTrue(lbf.containsBean("&x1"));
    assertTrue("prototype was instantiated", DummyFactory.wasPrototypeCreated());
  }

  public void testPrototypeFactoryBeanIgnoredByNonEagerTypeMatching() {
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.