public class LazyMuleArtifactContext extends MuleArtifactContext implements LazyComponentInitializerAdapter, ComponentModelInitializer
MuleArtifactContext that allows to create configuration components lazily.
Components will be created upon request to use the from the exposed services.org.springframework.core.io.DefaultResourceLoader.ClassPathContextResourceLazyComponentInitializer.ComponentLocationFilter| Modifier and Type | Field and Description |
|---|---|
static String |
SHARED_PARTITIONED_PERSISTENT_OBJECT_STORE_PATH |
applicationModel, beanDefinitionFactory, componentBuildingDefinitionRegistry, componentLocator, INNER_BEAN_PREFIX, objectProvidersAPPLICATION_EVENT_MULTICASTER_BEAN_NAME, LIFECYCLE_PROCESSOR_BEAN_NAME, logger, MESSAGE_SOURCE_BEAN_NAMELAZY_COMPONENT_INITIALIZER_SERVICE_KEYCONFIG_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 |
|---|
LazyMuleArtifactContext(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<ComponentModelInitializer> parentComponentModelInitializer,
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
|
| Modifier and Type | Method and Description |
|---|---|
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 minimalAppModel,
boolean mustBeRoot)
Apart from calling
createApplicationComponents(DefaultListableBeanFactory, ArtifactAst, boolean) from the
superclass, will handle orphan processors. |
Optional<org.mule.runtime.config.internal.LazyMuleArtifactContext.ComponentModelInitializerAdapter> |
getParentComponentModelInitializerAdapter(boolean applyStartPhase) |
void |
initializeComponent(org.mule.runtime.api.component.location.Location location)
Calling this method guarantees that the requested component from the configuration will be created, initialized and
started.
|
void |
initializeComponent(org.mule.runtime.api.component.location.Location location,
boolean applyStartPhase)
Calling this method guarantees that the requested component from the configuration will be created and
initialized.
|
void |
initializeComponents(LazyComponentInitializer.ComponentLocationFilter filter)
Calling this method guarantees that the components accepted by the filter from the configuration will be created,
initialized and started.
|
void |
initializeComponents(LazyComponentInitializer.ComponentLocationFilter filter,
boolean applyStartPhase)
Calling this method guarantees that the components accepted by the filter from the configuration will be created and
initialized.
|
void |
initializeComponents(Predicate<org.mule.runtime.ast.api.ComponentAst> componentModelPredicate,
boolean applyStartPhase)
Initializes the
|
protected boolean |
isRuntimeMode()
Defines if the context should be created for Runtime (execution) o not.
|
protected void |
loadBeanDefinitions(org.springframework.beans.factory.support.DefaultListableBeanFactory beanFactory) |
protected void |
prepareBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory) |
protected void |
prepareObjectProviders() |
addBeanPostProcessors, convert, createBeanFactory, customizeBeanFactory, destroy, getArtifactConfigResources, getArtifactName, getArtifactProperties, getExecutionClassLoader, getExtensions, getMuleContext, getMuleRegistry, getOptionalObjectsController, getPrototypeBeanWithRootContainer, getRegistry, initialize, isRunning, postProcessBeanDefinition, postProcessBeanFactory, prepareRefresh, registerInjectorProcessor, registerObjectFromObjectProviders, registerPostProcessor, toStringafterPropertiesSet, 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, 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 SHARED_PARTITIONED_PERSISTENT_OBJECT_STORE_PATH
public LazyMuleArtifactContext(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<ComponentModelInitializer> parentComponentModelInitializer, 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.SpringRegistryparentConfigurationProperties - disableXmlValidations - true when loading XML configs it will not apply validations.runtimeComponentBuildingDefinitionProvider - provider for the runtime
ComponentBuildingDefinitionsorg.springframework.beans.BeansExceptionprotected boolean isRuntimeMode()
MuleArtifactContextisRuntimeMode in class MuleArtifactContextprotected void prepareBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
prepareBeanFactory in class MuleArtifactContextpublic void initializeComponent(org.mule.runtime.api.component.location.Location location)
LazyComponentInitializerinitializeComponent in interface LazyComponentInitializerlocation - the location of the configuration component.public void initializeComponents(LazyComponentInitializer.ComponentLocationFilter filter)
LazyComponentInitializerinitializeComponents in interface LazyComponentInitializerfilter - LazyComponentInitializer.ComponentLocationFilter to select the Component to be initialized and they dependent ones.public void initializeComponent(org.mule.runtime.api.component.location.Location location,
boolean applyStartPhase)
LazyComponentInitializerAdapterinitializeComponent in interface LazyComponentInitializerAdapterlocation - the location of the configuration component.applyStartPhase - boolean indicating if the Start phase should be applied to the created componentspublic void initializeComponents(LazyComponentInitializer.ComponentLocationFilter filter, boolean applyStartPhase)
LazyComponentInitializerAdapterinitializeComponents in interface LazyComponentInitializerAdapterfilter - ComponentLocationFilter to select the Component to be initialized and they dependent ones.applyStartPhase - boolean indicating if the Start phase should be applied to the created componentspublic void initializeComponents(Predicate<org.mule.runtime.ast.api.ComponentAst> componentModelPredicate, boolean applyStartPhase)
ComponentModelInitializerinitializeComponents in interface ComponentModelInitializercomponentModelPredicate - a Predicate for ComponentModel to be initialized.applyStartPhase - boolean indicating if the Start phase should be applied to the created componentspublic Optional<org.mule.runtime.config.internal.LazyMuleArtifactContext.ComponentModelInitializerAdapter> getParentComponentModelInitializerAdapter(boolean applyStartPhase)
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 minimalAppModel, boolean mustBeRoot)
createApplicationComponents(DefaultListableBeanFactory, ArtifactAst, boolean) from the
superclass, will handle orphan processors. That is, processors that are part of the minimal app but for which the containing
flow is not.createApplicationComponents in class MuleArtifactContextbeanFactory - the bean factory in which definition must be created.minimalAppModel - the artifact application model.mustBeRoot - if the component must be root to be created.protected void prepareObjectProviders()
prepareObjectProviders in class MuleArtifactContextpublic void close()
close in interface Closeableclose in interface AutoCloseableclose in interface org.springframework.context.ConfigurableApplicationContextclose in class MuleArtifactContextprotected void loadBeanDefinitions(org.springframework.beans.factory.support.DefaultListableBeanFactory beanFactory)
throws IOException
loadBeanDefinitions in class MuleArtifactContextIOExceptionCopyright © 2003–2020 MuleSoft, Inc.. All rights reserved.