public class SpringXmlConfigurationBuilder extends AbstractResourceConfigurationBuilder implements DomainMuleContextAwareConfigurationBuilder
SpringXmlConfigurationBuilder
enables Mule to be configured from a
Spring XML Configuration file used with Mule name-spaces. Multiple configuration
files can be loaded from this builder (specified as a comma-separated list).Modifier and Type | Field and Description |
---|---|
protected org.springframework.context.ApplicationContext |
applicationContext |
protected org.springframework.context.ApplicationContext |
domainContext |
static String |
MULE_DEFAULTS_CONFIG |
static String |
MULE_DOMAIN_REGISTRY_BOOTSTRAP_SPRING_CONFIG |
static String |
MULE_MINIMAL_SPRING_CONFIG |
static String |
MULE_REGISTRY_BOOTSTRAP_SPRING_CONFIG |
static String |
MULE_SPRING_CONFIG |
protected org.springframework.context.ApplicationContext |
parentContext |
protected SpringRegistry |
registry |
protected boolean |
useDefaultConfigResource
Prepend "default-mule-config.xml" to the list of config resources.
|
protected boolean |
useMinimalConfigResource |
configResources
configured, logger
Constructor and Description |
---|
SpringXmlConfigurationBuilder(ConfigResource[] configResources) |
SpringXmlConfigurationBuilder(String configResources) |
SpringXmlConfigurationBuilder(String[] configResources) |
Modifier and Type | Method and Description |
---|---|
protected void |
addResources(List<ConfigResource> allResources)
Template method for modifying the list of resources to be loaded.
|
protected void |
applyLifecycle(LifecycleManager lifecycleManager)
Allows a configuration builder to check and customise the lifecycle of objects in the registry
being used.
|
protected void |
createSpringRegistry(MuleContext muleContext,
org.springframework.context.ApplicationContext applicationContext) |
protected void |
doConfigure(MuleContext muleContext)
Will configure a MuleContext based on the configuration provided.
|
protected org.springframework.context.ApplicationContext |
doCreateApplicationContext(MuleContext muleContext,
ConfigResource[] configResources,
OptionalObjectsController optionalObjectsController) |
org.springframework.context.ApplicationContext |
getApplicationContext() |
protected List<ConfigResource> |
getConfigResources() |
protected org.springframework.context.ApplicationContext |
getParentContext() |
boolean |
isUseDefaultConfigResource() |
void |
setDomainContext(MuleContext domainContext) |
void |
setParentContext(org.springframework.context.ApplicationContext parentContext) |
void |
setUseDefaultConfigResource(boolean useDefaultConfigResource) |
void |
setUseMinimalConfigResource(boolean useMinimalConfigResource) |
void |
unconfigure(MuleContext muleContext) |
configure, createConfigResourcesString, loadConfigResources
isConfigured
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
configure, isConfigured
public static final String MULE_DEFAULTS_CONFIG
public static final String MULE_SPRING_CONFIG
public static final String MULE_MINIMAL_SPRING_CONFIG
public static final String MULE_REGISTRY_BOOTSTRAP_SPRING_CONFIG
public static final String MULE_DOMAIN_REGISTRY_BOOTSTRAP_SPRING_CONFIG
protected boolean useDefaultConfigResource
protected boolean useMinimalConfigResource
protected SpringRegistry registry
protected org.springframework.context.ApplicationContext domainContext
protected org.springframework.context.ApplicationContext parentContext
protected org.springframework.context.ApplicationContext applicationContext
public SpringXmlConfigurationBuilder(String[] configResources) throws ConfigurationException
ConfigurationException
public SpringXmlConfigurationBuilder(String configResources) throws ConfigurationException
ConfigurationException
public SpringXmlConfigurationBuilder(ConfigResource[] configResources)
protected List<ConfigResource> getConfigResources() throws IOException
IOException
protected void doConfigure(MuleContext muleContext) throws Exception
AbstractConfigurationBuilder
ConfigurationBuilder
implementation as bean properties before this method
has been called.doConfigure
in class AbstractConfigurationBuilder
muleContext
- The current MuleContext
ConfigurationException
- if the configuration fails i.e. an object cannot be created or
initialised properlyException
protected void addResources(List<ConfigResource> allResources)
allResources
- the list of ConfigResource
to be loadedpublic void unconfigure(MuleContext muleContext)
protected org.springframework.context.ApplicationContext doCreateApplicationContext(MuleContext muleContext, ConfigResource[] configResources, OptionalObjectsController optionalObjectsController)
protected void createSpringRegistry(MuleContext muleContext, org.springframework.context.ApplicationContext applicationContext) throws Exception
Exception
protected void applyLifecycle(LifecycleManager lifecycleManager) throws Exception
AbstractConfigurationBuilder
// If the MuleContext is started, start all objects in the new Registry.
if (lifecycleManager.isPhaseComplete(Startable.PHASE_NAME))
{
lifecycleManager.applyPhase(registry.lookupObjects(Object.class), Startable.PHASE_NAME);
}
applyLifecycle
in class AbstractConfigurationBuilder
lifecycleManager
- the lifecycleManager for the current contextException
- if anything goes wrong. Usually this is an exeption bubbled up from calling
a lifecycle method on an object in the registrypublic boolean isUseDefaultConfigResource()
public void setUseDefaultConfigResource(boolean useDefaultConfigResource)
public org.springframework.context.ApplicationContext getApplicationContext()
public void setUseMinimalConfigResource(boolean useMinimalConfigResource)
protected org.springframework.context.ApplicationContext getParentContext()
public void setParentContext(org.springframework.context.ApplicationContext parentContext)
public void setDomainContext(MuleContext domainContext)
setDomainContext
in interface DomainMuleContextAwareConfigurationBuilder
domainContext
- MuleContext of the domain.Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.