@Override public AbstractBeanDefinition cloneBeanDefinition() { return new ChildBeanDefinition(this); }
/** * Create a new ChildBeanDefinition for the given parent, * providing constructor arguments and property values. * Takes a bean class name to avoid eager loading of the bean class. * @param parentName the name of the parent bean * @param beanClassName the name of the class to instantiate * @param cargs the constructor argument values to apply * @param pvs the property values to apply */ public ChildBeanDefinition( String parentName, String beanClassName, ConstructorArgumentValues cargs, MutablePropertyValues pvs) { super(cargs, pvs); this.parentName = parentName; setBeanClassName(beanClassName); }
/** * Create a new ChildBeanDefinition for the given parent, * providing constructor arguments and property values. * @param parentName the name of the parent bean * @param beanClass the class of the bean to instantiate * @param cargs the constructor argument values to apply * @param pvs the property values to apply */ public ChildBeanDefinition( String parentName, Class<?> beanClass, ConstructorArgumentValues cargs, MutablePropertyValues pvs) { super(cargs, pvs); this.parentName = parentName; setBeanClass(beanClass); }
/** * @see org.apache.cocoon.core.container.spring.avalon.BridgeElementParser#createComponents(org.w3c.dom.Element, org.apache.cocoon.core.container.spring.avalon.ConfigurationInfo, org.springframework.beans.factory.support.BeanDefinitionRegistry, org.springframework.beans.factory.support.BeanDefinitionReader, org.springframework.core.io.ResourceLoader) */ public void createComponents(Element element, ConfigurationInfo info, BeanDefinitionRegistry registry, BeanDefinitionReader reader, ResourceLoader resourceLoader) throws Exception { super.createComponents(element, info, registry, reader, resourceLoader); // add string template parser for sitemap variable substitution final ChildBeanDefinition beanDef = new ChildBeanDefinition("org.apache.cocoon.template.expression.AbstractStringTemplateParser"); beanDef.setBeanClassName("org.apache.cocoon.components.treeprocessor.variables.LegacySitemapStringTemplateParser"); beanDef.setSingleton(true); beanDef.setLazyInit(false); beanDef.getPropertyValues().addPropertyValue("serviceManager", new RuntimeBeanReference("org.apache.avalon.framework.service.ServiceManager")); this.register(beanDef, "org.apache.cocoon.el.parsing.StringTemplateParser/legacySitemap", null, registry); final RootBeanDefinition resolverDef = new RootBeanDefinition(); resolverDef.setBeanClassName("org.apache.cocoon.components.treeprocessor.variables.StringTemplateParserVariableResolver"); resolverDef.setLazyInit(false); resolverDef.setScope("prototype"); resolverDef.getPropertyValues().addPropertyValue("stringTemplateParser", new RuntimeBeanReference("org.apache.cocoon.el.parsing.StringTemplateParser/legacySitemap")); resolverDef.getPropertyValues().addPropertyValue("objectModel", new RuntimeBeanReference("org.apache.cocoon.el.objectmodel.ObjectModel")); this.register(resolverDef, "org.apache.cocoon.components.treeprocessor.variables.VariableResolver", null, registry); }
if (generatedId == null) { if (beanDefinition instanceof ChildBeanDefinition) { generatedId = ((ChildBeanDefinition) beanDefinition).getParentName() + "$child";
RootBeanDefinition pbd = null; try { if (!beanName.equals(cbd.getParentName())) { pbd = getMergedBeanDefinition(cbd.getParentName(), true); pbd = parentFactory.getMergedBeanDefinition(cbd.getParentName(), true); throw new NoSuchBeanDefinitionException(cbd.getParentName(), "Parent name '" + cbd.getParentName() + "' is equal to bean name '" + beanName + "': cannot be resolved without an AbstractBeanFactory parent"); throw new BeanDefinitionStoreException(cbd.getResourceDescription(), beanName, "Could not resolve parent bean definition '" + cbd.getParentName() + "'", ex);
String parent = childBeanDefinition.getParentName();
/** * Create a new {@code BeanDefinitionBuilder} used to construct a {@link ChildBeanDefinition}. * @param parentName the name of the parent bean */ public static BeanDefinitionBuilder childBeanDefinition(String parentName) { return new BeanDefinitionBuilder(new ChildBeanDefinition(parentName)); }
/** * Create a new ChildBeanDefinition for the given parent, * providing constructor arguments and property values. * Takes a bean class name to avoid eager loading of the bean class. * @param parentName the name of the parent bean * @param beanClassName the name of the class to instantiate * @param cargs the constructor argument values to apply * @param pvs the property values to apply */ public ChildBeanDefinition( String parentName, String beanClassName, ConstructorArgumentValues cargs, MutablePropertyValues pvs) { super(cargs, pvs); this.parentName = parentName; setBeanClassName(beanClassName); }
/** * Create a new ChildBeanDefinition for the given parent, * providing constructor arguments and property values. * @param parentName the name of the parent bean * @param beanClass the class of the bean to instantiate * @param cargs the constructor argument values to apply * @param pvs the property values to apply */ public ChildBeanDefinition( String parentName, Class<?> beanClass, ConstructorArgumentValues cargs, MutablePropertyValues pvs) { super(cargs, pvs); this.parentName = parentName; setBeanClass(beanClass); }
String parent = childBeanDefinition.getParentName();
@Override public AbstractBeanDefinition cloneBeanDefinition() { return new ChildBeanDefinition(this); }
/** * Create a new ChildBeanDefinition for the given parent, * providing constructor arguments and property values. * Takes a bean class name to avoid eager loading of the bean class. * @param parentName the name of the parent bean * @param beanClassName the name of the class to instantiate * @param cargs the constructor argument values to apply * @param pvs the property values to apply */ public ChildBeanDefinition( String parentName, String beanClassName, ConstructorArgumentValues cargs, MutablePropertyValues pvs) { super(cargs, pvs); this.parentName = parentName; setBeanClassName(beanClassName); }
/** * Create a new ChildBeanDefinition for the given parent, * providing constructor arguments and property values. * @param parentName the name of the parent bean * @param beanClass the class of the bean to instantiate * @param cargs the constructor argument values to apply * @param pvs the property values to apply */ public ChildBeanDefinition( String parentName, Class beanClass, ConstructorArgumentValues cargs, MutablePropertyValues pvs) { super(cargs, pvs); this.parentName = parentName; setBeanClass(beanClass); }
/** * Create a new {@code BeanDefinitionBuilder} used to construct a {@link ChildBeanDefinition}. * @param parentName the name of the parent bean */ public static BeanDefinitionBuilder childBeanDefinition(String parentName) { return new BeanDefinitionBuilder(new ChildBeanDefinition(parentName)); }
/** * Create a new ChildBeanDefinition for the given parent, * providing constructor arguments and property values. * Takes a bean class name to avoid eager loading of the bean class. * @param parentName the name of the parent bean * @param beanClassName the name of the class to instantiate * @param cargs the constructor argument values to apply * @param pvs the property values to apply */ public ChildBeanDefinition( String parentName, String beanClassName, ConstructorArgumentValues cargs, MutablePropertyValues pvs) { super(cargs, pvs); this.parentName = parentName; setBeanClassName(beanClassName); }
/** * Create a new ChildBeanDefinition for the given parent, * providing constructor arguments and property values. * @param parentName the name of the parent bean * @param beanClass the class of the bean to instantiate * @param cargs the constructor argument values to apply * @param pvs the property values to apply */ public ChildBeanDefinition( String parentName, Class beanClass, ConstructorArgumentValues cargs, MutablePropertyValues pvs) { super(cargs, pvs); this.parentName = parentName; setBeanClass(beanClass); }
protected AbstractBeanDefinition createBeanDefinition() { AbstractBeanDefinition bd; if(constructorArgs.size() > 0) { ConstructorArgumentValues cav = new ConstructorArgumentValues(); for (Object constructorArg : constructorArgs) { cav.addGenericArgumentValue(constructorArg); } if(StringUtils.isBlank(parentName)) { bd = new RootBeanDefinition(clazz,cav,null); } else { bd = new ChildBeanDefinition(parentName,clazz,cav, null); } bd.setSingleton(singleton); } else { if(StringUtils.isBlank(parentName)) { bd = new RootBeanDefinition(clazz,singleton); } else { bd = new ChildBeanDefinition(parentName,clazz, null,null); bd.setSingleton(singleton); } } wrapper = new BeanWrapperImpl(bd); return bd; }
/** * Create a new ChildBeanDefinition for the given parent, * providing constructor arguments and property values. * Takes a bean class name to avoid eager loading of the bean class. * @param parentName the name of the parent bean * @param beanClassName the name of the class to instantiate * @param cargs the constructor argument values to apply * @param pvs the property values to apply */ public ChildBeanDefinition( String parentName, String beanClassName, ConstructorArgumentValues cargs, MutablePropertyValues pvs) { super(cargs, pvs); this.parentName = parentName; setBeanClassName(beanClassName); }
/** * Create a new ChildBeanDefinition for the given parent, * providing constructor arguments and property values. * @param parentName the name of the parent bean * @param beanClass the class of the bean to instantiate * @param cargs the constructor argument values to apply * @param pvs the property values to apply */ public ChildBeanDefinition( String parentName, Class<?> beanClass, ConstructorArgumentValues cargs, MutablePropertyValues pvs) { super(cargs, pvs); this.parentName = parentName; setBeanClass(beanClass); }