public class MuleArtifactContext
extends org.springframework.context.support.AbstractRefreshableConfigApplicationContext
MuleArtifactContext is a simple extension application context that allows resources to be loaded from the
Classpath of file system using the MuleBeanDefinitionReader.| Modifier and Type | Field and Description |
|---|---|
protected SpringConfigurationComponentLocator |
componentLocator |
static String |
INNER_BEAN_PREFIX |
protected org.mule.runtime.api.memory.management.MemoryManagementService |
memoryManagementService |
protected List<org.mule.runtime.api.ioc.ConfigurableObjectProvider> |
objectProviders |
APPLICATION_EVENT_MULTICASTER_BEAN_NAME, LIFECYCLE_PROCESSOR_BEAN_NAME, logger, MESSAGE_SOURCE_BEAN_NAMEAPPLICATION_STARTUP_BEAN_NAME, CONFIG_LOCATION_DELIMITERS, CONVERSION_SERVICE_BEAN_NAME, ENVIRONMENT_BEAN_NAME, LOAD_TIME_WEAVER_BEAN_NAME, SHUTDOWN_HOOK_THREAD_NAME, SYSTEM_ENVIRONMENT_BEAN_NAME, SYSTEM_PROPERTIES_BEAN_NAME| Constructor and Description |
|---|
MuleArtifactContext(MuleContext muleContext,
org.mule.runtime.ast.api.ArtifactAst artifactAst,
OptionalObjectsController optionalObjectsController,
Optional<org.mule.runtime.api.component.ConfigurationProperties> parentConfigurationProperties,
BaseConfigurationComponentLocator baseConfigurationComponentLocator,
ContributedErrorTypeRepository errorTypeRepository,
ContributedErrorTypeLocator errorTypeLocator,
Map<String,String> artifactProperties,
ArtifactType artifactType,
ComponentBuildingDefinitionRegistryFactory componentBuildingDefinitionRegistryFactory,
org.mule.runtime.api.memory.management.MemoryManagementService memoryManagementService,
org.mule.runtime.api.config.FeatureFlaggingService featureFlaggingService)
Parses configuration files creating a spring ApplicationContext which is used as a parent registry using the SpringRegistry
registry implementation to wraps the spring ApplicationContext
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addBeanPostProcessors(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory,
org.springframework.beans.factory.config.BeanPostProcessor... processors) |
void |
close() |
protected List<org.mule.runtime.api.util.Pair<String,org.mule.runtime.ast.api.ComponentAst>> |
createApplicationComponents(org.springframework.beans.factory.support.DefaultListableBeanFactory beanFactory,
org.mule.runtime.ast.api.ArtifactAst applicationModel,
boolean mustBeRoot)
Creates the definition for all the objects to be created form the enabled components in the
applicationModel. |
protected org.springframework.beans.factory.support.DefaultListableBeanFactory |
createBeanFactory() |
protected SpringMuleContextServiceConfigurator |
createServiceConfigurator(org.springframework.beans.factory.support.DefaultListableBeanFactory beanFactory) |
protected void |
customizeBeanFactory(org.springframework.beans.factory.support.DefaultListableBeanFactory beanFactory) |
protected List<org.mule.runtime.api.util.Pair<String,org.mule.runtime.ast.api.ComponentAst>> |
doCreateApplicationComponents(org.springframework.beans.factory.support.DefaultListableBeanFactory beanFactory,
org.mule.runtime.ast.api.ArtifactAst applicationModel,
boolean mustBeRoot,
Map<org.mule.runtime.ast.api.ComponentAst,SpringComponentModel> springComponentModels) |
protected void |
doRegisterErrors(org.mule.runtime.ast.api.ArtifactAst artifactAst) |
protected void |
doValidateModel(org.mule.runtime.ast.api.ArtifactAst appModel,
Predicate<org.mule.runtime.ast.api.validation.Validation> validationsFilter) |
org.mule.runtime.ast.api.ArtifactAst |
getApplicationModel() |
protected ArtifactType |
getArtifactType() |
protected PropertiesResolverConfigurationProperties |
getConfigurationProperties() |
protected MuleFunctionsBindingContextProvider |
getCoreFunctionsProvider() |
MuleContextWithRegistry |
getMuleContext() |
protected MuleRegistry |
getMuleRegistry() |
OptionalObjectsController |
getOptionalObjectsController() |
org.mule.runtime.api.artifact.Registry |
getRegistry() |
protected DefaultResourceLocator |
getResourceLocator() |
protected DefaultRegistry |
getServiceDiscoverer() |
void |
initialize() |
protected boolean |
isIgnored(org.mule.runtime.ast.api.ComponentAst componentAst) |
boolean |
isRunning()
This implementation returns
false if the context hasn't been initialised yet, in opposition to the
default implementation which throws an exception |
protected void |
loadBeanDefinitions(org.springframework.beans.factory.support.DefaultListableBeanFactory beanFactory) |
protected static void |
postProcessBeanDefinition(SpringComponentModel resolvedComponent,
org.springframework.beans.factory.support.BeanDefinitionRegistry registry,
String beanName)
Forces the registration of instances of
TransformerResolver and Converter to be created, so that they are
added to the transformation graph. |
protected void |
postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory) |
protected void |
prepareBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory) |
protected void |
prepareObjectProviders() |
protected void |
registerApplicationExtensionModel() |
protected void |
registerErrors(org.mule.runtime.ast.api.ArtifactAst artifactAst) |
protected void |
registerInjectorProcessor(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory) |
protected void |
registerObjectFromObjectProviders(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
Process all the
ObjectProviders from the ApplicationModel to get their beans and register them inside the
spring bean factory so they can be used for dependency injection. |
protected Set<org.mule.runtime.ast.api.ComponentAst> |
resolveRootComponents(org.mule.runtime.ast.api.ArtifactAst applicationModel) |
String |
toString() |
protected void |
validateArtifact(org.mule.runtime.ast.api.ArtifactAst artifactAst) |
afterPropertiesSet, getConfigLocations, getDefaultConfigLocations, resolvePath, setBeanName, setConfigLocation, setConfigLocations, setIdassertBeanFactoryActive, cancelRefresh, closeBeanFactory, getBeanFactory, hasBeanFactory, refreshBeanFactory, setAllowBeanDefinitionOverriding, setAllowCircularReferencesaddApplicationListener, addBeanFactoryPostProcessor, containsBean, containsBeanDefinition, containsLocalBean, createEnvironment, destroy, destroyBeans, doClose, findAnnotationOnBean, findAnnotationOnBean, finishBeanFactoryInitialization, finishRefresh, getAliases, getApplicationListeners, getApplicationName, getApplicationStartup, getAutowireCapableBeanFactory, getBean, getBean, getBean, getBean, getBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanFactoryPostProcessors, getBeanNamesForAnnotation, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanProvider, getBeanProvider, getBeanProvider, getBeanProvider, getBeansOfType, getBeansOfType, getBeansWithAnnotation, getDisplayName, getEnvironment, getId, getInternalParentBeanFactory, getInternalParentMessageSource, getMessage, getMessage, getMessage, getParent, getParentBeanFactory, getResourcePatternResolver, getResources, getStartupDate, getType, getType, initApplicationEventMulticaster, initLifecycleProcessor, initMessageSource, initPropertySources, invokeBeanFactoryPostProcessors, isActive, isPrototype, isSingleton, isTypeMatch, isTypeMatch, obtainFreshBeanFactory, onClose, onRefresh, prepareRefresh, publishEvent, publishEvent, publishEvent, refresh, registerBeanPostProcessors, registerListeners, registerShutdownHook, resetCommonCaches, setApplicationStartup, setDisplayName, setEnvironment, setParent, start, stopaddProtocolResolver, clearResourceCaches, getClassLoader, getProtocolResolvers, getResource, getResourceByPath, getResourceCache, setClassLoaderclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic static final String INNER_BEAN_PREFIX
protected final org.mule.runtime.api.memory.management.MemoryManagementService memoryManagementService
protected SpringConfigurationComponentLocator componentLocator
protected List<org.mule.runtime.api.ioc.ConfigurableObjectProvider> objectProviders
public MuleArtifactContext(MuleContext muleContext, org.mule.runtime.ast.api.ArtifactAst artifactAst, OptionalObjectsController optionalObjectsController, Optional<org.mule.runtime.api.component.ConfigurationProperties> parentConfigurationProperties, BaseConfigurationComponentLocator baseConfigurationComponentLocator, ContributedErrorTypeRepository errorTypeRepository, ContributedErrorTypeLocator errorTypeLocator, Map<String,String> artifactProperties, ArtifactType artifactType, ComponentBuildingDefinitionRegistryFactory componentBuildingDefinitionRegistryFactory, org.mule.runtime.api.memory.management.MemoryManagementService memoryManagementService, org.mule.runtime.api.config.FeatureFlaggingService featureFlaggingService)
muleContext - the MuleContext that own this contextartifactAst - the definition of the artifact to create a context foroptionalObjectsController - the OptionalObjectsController to use. Cannot be null @see
org.mule.runtime.config.internal.SpringRegistryparentConfigurationProperties - the resolver for properties from the parent artifact to be used as fallback
in this artifact.baseConfigurationComponentLocator - indirection to the actual ConfigurationComponentLocator in the full
registryerrorTypeRepository - repository where the errors of the artifact will be registered.errorTypeLocator - locator where the errors of the artifact will be registered.artifactProperties - map of properties that can be referenced from the
artifactConfigResources as external configuration valuesartifactType - the type of artifact to determine the base objects of the created context.componentBuildingDefinitionRegistryFactory - protected MuleRegistry getMuleRegistry()
protected void validateArtifact(org.mule.runtime.ast.api.ArtifactAst artifactAst)
throws ConfigurationException
ConfigurationExceptionprotected final void doValidateModel(org.mule.runtime.ast.api.ArtifactAst appModel,
Predicate<org.mule.runtime.ast.api.validation.Validation> validationsFilter)
throws ConfigurationException
ConfigurationExceptionprotected void registerApplicationExtensionModel()
protected void registerErrors(org.mule.runtime.ast.api.ArtifactAst artifactAst)
protected void doRegisterErrors(org.mule.runtime.ast.api.ArtifactAst artifactAst)
public void initialize()
protected void prepareBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
prepareBeanFactory in class org.springframework.context.support.AbstractApplicationContextprotected void prepareObjectProviders()
protected void registerObjectFromObjectProviders(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
ObjectProviders from the ApplicationModel to get their beans and register them inside the
spring bean factory so they can be used for dependency injection.beanFactory - the spring bean factory where the objects will be registered.protected void addBeanPostProcessors(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory,
org.springframework.beans.factory.config.BeanPostProcessor... processors)
public void close()
close in interface Closeableclose in interface AutoCloseableclose in interface org.springframework.context.ConfigurableApplicationContextclose in class org.springframework.context.support.AbstractApplicationContextprotected void loadBeanDefinitions(org.springframework.beans.factory.support.DefaultListableBeanFactory beanFactory)
throws IOException
loadBeanDefinitions in class org.springframework.context.support.AbstractRefreshableApplicationContextIOExceptionprotected List<org.mule.runtime.api.util.Pair<String,org.mule.runtime.ast.api.ComponentAst>> createApplicationComponents(org.springframework.beans.factory.support.DefaultListableBeanFactory beanFactory, org.mule.runtime.ast.api.ArtifactAst applicationModel, boolean mustBeRoot)
applicationModel.beanFactory - the bean factory in which definition must be created.applicationModel - the artifact application model.mustBeRoot - if the component must be root to be created.protected List<org.mule.runtime.api.util.Pair<String,org.mule.runtime.ast.api.ComponentAst>> doCreateApplicationComponents(org.springframework.beans.factory.support.DefaultListableBeanFactory beanFactory, org.mule.runtime.ast.api.ArtifactAst applicationModel, boolean mustBeRoot, Map<org.mule.runtime.ast.api.ComponentAst,SpringComponentModel> springComponentModels)
protected Set<org.mule.runtime.ast.api.ComponentAst> resolveRootComponents(org.mule.runtime.ast.api.ArtifactAst applicationModel)
protected boolean isIgnored(org.mule.runtime.ast.api.ComponentAst componentAst)
protected void customizeBeanFactory(org.springframework.beans.factory.support.DefaultListableBeanFactory beanFactory)
customizeBeanFactory in class org.springframework.context.support.AbstractRefreshableApplicationContextprotected SpringMuleContextServiceConfigurator createServiceConfigurator(org.springframework.beans.factory.support.DefaultListableBeanFactory beanFactory)
protected void postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
postProcessBeanFactory in class org.springframework.context.support.AbstractApplicationContextprotected void registerInjectorProcessor(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
protected org.springframework.beans.factory.support.DefaultListableBeanFactory createBeanFactory()
createBeanFactory in class org.springframework.context.support.AbstractRefreshableApplicationContextpublic boolean isRunning()
false if the context hasn't been initialised yet, in opposition to the
default implementation which throws an exceptionisRunning in interface org.springframework.context.LifecycleisRunning in class org.springframework.context.support.AbstractApplicationContextprotected static void postProcessBeanDefinition(SpringComponentModel resolvedComponent, org.springframework.beans.factory.support.BeanDefinitionRegistry registry, String beanName)
TransformerResolver and Converter to be created, so that they are
added to the transformation graph.public MuleContextWithRegistry getMuleContext()
protected MuleFunctionsBindingContextProvider getCoreFunctionsProvider()
protected PropertiesResolverConfigurationProperties getConfigurationProperties()
protected ArtifactType getArtifactType()
public OptionalObjectsController getOptionalObjectsController()
public org.mule.runtime.api.artifact.Registry getRegistry()
public String toString()
toString in class org.springframework.context.support.AbstractApplicationContextpublic org.mule.runtime.ast.api.ArtifactAst getApplicationModel()
protected DefaultRegistry getServiceDiscoverer()
protected DefaultResourceLocator getResourceLocator()
Copyright © 2003–2022 MuleSoft, Inc.. All rights reserved.