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 |
SOURCE_TYPE |
static String |
SPRING_PROTOTYPE_OBJECT |
static String |
SPRING_SINGLETON_OBJECT |
static String |
TARGET_TYPE |
| Constructor and Description |
|---|
BeanDefinitionFactory(ComponentBuildingDefinitionRegistry componentBuildingDefinitionRegistry,
ErrorTypeRepository errorTypeRepository) |
| Modifier and Type | Method and Description |
|---|---|
static void |
checkElementNameUnique(org.springframework.beans.factory.support.BeanDefinitionRegistry registry,
Element element) |
void |
destroy()
Release resources from the bean factory.
|
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 |
isWrapperComponent(org.mule.runtime.api.component.ComponentIdentifier componentModel,
Optional<org.mule.runtime.api.component.ComponentIdentifier> parentComponentModelOptional) |
org.springframework.beans.factory.config.BeanDefinition |
resolveComponentRecursively(ComponentModel parentComponentModel,
ComponentModel 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)
Creates a
BeanDefinition by traversing the ComponentModel and its children. |
void |
resolveEagerCreationObjects(ComponentModel parentComponentModel,
ComponentModel componentModel,
org.springframework.beans.factory.support.BeanDefinitionRegistry registry,
BiConsumer<ComponentModel,org.springframework.beans.factory.support.BeanDefinitionRegistry> componentModelPostProcessor) |
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 BeanDefinitionFactory(ComponentBuildingDefinitionRegistry componentBuildingDefinitionRegistry, ErrorTypeRepository errorTypeRepository)
componentBuildingDefinitionRegistry - a registry with all the known ComponentBuildingDefinitions by the
artifact.errorTypeRepository - public void resolveEagerCreationObjects(ComponentModel parentComponentModel, ComponentModel componentModel, org.springframework.beans.factory.support.BeanDefinitionRegistry registry, BiConsumer<ComponentModel,org.springframework.beans.factory.support.BeanDefinitionRegistry> componentModelPostProcessor)
public org.springframework.beans.factory.config.BeanDefinition resolveComponentRecursively(ComponentModel parentComponentModel, ComponentModel 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)
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 ComponentModelsBeanDefinition of the component model.public static void checkElementNameUnique(org.springframework.beans.factory.support.BeanDefinitionRegistry registry,
Element element)
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 void destroy()
Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.