Package org.springframework.beans.factory.parsing

Examples of org.springframework.beans.factory.parsing.CompositeComponentDefinition


  protected static final String CONCURRENCY_ATTRIBUTE = "concurrency";

  protected static final String PREFETCH_ATTRIBUTE = "prefetch";

  public BeanDefinition parse(Element element, ParserContext parserContext) {
    CompositeComponentDefinition compositeDef =
      new CompositeComponentDefinition(element.getTagName(), parserContext.extractSource(element));
    parserContext.pushContainingComponent(compositeDef);

    NodeList childNodes = element.getChildNodes();
    for (int i = 0; i < childNodes.getLength(); i++) {
      Node child = childNodes.item(i);
View Full Code Here


    }

    // Actually scan for bean definitions and register them.
    Set<BeanDefinitionHolder> beanDefinitions = scanner.doScan(basePackages);

    CompositeComponentDefinition compositeDef = new CompositeComponentDefinition(element.getTagName(), source);
    for (Iterator it = beanDefinitions.iterator(); it.hasNext();) {
      BeanDefinitionHolder beanDefHolder = (BeanDefinitionHolder) it.next();
      AbstractBeanDefinition beanDef = (AbstractBeanDefinition) beanDefHolder.getBeanDefinition();
      beanDef.setSource(parserContext.extractSource(beanDef.getSource()));
      compositeDef.addNestedComponent(new BeanComponentDefinition(beanDefHolder));
    }
    parserContext.getReaderContext().fireComponentRegistered(compositeDef);

    // Register annotation config processors, if necessary.
    if (annotationConfig) {
View Full Code Here

 
  private ParseState parseState = new ParseState();
 

  public BeanDefinition parse(Element element, ParserContext parserContext) {
    CompositeComponentDefinition compositeDef =
        new CompositeComponentDefinition(element.getTagName(), parserContext.extractSource(element));
    parserContext.pushContainingComponent(compositeDef);

    configureAutoProxyCreator(parserContext, element);

    NodeList childNodes = element.getChildNodes();
View Full Code Here

  public void popAndRegisterContainingComponent() {
    registerComponent(popContainingComponent());
  }

  public void registerComponent(ComponentDefinition component) {
    CompositeComponentDefinition containingComponent = getContainingComponent();
    if (containingComponent != null) {
      containingComponent.addNestedComponent(component);
    }
    else {
      this.readerContext.fireComponentRegistered(component);
    }
  }
View Full Code Here

        if (element.hasAttribute("order")) {
          advisorDef.getPropertyValues().addPropertyValue("order", element.getAttribute("order"));
        }
        parserContext.getRegistry().registerBeanDefinition(TRANSACTION_ADVISOR_BEAN_NAME, advisorDef);

        CompositeComponentDefinition compositeDef = new CompositeComponentDefinition(element.getTagName(), eleSource);
        compositeDef.addNestedComponent(new BeanComponentDefinition(sourceDef, sourceName));
        compositeDef.addNestedComponent(new BeanComponentDefinition(interceptorDef, interceptorName));
        compositeDef.addNestedComponent(new BeanComponentDefinition(advisorDef, TRANSACTION_ADVISOR_BEAN_NAME));
        parserContext.registerComponent(compositeDef);
      }
    }
View Full Code Here

  protected static final String PREFETCH_ATTRIBUTE = "prefetch";


  public BeanDefinition parse(Element element, ParserContext parserContext) {
    CompositeComponentDefinition compositeDef =
      new CompositeComponentDefinition(element.getTagName(), parserContext.extractSource(element));
    parserContext.pushContainingComponent(compositeDef);

    NodeList childNodes = element.getChildNodes();
    for (int i = 0; i < childNodes.getLength(); i++) {
      Node child = childNodes.item(i);
View Full Code Here

    // Obtain bean definitions for all relevant BeanPostProcessors.
    Set<BeanDefinitionHolder> processorDefinitions =
        AnnotationConfigUtils.registerAnnotationConfigProcessors(parserContext.getRegistry(), source);

    // Register component for the surrounding <context:annotation-config> element.
    CompositeComponentDefinition compDefinition = new CompositeComponentDefinition(element.getTagName(), source);
    parserContext.pushContainingComponent(compDefinition);

    // Nest the concrete beans in the surrounding component.
    for (BeanDefinitionHolder processorDefinition : processorDefinitions) {
      parserContext.registerComponent(new BeanComponentDefinition(processorDefinition));
View Full Code Here

  protected void registerComponents(
      XmlReaderContext readerContext, Set<BeanDefinitionHolder> beanDefinitions, Element element) {

    Object source = readerContext.extractSource(element);
    CompositeComponentDefinition compositeDef = new CompositeComponentDefinition(element.getTagName(), source);

    for (Iterator it = beanDefinitions.iterator(); it.hasNext();) {
      BeanDefinitionHolder beanDefHolder = (BeanDefinitionHolder) it.next();
      compositeDef.addNestedComponent(new BeanComponentDefinition(beanDefHolder));
    }

    // Register annotation config processors, if necessary.
    boolean annotationConfig = true;
    if (element.hasAttribute(ANNOTATION_CONFIG_ATTRIBUTE)) {
      annotationConfig = Boolean.valueOf(element.getAttribute(ANNOTATION_CONFIG_ATTRIBUTE));
    }
    if (annotationConfig) {
      Set<BeanDefinitionHolder> processorDefinitions =
          AnnotationConfigUtils.registerAnnotationConfigProcessors(readerContext.getRegistry(), source);
      for (BeanDefinitionHolder processorDefinition : processorDefinitions) {
        compositeDef.addNestedComponent(new BeanComponentDefinition(processorDefinition));
      }
    }

    readerContext.fireComponentRegistered(compositeDef);
  }
View Full Code Here

  public void popAndRegisterContainingComponent() {
    registerComponent(popContainingComponent());
  }

  public void registerComponent(ComponentDefinition component) {
    CompositeComponentDefinition containingComponent = getContainingComponent();
    if (containingComponent != null) {
      containingComponent.addNestedComponent(component);
    }
    else {
      this.readerContext.fireComponentRegistered(component);
    }
  }
View Full Code Here

 
  private ParseState parseState = new ParseState();
 

  public BeanDefinition parse(Element element, ParserContext parserContext) {
    CompositeComponentDefinition compositeDef =
        new CompositeComponentDefinition(element.getTagName(), parserContext.extractSource(element));
    parserContext.pushContainingComponent(compositeDef);

    configureAutoProxyCreator(parserContext, element);

    NodeList childNodes = element.getChildNodes();
View Full Code Here

TOP

Related Classes of org.springframework.beans.factory.parsing.CompositeComponentDefinition

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.