org.mule.config.spring.parsers.assembly
Class TwoStageMapBeanAssembler

java.lang.Object
  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:
BeanAssembler

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).


Field Summary
 
Fields inherited from class org.mule.config.spring.parsers.assembly.DefaultBeanAssembler
bean, target, targetConfig
 
Constructor Summary
TwoStageMapBeanAssembler(TwoStageMapBeanAssemblerFactory.BeanAssemblerStore store, PropertyConfiguration beanConfig, org.springframework.beans.factory.support.BeanDefinitionBuilder 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
insertDefinitionAsMap
 
Methods inherited from class org.mule.config.spring.parsers.assembly.DefaultBeanAssembler
addAnnotationValue, addPropertyWithoutReference, addPropertyWithReference, assertTargetPresent, bestGuessName, copyBeanToTarget, extendBean, extendBean, extendTarget, extendTarget, extendTarget, getBean, getBeanConfig, getTarget, getTargetConfig, insertInTarget, insertSingletonBeanInTarget, isAnnotationsPropertyAvailable, isAnnotationsPropertyAvailable, methodExists, retrieveList, setBean, setBeanFlag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TwoStageMapBeanAssembler

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

insertBeanInTarget

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
Overrides:
insertBeanInTarget in class DefaultBeanAssembler
Parameters:
oldName - The identifying the bean (typically element name).


Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.