Package org.springframework.beans.factory

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


    configurer.setBeanFactory(bf);

    final String beanName = props.getProperty(BEAN_NAME_PROP);
    // key specified, search for a bean
    if (beanName != null) {
      if (!bf.containsBean(beanName)) {
        throw new IllegalArgumentException("Cannot find bean named '" + beanName + "'");
      }
      configurer.setBeanWiringInfoResolver(new BeanWiringInfoResolver() {

        public BeanWiringInfo resolveWiringInfo(Object beanInstance) {
View Full Code Here


                }

                //
                // 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

                //
                // 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

            //
            // 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

    ServiceReferenceInjectionBeanPostProcessor p = new ServiceReferenceInjectionBeanPostProcessor();
    p.setBundleContext(context);
    p.setBeanClassLoader(getClass().getClassLoader());
    MockControl factoryControl = MockControl.createControl(BeanFactory.class);
    BeanFactory factory = (BeanFactory) factoryControl.getMock();
    factoryControl.expectAndReturn(factory.containsBean("&myBean"), true);
    factoryControl.replay();
    p.setBeanFactory(factory);

    p.postProcessAfterInitialization(bean, "myBean");
    assertSame(bean1.getId(), bean.getServiceBean().getId());
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.