Package org.springframework.beans.factory.config

Examples of org.springframework.beans.factory.config.RuntimeBeanReference


    String attr = element.getAttribute(attrName);
    if (StringUtils.hasText(attr)) {
      String[] strs = StringUtils.commaDelimitedListToStringArray(attr);
      ManagedList<RuntimeBeanReference> list = new ManagedList<RuntimeBeanReference>(strs.length);
      for (int i = 0; i < strs.length; i++) {
        list.add(new RuntimeBeanReference(strs[i].trim()));
      }
      builder.addPropertyValue(propertyName, list);
      return true;
    }
    return false;
View Full Code Here


    String attr = element.getAttribute(attrName);
    if (StringUtils.hasText(attr)) {
      String[] strs = StringUtils.commaDelimitedListToStringArray(attr);
      ManagedList<RuntimeBeanReference> list = new ManagedList<RuntimeBeanReference>(strs.length);
      for (int i = 0; i < strs.length; i++) {
        list.add(new RuntimeBeanReference(strs[i].trim()));
      }
      builder.addPropertyValue(propertyName, list);
      return true;
    }
    return false;
View Full Code Here

    b.addPropertyValue("propertiesArray", propsArray);

    String attr = element.getAttribute("properties-ref");
    if (StringUtils.hasText(attr)) {
      hasProperties = true;
      propsArray.add(new RuntimeBeanReference(attr));
    }

    hasProperties |= NamespaceUtils.setCSVProperty(element, b, "properties-location", "locations");

    // parse nested properties
View Full Code Here

      this.converters.add(converterDefinition);
    } else {
      String beanName = element.getAttribute("ref");
      Assert.isTrue(StringUtils.hasText(beanName),
          "Either a 'ref' attribute pointing to a Converter or a <bean> sub-element defining a Converter is required.");
      this.converters.add(new RuntimeBeanReference(beanName));
    }
    return null;
  }
View Full Code Here

       
        BeanDefinitionBuilder beanBuilder = BeanDefinitionBuilder.rootBeanDefinition(FlipSpringAspect.class);
        String defaultUrlValue = element.getAttribute("default-url");
        MutablePropertyValues propertyValues = new MutablePropertyValues();
        propertyValues.addPropertyValue("defaultValue", defaultUrlValue);
        propertyValues.addPropertyValue(FlipSpringAspect.FEATURE_SERVICE_BEAN_NAME, new RuntimeBeanReference(FlipSpringAspect.FEATURE_SERVICE_BEAN_NAME));
        beanBuilder.getRawBeanDefinition().setPropertyValues(propertyValues);
       
        for(String name : factory.getBeanDefinitionNames()) {
            parserContext.getRegistry().registerBeanDefinition(name, factory.getBeanDefinition(name));
        }
View Full Code Here

    // no implementation.
  }

  protected final void onSetUp() throws Exception {
    propertySource = new CacheSetupStrategyPropertySource(
        new RuntimeBeanReference("cacheKeyGenerator"),
        new RuntimeBeanReference("cacheProvider"), new ArrayList(),
        new HashMap(), new HashMap());

    afterSetUp();
  }
View Full Code Here

      throw new IllegalStateException(
          "An implementation of CacheProviderFacade should be registered under the name "
              + StringUtils.quote(cacheProviderFacadeId));
    }

    RuntimeBeanReference cacheProviderFacadeReference = new RuntimeBeanReference(
        cacheProviderFacadeId);

    Object cacheKeyGenerator = parseCacheKeyGenerator(element, parserContext);
    List cachingListeners = parseCachingListeners(element, parserContext);
    Map cachingModels = parseCachingModels(element);
View Full Code Here

  public Object parse(Element element, ParserContext parserContext,
            boolean registerInnerBean) {

    String refId = element.getAttribute("refId");
    if (StringUtils.hasText(refId)) {
      return new RuntimeBeanReference(refId);
    }

    Element beanElement = null;
    List beanElements = DomUtils.getChildElementsByTagName(element, "bean");
    if (!CollectionUtils.isEmpty(beanElements)) {
      beanElement = (Element) beanElements.get(0);
    }
    if (beanElement == null) {
      throw new IllegalStateException("The XML element "
          + StringUtils.quote(element.getNodeName()) + " should either have a "
          + "reference to an already registered bean definition or contain a "
          + "bean definition");
    }

    BeanDefinitionHolder holder = parserContext.getDelegate()
        .parseBeanDefinitionElement(beanElement);

    String beanName = holder.getBeanName();

    if (registerInnerBean && StringUtils.hasText(beanName)) {
      BeanDefinitionRegistry registry = parserContext.getRegistry();
      BeanDefinition beanDefinition = holder.getBeanDefinition();
      registry.registerBeanDefinition(beanName, beanDefinition);

      return new RuntimeBeanReference(beanName);
    }

    return holder;
  }
View Full Code Here

  private void registerCachingAdvisor(BeanDefinitionRegistry registry) {
    Class cachingAdvisorClass = CachingAttributeSourceAdvisor.class;
    RootBeanDefinition cachingAdvisor = new RootBeanDefinition(
        cachingAdvisorClass);
    cachingAdvisor.getConstructorArgumentValues().addGenericArgumentValue(
        new RuntimeBeanReference(BeanName.CACHING_INTERCEPTOR));
    registry.registerBeanDefinition(cachingAdvisorClass.getName(),
        cachingAdvisor);
  }
View Full Code Here

        .getBeanDefinition(beanName);

    ConfigAssert.assertBeanDefinitionWrapsClass(definition, targetClass);

    PropertyValue expected = new PropertyValue("cachingAttributeSource",
        new RuntimeBeanReference(beanName));

    ConfigAssert.assertPropertyIsPresent(propertyValues, expected);
  }
View Full Code Here

TOP

Related Classes of org.springframework.beans.factory.config.RuntimeBeanReference

Copyright © 2018 www.massapicom. 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.