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 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,
Map<String,String> artifactProperties,
ArtifactType artifactType,
ComponentBuildingDefinitionRegistryFactory componentBuildingDefinitionRegistryFactory,
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() |
static org.springframework.core.io.Resource[] |
convert(org.mule.runtime.dsl.api.ConfigResource[] resources) |
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 void |
customizeBeanFactory(org.springframework.beans.factory.support.DefaultListableBeanFactory beanFactory) |
void |
destroy() |
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() |
MuleContextWithRegistry |
getMuleContext() |
protected MuleRegistry |
getMuleRegistry() |
OptionalObjectsController |
getOptionalObjectsController() |
org.mule.runtime.api.artifact.Registry |
getRegistry() |
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
PostRegistrationActionsPostProcessor can work its magic and add them 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 |
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 void |
registerPostProcessor(org.springframework.beans.factory.support.BeanDefinitionRegistry registry,
org.springframework.beans.factory.support.RootBeanDefinition definition,
String beanName) |
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, 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 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, Map<String,String> artifactProperties, ArtifactType artifactType, ComponentBuildingDefinitionRegistryFactory componentBuildingDefinitionRegistryFactory, 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.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 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.AbstractApplicationContextpublic static org.springframework.core.io.Resource[] convert(org.mule.runtime.dsl.api.ConfigResource[] resources)
protected void loadBeanDefinitions(org.springframework.beans.factory.support.DefaultListableBeanFactory beanFactory)
throws IOException
loadBeanDefinitions in class org.springframework.context.support.AbstractRefreshableApplicationContextIOExceptionpublic void destroy()
destroy in class org.springframework.context.support.AbstractApplicationContextprotected 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 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 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 void registerPostProcessor(org.springframework.beans.factory.support.BeanDefinitionRegistry registry,
org.springframework.beans.factory.support.RootBeanDefinition definition,
String beanName)
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
PostRegistrationActionsPostProcessor can work its magic and add them to the transformation graphpublic MuleContextWithRegistry getMuleContext()
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()
Copyright © 2003–2025 MuleSoft, Inc.. All rights reserved.