public class MuleArtifactContext extends org.springframework.context.support.AbstractRefreshableConfigApplicationContext implements ArtifactConfigResolverContext
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 ApplicationModel |
applicationModel |
protected BeanDefinitionFactory |
beanDefinitionFactory |
protected ComponentBuildingDefinitionRegistry |
componentBuildingDefinitionRegistry |
protected SpringConfigurationComponentLocator |
componentLocator |
static String |
INNER_BEAN_PREFIX |
protected MuleContextWithRegistry |
muleContext |
protected List<org.mule.runtime.api.ioc.ConfigurableObjectProvider> |
objectProviders |
APPLICATION_EVENT_MULTICASTER_BEAN_NAME, LIFECYCLE_PROCESSOR_BEAN_NAME, logger, MESSAGE_SOURCE_BEAN_NAMECONFIG_LOCATION_DELIMITERS, CONVERSION_SERVICE_BEAN_NAME, ENVIRONMENT_BEAN_NAME, LOAD_TIME_WEAVER_BEAN_NAME, SYSTEM_ENVIRONMENT_BEAN_NAME, SYSTEM_PROPERTIES_BEAN_NAME| Constructor and Description |
|---|
MuleArtifactContext(MuleContext muleContext,
org.mule.runtime.dsl.api.ConfigResource[] artifactConfigResources,
org.mule.runtime.app.declaration.api.ArtifactDeclaration artifactDeclaration,
OptionalObjectsController optionalObjectsController,
Map<String,String> artifactProperties,
ArtifactType artifactType,
List<ClassLoader> pluginsClassLoaders,
Optional<org.mule.runtime.api.component.ConfigurationProperties> parentConfigurationProperties,
boolean disableXmlValidations,
org.mule.runtime.dsl.api.component.ComponentBuildingDefinitionProvider runtimeComponentBuildingDefinitionProvider,
org.mule.runtime.api.lock.LockFactory runtimeLockFactory)
Parses configuration files creating a spring ApplicationContext which is used as a parent registry using the SpringRegistry
registry implementation to wraps the spring ApplicationContext
|
MuleArtifactContext(MuleContext muleContext,
org.mule.runtime.dsl.api.ConfigResource[] artifactConfigResources,
org.mule.runtime.app.declaration.api.ArtifactDeclaration artifactDeclaration,
OptionalObjectsController optionalObjectsController,
Optional<org.mule.runtime.api.component.ConfigurationProperties> parentConfigurationProperties,
Map<String,String> artifactProperties,
ArtifactType artifactType,
List<ClassLoader> pluginsClassLoaders,
boolean disableXmlValidations,
org.mule.runtime.dsl.api.component.ComponentBuildingDefinitionProvider runtimeComponentBuildingDefinitionProvider,
org.mule.runtime.api.lock.LockFactory runtimeLockFactory) |
| 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<String> |
createApplicationComponents(org.springframework.beans.factory.support.DefaultListableBeanFactory beanFactory,
ApplicationModel applicationModel,
boolean mustBeRoot)
Creates te 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() |
org.mule.runtime.dsl.api.ConfigResource[] |
getArtifactConfigResources() |
String |
getArtifactName() |
Map<String,String> |
getArtifactProperties() |
ConfigurationDependencyResolver |
getDependencyResolver() |
ClassLoader |
getExecutionClassLoader() |
Set<org.mule.runtime.api.meta.model.ExtensionModel> |
getExtensions() |
MuleContextWithRegistry |
getMuleContext() |
OptionalObjectsController |
getOptionalObjectsController() |
void |
getPrototypeBeanWithRootContainer(String name,
String rootContainerName)
Returns a prototype chain of processors mutating the root container name of the set of beans created from that prototype
object.
|
org.mule.runtime.api.artifact.Registry |
getRegistry() |
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 |
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() |
afterPropertiesSet, getConfigLocations, getDefaultConfigLocations, resolvePath, setBeanName, setConfigLocation, setConfigLocations, setIdassertBeanFactoryActive, cancelRefresh, closeBeanFactory, getBeanFactory, hasBeanFactory, refreshBeanFactory, setAllowBeanDefinitionOverriding, setAllowCircularReferencesaddApplicationListener, addBeanFactoryPostProcessor, containsBean, containsBeanDefinition, containsLocalBean, createEnvironment, destroyBeans, doClose, findAnnotationOnBean, finishBeanFactoryInitialization, finishRefresh, getAliases, getApplicationListeners, getApplicationName, getAutowireCapableBeanFactory, getBean, getBean, getBean, getBean, getBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanFactoryPostProcessors, getBeanNamesForAnnotation, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanProvider, getBeanProvider, getBeansOfType, getBeansOfType, getBeansWithAnnotation, getDisplayName, getEnvironment, getId, getInternalParentBeanFactory, getInternalParentMessageSource, getMessage, getMessage, getMessage, getParent, getParentBeanFactory, getResourcePatternResolver, getResources, getStartupDate, getType, initApplicationEventMulticaster, initLifecycleProcessor, initMessageSource, initPropertySources, invokeBeanFactoryPostProcessors, isActive, isPrototype, isSingleton, isTypeMatch, isTypeMatch, obtainFreshBeanFactory, onClose, onRefresh, prepareRefresh, publishEvent, publishEvent, publishEvent, refresh, registerBeanPostProcessors, registerListeners, registerShutdownHook, resetCommonCaches, 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 ComponentBuildingDefinitionRegistry componentBuildingDefinitionRegistry
protected ApplicationModel applicationModel
protected MuleContextWithRegistry muleContext
protected BeanDefinitionFactory beanDefinitionFactory
protected SpringConfigurationComponentLocator componentLocator
protected List<org.mule.runtime.api.ioc.ConfigurableObjectProvider> objectProviders
public MuleArtifactContext(MuleContext muleContext, org.mule.runtime.dsl.api.ConfigResource[] artifactConfigResources, org.mule.runtime.app.declaration.api.ArtifactDeclaration artifactDeclaration, OptionalObjectsController optionalObjectsController, Map<String,String> artifactProperties, ArtifactType artifactType, List<ClassLoader> pluginsClassLoaders, Optional<org.mule.runtime.api.component.ConfigurationProperties> parentConfigurationProperties, boolean disableXmlValidations, org.mule.runtime.dsl.api.component.ComponentBuildingDefinitionProvider runtimeComponentBuildingDefinitionProvider, org.mule.runtime.api.lock.LockFactory runtimeLockFactory) throws org.springframework.beans.BeansException
muleContext - the MuleContext that own this contextartifactDeclaration - the mule configuration defined programmaticallyoptionalObjectsController - the OptionalObjectsController to use. Cannot be null @see
org.mule.runtime.config.internal.SpringRegistrypluginsClassLoaders - the classloades of the plugins included in the artifact, on hwich contexts the parsers will
process.parentConfigurationProperties - disableXmlValidations - true when loading XML configs it will not apply validations.runtimeComponentBuildingDefinitionProvider - provider for the runtime
ComponentBuildingDefinitionsorg.springframework.beans.BeansExceptionpublic MuleArtifactContext(MuleContext muleContext, org.mule.runtime.dsl.api.ConfigResource[] artifactConfigResources, org.mule.runtime.app.declaration.api.ArtifactDeclaration artifactDeclaration, OptionalObjectsController optionalObjectsController, Optional<org.mule.runtime.api.component.ConfigurationProperties> parentConfigurationProperties, Map<String,String> artifactProperties, ArtifactType artifactType, List<ClassLoader> pluginsClassLoaders, boolean disableXmlValidations, org.mule.runtime.dsl.api.component.ComponentBuildingDefinitionProvider runtimeComponentBuildingDefinitionProvider, org.mule.runtime.api.lock.LockFactory runtimeLockFactory)
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<String> createApplicationComponents(org.springframework.beans.factory.support.DefaultListableBeanFactory beanFactory, ApplicationModel 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.public ConfigurationDependencyResolver getDependencyResolver()
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 void getPrototypeBeanWithRootContainer(String name, String rootContainerName)
name - the bean namerootContainerName - the new root container name.public org.mule.runtime.api.artifact.Registry getRegistry()
public String toString()
toString in class org.springframework.context.support.AbstractApplicationContextpublic String getArtifactName()
getArtifactName in interface ArtifactConfigResolverContextpublic Map<String,String> getArtifactProperties()
getArtifactProperties in interface ArtifactConfigResolverContextMap of artifact properties.public org.mule.runtime.dsl.api.ConfigResource[] getArtifactConfigResources()
getArtifactConfigResources in interface ArtifactConfigResolverContextConfigResource[] of config resources.public Set<org.mule.runtime.api.meta.model.ExtensionModel> getExtensions()
getExtensions in interface ArtifactConfigResolverContextExtensionModels to parse the configuration files.public ClassLoader getExecutionClassLoader()
getExecutionClassLoader in interface ArtifactConfigResolverContextClassLoader to load imported configuration files as resource.Copyright © 2003–2019 MuleSoft, Inc.. All rights reserved.