public class BeanDefinitionFactory extends Object
BeanDefinitionFactory is the one that knows how to convert a ComponentModel to an actual
BeanDefinition that can later be converted to a runtime object that will be
part of the artifact.
It will recursively process a ComponentModel to create a BeanDefinition. For the time being it will collaborate
with the old bean definitions parsers for configurations that are partially defined in the new parsing method.
| Modifier and Type | Field and Description |
|---|---|
static String |
CORE_ERROR_NS |
static String |
SOURCE_TYPE |
static String |
SPRING_PROTOTYPE_OBJECT |
static String |
SPRING_SINGLETON_OBJECT |
static String |
TARGET_TYPE |
| Constructor and Description |
|---|
BeanDefinitionFactory(ComponentBuildingDefinitionRegistry componentBuildingDefinitionRegistry,
org.mule.runtime.api.exception.ErrorTypeRepository errorTypeRepository) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasDefinition(org.mule.runtime.api.component.ComponentIdentifier componentIdentifier,
Optional<org.mule.runtime.api.component.ComponentIdentifier> parentComponentModelOptional)
Used to collaborate with the bean definition parsers mechanism.
|
boolean |
isComponentIgnored(org.mule.runtime.api.component.ComponentIdentifier identifier) |
boolean |
isLanguageConstructComponent(org.mule.runtime.api.component.ComponentIdentifier componentIdentifier) |
boolean |
isWrapperComponent(org.mule.runtime.api.component.ComponentIdentifier componentModel,
Optional<org.mule.runtime.api.component.ComponentIdentifier> parentComponentModelOptional) |
org.springframework.beans.factory.config.BeanDefinition |
resolveComponentRecursively(SpringComponentModel parentComponentModel,
SpringComponentModel componentModel,
org.springframework.beans.factory.support.BeanDefinitionRegistry registry,
BiConsumer<ComponentModel,org.springframework.beans.factory.support.BeanDefinitionRegistry> componentModelPostProcessor,
BiFunction<Element,org.springframework.beans.factory.config.BeanDefinition,Either<org.springframework.beans.factory.config.BeanDefinition,org.springframework.beans.factory.config.BeanReference>> oldParsingMechanism,
SpringConfigurationComponentLocator componentLocator)
Creates a
BeanDefinition by traversing the ComponentModel and its children. |
public static final String SPRING_PROTOTYPE_OBJECT
public static final String SPRING_SINGLETON_OBJECT
public static final String SOURCE_TYPE
public static final String TARGET_TYPE
public static final String CORE_ERROR_NS
public BeanDefinitionFactory(ComponentBuildingDefinitionRegistry componentBuildingDefinitionRegistry, org.mule.runtime.api.exception.ErrorTypeRepository errorTypeRepository)
componentBuildingDefinitionRegistry - a registry with all the known ComponentBuildingDefinitions by the
artifact.errorTypeRepository - public boolean isComponentIgnored(org.mule.runtime.api.component.ComponentIdentifier identifier)
public org.springframework.beans.factory.config.BeanDefinition resolveComponentRecursively(SpringComponentModel parentComponentModel, SpringComponentModel componentModel, org.springframework.beans.factory.support.BeanDefinitionRegistry registry, BiConsumer<ComponentModel,org.springframework.beans.factory.support.BeanDefinitionRegistry> componentModelPostProcessor, BiFunction<Element,org.springframework.beans.factory.config.BeanDefinition,Either<org.springframework.beans.factory.config.BeanDefinition,org.springframework.beans.factory.config.BeanReference>> oldParsingMechanism, SpringConfigurationComponentLocator componentLocator)
BeanDefinition by traversing the ComponentModel and its children.parentComponentModel - the parent component model since the bean definition to be created may depend on the context.componentModel - the component model from which we want to create the bean definition.registry - the bean registry since it may be required to get other bean definitions to create this one or to register
the bean definition.componentModelPostProcessor - a function to post process the bean definition.oldParsingMechanism - a function to execute the old parsing mechanism if required by children ComponentModelscomponentLocator - where the locations of any Component's locations must be registeredBeanDefinition of the component model.public boolean hasDefinition(org.mule.runtime.api.component.ComponentIdentifier componentIdentifier,
Optional<org.mule.runtime.api.component.ComponentIdentifier> parentComponentModelOptional)
#hasDefinition returns false, then the old
mechanism must be used.componentIdentifier - a ComponentModel identifier.parentComponentModelOptional - the ComponentModel parent identifier.ComponentBuildingDefinition for the specified configuration identifier, false if there's
not.public boolean isWrapperComponent(org.mule.runtime.api.component.ComponentIdentifier componentModel,
Optional<org.mule.runtime.api.component.ComponentIdentifier> parentComponentModelOptional)
public boolean isLanguageConstructComponent(org.mule.runtime.api.component.ComponentIdentifier componentIdentifier)
componentIdentifier - the component identifier to checktrue if the component identifier is one of the current language construct that have specific bean definitions parsers since we don't want to include
them in the parsing API.Copyright © 2003–2019 MuleSoft, Inc.. All rights reserved.