Package org.springframework.beans.factory.config

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


    protected void createBeanPostProcessor(ParserContext parserContext, String contextId, Element childElement, BeanDefinitionBuilder parentBuilder) {
        String beanPostProcessorId = contextId + ":beanPostProcessor";
        childElement.setAttribute("id", beanPostProcessorId);
        BeanDefinition definition = beanPostProcessorParser.parse(childElement, parserContext);
        definition.getPropertyValues().addPropertyValue("camelContext", new RuntimeBeanReference(contextId));
        parentBuilder.addPropertyReference("beanPostProcessor", beanPostProcessorId);
    }
View Full Code Here


                        BeanDefinition definition = endpointParser.parse(childElement, parserContext);
                        String id = childElement.getAttribute("id");
                        if (ObjectHelper.isNotNullAndNonEmpty(id)) {
                            // TODO we can zap this?
                            definition.getPropertyValues()
                                .addPropertyValue("camelContext", new RuntimeBeanReference(contextId));
                            // definition.getPropertyValues().addPropertyValue("context",
                            // builder.getBeanDefinition());
                            parserContext.registerComponent(new BeanComponentDefinition(definition, id));
                        }
                    } else {
View Full Code Here

    @Override
    public boolean equals(Object other) {
        if (this != other) {
            if (other instanceof RuntimeBeanReference) {
                RuntimeBeanReference br = (RuntimeBeanReference)other;
                return (getBeanName().equals(br.getBeanName()) && this.isToParent() == br.isToParent());
            } else
                return false;
        } else
            return true;
    }
View Full Code Here

                                parserContext.registerComponent(new BeanComponentDefinition(definition, id));
                                // set the templates with the camel context
                                if (localName.equals("template") || localName.equals("consumerTemplate")
                                        || localName.equals("proxy") || localName.equals("export")) {
                                    // set the camel context
                                    definition.getPropertyValues().addPropertyValue("camelContext", new RuntimeBeanReference(contextId));
                                }
                            }
                        }
                    }
                }
View Full Code Here

    private void registerEndpoint(Element childElement, ParserContext parserContext, String contextId) {
        String id = childElement.getAttribute("id");
        // must have an id to be registered
        if (ObjectHelper.isNotEmpty(id)) {
            BeanDefinition definition = endpointParser.parse(childElement, parserContext);
            definition.getPropertyValues().addPropertyValue("camelContext", new RuntimeBeanReference(contextId));
            // Need to add this dependency of CamelContext for Spring 3.0
            try {
                Method method = definition.getClass().getMethod("setDependsOn", String[].class);
                method.invoke(definition, (Object) new String[]{contextId});
            } catch (Exception e) {
View Full Code Here

                {
                    builder.addPropertyValue(refAttribute, element.getAttribute(attrWithRefAttached));
                }
                else
                {
                    builder.addPropertyValue(refAttribute, new RuntimeBeanReference(element.getAttribute(attrWithRefAttached)));
                }
            }
        }

View Full Code Here

    protected void setRef(BeanDefinitionBuilder builder, String propertyName, String ref)
    {
        if (!isMuleExpression(ref))
        {
            builder.addPropertyValue(propertyName, new RuntimeBeanReference(ref));
        }
        else
        {
            builder.addPropertyValue(propertyName, ref);
        }
View Full Code Here

        for (Element childDomElement : childDomElements)
        {
            Object key = null;
            if (hasAttribute(childDomElement, "key-ref"))
            {
                key = new RuntimeBeanReference(childDomElement.getAttribute("key-ref"));
            }
            else
            {
                if (hasAttribute(childDomElement, "key"))
                {
                    key = childDomElement.getAttribute("key");
                }
                else
                {
                    key = childDomElement.getTagName();
                }
            }
            if (hasAttribute(childDomElement, "value-ref"))
            {
                if (!isMuleExpression(childDomElement.getAttribute("value-ref")))
                {
                    managedMap.put(key, new RuntimeBeanReference(childDomElement.getAttribute("value-ref")));
                }
                else
                {
                    managedMap.put(key, childDomElement.getAttribute("value-ref"));
                }
View Full Code Here

    public RuntimeBeanReference parentRef(String refName) {
        return ref(refName,true);
    }

    public RuntimeBeanReference ref(String refName, boolean parentRef) {
        return new RuntimeBeanReference(refName, parentRef);
    }
View Full Code Here

        BeanConfiguration beanConfig = springConfig.getBeanConfig(name);
        if(beanConfig != null) {
          return new ConfigurableRuntimeBeanReference(name, springConfig.getBeanConfig(name) ,false);
        }
        else
          return new RuntimeBeanReference(name,false);
      }
      // this is to deal with the case where the property setter is the last
      // statement in a closure (hence the return value)
      else if(currentBeanConfig != null) {
        if(currentBeanConfig.hasProperty(name))
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.