Class TwoStageMapBeanAssembler

  extended by org.mule.config.spring.parsers.assembly.DefaultBeanAssembler
      extended by org.mule.config.spring.parsers.assembly.AbstractMapBeanAssembler
          extended by org.mule.config.spring.parsers.assembly.TwoStageMapBeanAssembler
All Implemented Interfaces:

public class TwoStageMapBeanAssembler
extends AbstractMapBeanAssembler

This is used by MapDefinitionParserMutator - it takes a normal bean definition and re-packages it as a map (rather than individual values). The difference between this and AttributeMapBeanAssemblerFactory is that this allows child elements to generate the properties (it's an ugly consequence of the fact that BDPs are called before nested children - this is a hack that gets "re-called" after the children to complete the work).

Constructor Summary
TwoStageMapBeanAssembler(TwoStageMapBeanAssemblerFactory.BeanAssemblerStore store, PropertyConfiguration beanConfig, bean, PropertyConfiguration targetConfig, org.springframework.beans.factory.config.BeanDefinition target)
Method Summary
 void insertBeanInTarget(String oldName)
          We overwrite this method to populate a map instead of inserting the definition.
Methods inherited from class org.mule.config.spring.parsers.assembly.AbstractMapBeanAssembler
Methods inherited from class org.mule.config.spring.parsers.assembly.DefaultBeanAssembler
addPropertyWithoutReference, addPropertyWithReference, assertTargetPresent, bestGuessName, copyBeanToTarget, extendBean, extendBean, extendTarget, extendTarget, extendTarget, getBean, getBeanConfig, getTarget, getTargetConfig, methodExists, setBean, setBeanFlag
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public TwoStageMapBeanAssembler(TwoStageMapBeanAssemblerFactory.BeanAssemblerStore store,
                                PropertyConfiguration beanConfig,
                                PropertyConfiguration targetConfig,
                                org.springframework.beans.factory.config.BeanDefinition target)
Method Detail


public void insertBeanInTarget(String oldName)
We overwrite this method to populate a map instead of inserting the definition. However, the bean definition is not complete until all child elements have been parsed - and that parsing happens after this routine is called. So on first pass we set a flag in the definition. This is picked up by the main driver loop (MuleHierarchicalBeanDefinitionParserDelegate) and our enclosing bean definition parser is called again. At the same time, to avoid complicating otherwise "normal" BDPs, we pass this assembler to a callback, so that it can be called the second time in a more direct way.

Specified by:
insertBeanInTarget in interface BeanAssembler
insertBeanInTarget in class DefaultBeanAssembler
oldName - The identifying the bean (typically element name).

Copyright © 2003-2009 MuleSource, Inc.. All Rights Reserved.