Examples of BeanDefinitionHolder


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

        for (Element childElement : childElements) {
            if ("bean".equals(childElement.getLocalName())) {
                RootBeanDefinition smartInterceptorDef =
                        createSmartInterceptorDefinition(DelegatingSmartSoapEndpointInterceptor.class, childElement,
                                parserContext);
                BeanDefinitionHolder interceptorDef = createInterceptorDefinition(parserContext, childElement);

                smartInterceptorDef.getConstructorArgumentValues().addIndexedArgumentValue(0, interceptorDef);

                registerSmartInterceptor(parserContext, smartInterceptorDef);
            }
            else if ("ref".equals(childElement.getLocalName())) {
                RootBeanDefinition smartInterceptorDef =
                        createSmartInterceptorDefinition(DelegatingSmartSoapEndpointInterceptor.class, childElement,
                                parserContext);

                BeanReference interceptorRef = createInterceptorReference(parserContext, childElement);

                smartInterceptorDef.getConstructorArgumentValues().addIndexedArgumentValue(0, interceptorRef);

                registerSmartInterceptor(parserContext, smartInterceptorDef);

            }
            else if ("payloadRoot".equals(childElement.getLocalName())) {
                List<Element> payloadRootChildren = DomUtils.getChildElements(childElement);
                for (Element payloadRootChild : payloadRootChildren) {
                    if ("bean".equals(payloadRootChild.getLocalName())) {
                        RootBeanDefinition smartInterceptorDef =
                                createSmartInterceptorDefinition(PayloadRootSmartSoapEndpointInterceptor.class,
                                        childElement, parserContext);
                        BeanDefinitionHolder interceptorDef =
                                createInterceptorDefinition(parserContext, payloadRootChild);

                        String namespaceUri = childElement.getAttribute("namespaceUri");
                        String localPart = childElement.getAttribute("localPart");

                        smartInterceptorDef.getConstructorArgumentValues().addIndexedArgumentValue(0, interceptorDef);
                        smartInterceptorDef.getConstructorArgumentValues().addIndexedArgumentValue(1, namespaceUri);
                        smartInterceptorDef.getConstructorArgumentValues().addIndexedArgumentValue(2, localPart);

                        registerSmartInterceptor(parserContext, smartInterceptorDef);
                    }
                    else if ("ref".equals(payloadRootChild.getLocalName())) {
                        RootBeanDefinition smartInterceptorDef =
                                createSmartInterceptorDefinition(PayloadRootSmartSoapEndpointInterceptor.class,
                                        childElement, parserContext);
                        BeanReference interceptorRef = createInterceptorReference(parserContext, payloadRootChild);

                        String namespaceUri = childElement.getAttribute("namespaceUri");
                        String localPart = childElement.getAttribute("localPart");

                        smartInterceptorDef.getConstructorArgumentValues().addIndexedArgumentValue(0, interceptorRef);
                        smartInterceptorDef.getConstructorArgumentValues().addIndexedArgumentValue(1, namespaceUri);
                        smartInterceptorDef.getConstructorArgumentValues().addIndexedArgumentValue(2, localPart);

                        registerSmartInterceptor(parserContext, smartInterceptorDef);
                    }
                }
            }
            else if ("soapAction".equals(childElement.getLocalName())) {
                List<Element> soapActionChildren = DomUtils.getChildElements(childElement);
                for (Element soapActionChild : soapActionChildren) {
                    if ("bean".equals(soapActionChild.getLocalName())) {
                        RootBeanDefinition smartInterceptorDef =
                                createSmartInterceptorDefinition(SoapActionSmartEndpointInterceptor.class, childElement,
                                        parserContext);
                        BeanDefinitionHolder interceptorDef =
                                createInterceptorDefinition(parserContext, soapActionChild);

                        String soapAction = childElement.getAttribute("value");

                        smartInterceptorDef.getConstructorArgumentValues().addIndexedArgumentValue(0, interceptorDef);
View Full Code Here

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

        String mappedInterceptorName = parserContext.getReaderContext().registerWithGeneratedName(smartInterceptorDef);
        parserContext.registerComponent(new BeanComponentDefinition(smartInterceptorDef, mappedInterceptorName));
    }

    private BeanDefinitionHolder createInterceptorDefinition(ParserContext parserContext, Element element) {
        BeanDefinitionHolder interceptorDef = parserContext.getDelegate().parseBeanDefinitionElement(element);
        interceptorDef = parserContext.getDelegate().decorateBeanDefinitionIfRequired(element, interceptorDef);
        return interceptorDef;
    }
View Full Code Here

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

  public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
    if (!beanFactory.containsBean(IntegrationContextUtils.YARN_INTEGRATION_CONVERSION_SERVICE_BEAN_NAME)) {
      if (beanFactory instanceof BeanDefinitionRegistry) {
        BeanDefinitionBuilder conversionServiceBuilder =
            BeanDefinitionBuilder.rootBeanDefinition(CustomConversionServiceFactoryBean.class);
        BeanDefinitionHolder beanDefinitionHolder = new BeanDefinitionHolder(
            conversionServiceBuilder.getBeanDefinition(),
            IntegrationContextUtils.YARN_INTEGRATION_CONVERSION_SERVICE_BEAN_NAME);
        BeanDefinitionReaderUtils.registerBeanDefinition(beanDefinitionHolder, (BeanDefinitionRegistry) beanFactory);
      }
      else if (logger.isWarnEnabled()) {
View Full Code Here

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

    List<Element> childElements = DomUtils.getChildElementsByTagName(element, "bean");
    BeanComponentDefinition innerComponentDefinition = null;
    if (childElements != null && childElements.size() == 1) {
      Element beanElement = childElements.get(0);
      BeanDefinitionParserDelegate delegate = parserContext.getDelegate();
      BeanDefinitionHolder bdHolder = delegate.parseBeanDefinitionElement(beanElement);
      bdHolder = delegate.decorateBeanDefinitionIfRequired(beanElement, bdHolder);
      BeanDefinition inDef = bdHolder.getBeanDefinition();
      innerComponentDefinition = new BeanComponentDefinition(inDef, bdHolder.getBeanName());
    }
    String ref = element.getAttribute(REF_ATTRIBUTE);
    if (StringUtils.hasText(ref) && innerComponentDefinition != null) {
      parserContext.getReaderContext().error(
          "Ambiguous definition. Inner bean "
View Full Code Here

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

      alreadyRegistered = parserContext.getRegistry().isBeanNameInUse(CONFIGURING_POSTPROCESSOR_BEAN_NAME);
    }
    if (!alreadyRegistered) {
      BeanDefinitionBuilder postProcessorBuilder = BeanDefinitionBuilder
          .genericBeanDefinition(ConfiguringBeanFactoryPostProcessor.class);
      BeanDefinitionHolder postProcessorHolder = new BeanDefinitionHolder(
          postProcessorBuilder.getBeanDefinition(), CONFIGURING_POSTPROCESSOR_BEAN_NAME);
      BeanDefinitionReaderUtils.registerBeanDefinition(postProcessorHolder, parserContext.getRegistry());
    }
  }
View Full Code Here

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

          + 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);
    }
View Full Code Here

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

    super(name);
  }

  public void testValidateWithBeanDefinitionHolder() {
    BeanDefinition beanDefinition = createCachingListenerBeanDefinition();
    BeanDefinitionHolder holder = createBeanDefinitionHolder(beanDefinition);

    validator.validate(holder, 0, parserContext);
  }
View Full Code Here

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

    validator.validate(holder, 0, parserContext);
  }

  public void testValidateWithBeanDefinitionNotDescribingCachingListener() {
    BeanDefinition beanDefinition = new RootBeanDefinition(String.class);
    BeanDefinitionHolder holder = createBeanDefinitionHolder(beanDefinition);

    assertValidationThrowsException(holder);
  }
View Full Code Here

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

  }

  private BeanDefinitionHolder createBeanDefinitionHolder(
      BeanDefinition beanDefinition) {
    String beanName = CACHING_LISTENER_BEAN_NAME;
    BeanDefinitionHolder holder = new BeanDefinitionHolder(beanDefinition,
        beanName);
    return holder;
  }
View Full Code Here

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

  public void testParseCacheSetupStrategy() {
    Element proxyElement = proxyElementBuilder.toXml();

    RootBeanDefinition beanDefinition = new RootBeanDefinition(String.class);
    BeanDefinitionHolder holder = new BeanDefinitionHolder(beanDefinition, "beanName");
    beanReferenceParser.parse(proxyElement, parserContext);
    beanReferenceParserControl.setReturnValue(holder);
    beanReferenceParserControl.replay();

    // method to test.
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.