Examples of BeanDefinitionHolder


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

  private void registerStateHandlerAnnotationBeanFactoryPostProcessor(Element element, ParserContext context) {
    Class clz = StateHandlerAnnotationBeanFactoryPostProcessor.class;
    BeanDefinitionBuilder postProcessorBuilder = BeanDefinitionBuilder.genericBeanDefinition(clz.getName());

    BeanDefinitionHolder postProcessorHolder = new BeanDefinitionHolder(
        postProcessorBuilder.getBeanDefinition(),
        ActivitiContextUtils.ANNOTATION_STATE_HANDLER_BEAN_FACTORY_POST_PROCESSOR_BEAN_NAME);
    configureProcessEngine(postProcessorBuilder.getBeanDefinition(), element);
    BeanDefinitionReaderUtils.registerBeanDefinition(postProcessorHolder, context.getRegistry());
View Full Code Here

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

      RootBeanDefinition rootBeanDefinition = new RootBeanDefinition();
      rootBeanDefinition.setBeanClassName( registryName );
      rootBeanDefinition.getPropertyValues().addPropertyValue("processEngine", this.processEngine);

      BeanDefinitionHolder holder = new BeanDefinitionHolder(rootBeanDefinition, registryBeanName);
      BeanDefinitionReaderUtils.registerBeanDefinition(holder, registry);
    }
  }
View Full Code Here

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

                    throw new IllegalStateException("<ref> elements must have a \"bean\" attribute!");
                }
                bean.addPropertyReference(propertyName, id);
                return;
            } else if ("bean".equals(name)) {
                BeanDefinitionHolder bdh = ctx.getDelegate().parseBeanDefinitionElement(first);
                child = bdh.getBeanDefinition();
                bean.addPropertyValue(propertyName, child);
                return;
            } else {
                throw new UnsupportedOperationException("Elements with the name " + name 
                                                        + " are not currently "
View Full Code Here

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

                    throw new IllegalStateException("<ref> elements must have a \"bean\" attribute!");
                }
                bean.addPropertyReference(propertyName, id);
                return;
            } else if ("bean".equals(name)) {
                BeanDefinitionHolder bdh = ctx.getDelegate().parseBeanDefinitionElement(first);
                child = bdh.getBeanDefinition();
                bean.addPropertyValue(propertyName, child);
                return;
            } else {
                throw new UnsupportedOperationException("Elements with the name " + name 
                                                        + " are not currently "
View Full Code Here

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

                connectionNames.put(key.getValue(), beanNameReference.getBeanName());
            }
            servletFactoryDefBuilder.addPropertyValue("connectionServiceNames", connectionNames);
        }

        return new BeanDefinitionHolder(servletFactoryDefBuilder.getBeanDefinition(), holder.getBeanName());
    }
View Full Code Here

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

    // delegate to subclass for interceptor def
    BeanDefinition interceptorDefinition = createInterceptorDefinition(node);

    // generate name and register the interceptor
    String interceptorName = existingBeanName + "." + getInterceptorNameSuffix(interceptorDefinition);
    BeanDefinitionReaderUtils.registerBeanDefinition(new BeanDefinitionHolder(interceptorDefinition, interceptorName), registry);

    BeanDefinitionHolder result = definitionHolder;

    if (!isProxyFactoryBeanDefinition(existingDefinition)) {

      // create the proxy definitionHolder
      RootBeanDefinition proxyDefinition = new RootBeanDefinition();
      // create proxy factory bean definitionHolder
      proxyDefinition.setBeanClass(ProxyFactoryBean.class);

      // set up property values
      MutablePropertyValues mpvs = new MutablePropertyValues();
      proxyDefinition.setPropertyValues(mpvs);

      // set the target
      mpvs.addPropertyValue("target", existingDefinition);

      // create the interceptor names list
      ManagedList interceptorList = new ManagedList();
      mpvs.addPropertyValue("interceptorNames", interceptorList);

      result = new BeanDefinitionHolder(proxyDefinition, existingBeanName);
    }

    addInterceptorNameToList(interceptorName, result.getBeanDefinition());

    return result;

  }
View Full Code Here

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

    // Register the target bean as separate bean in the factory.
    registry.registerBeanDefinition(targetBeanName, targetDefinition);

    // Return the scoped proxy definition as primary bean definition
    // (potentially an inner bean).
    return new BeanDefinitionHolder(scopedProxyDefinition, originalBeanName, definition.getAliases());
  }
View Full Code Here

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

  public void testBeanDefinitionHolderEquality() {
    RootBeanDefinition bd = new RootBeanDefinition(TestBean.class);
    bd.setAbstract(true);
    bd.setLazyInit(true);
    bd.setScope("request");
    BeanDefinitionHolder holder = new BeanDefinitionHolder(bd, "bd");
    RootBeanDefinition otherBd = new RootBeanDefinition(TestBean.class);
    assertTrue(!bd.equals(otherBd));
    assertTrue(!otherBd.equals(bd));
    otherBd.setAbstract(true);
    otherBd.setLazyInit(true);
    otherBd.setScope("request");
    BeanDefinitionHolder otherHolder = new BeanDefinitionHolder(bd, "bd");
    assertTrue(holder.equals(otherHolder));
    assertTrue(otherHolder.equals(holder));
    assertTrue(holder.hashCode() == otherHolder.hashCode());
  }
View Full Code Here

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

                    throw new IllegalStateException("<ref> elements must have a \"bean\" attribute!");
                }
                bean.addPropertyReference(propertyName, id);
                return;
            } else if ("bean".equals(name)) {
                BeanDefinitionHolder bdh = ctx.getDelegate().parseBeanDefinitionElement(first);
                child = bdh.getBeanDefinition();
                bean.addPropertyValue(propertyName, child);
                return;
            } else {
                throw new UnsupportedOperationException("Elements with the name " + name 
                                                        + " are not currently "
View Full Code Here

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

//            parseSetElement(element, bd);
//        }

        else if (SpringXMLUtils.isLocalName(element, BEAN_ELEMENT))
        {
            BeanDefinitionHolder holder = parseBeanDefinitionElement(element, parent);
            registerBeanDefinitionHolder(holder);
            return holder.getBeanDefinition();
        }
        else
        {
            throw new IllegalStateException("Unexpected Spring element: " + SpringXMLUtils.elementToString(element));
        }
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.