Search in sources :

Example 1 with XmlApplicationServiceRegistry

use of org.mule.runtime.config.api.dsl.processor.xml.XmlApplicationServiceRegistry in project mule by mulesoft.

the class DefaultXmlArtifactDeclarationLoader method loadArtifactConfig.

private ConfigLine loadArtifactConfig(String name, InputStream resource) {
    checkArgument(resource != null, "The given application was not found as resource");
    Document document = noValidationDocumentLoader().loadDocument(context.getExtensions(), name, resource);
    return new XmlApplicationParser(new XmlApplicationServiceRegistry(new SpiServiceRegistry(), context), resolveContextArtifactPluginClassLoaders()).parse(document.getDocumentElement()).orElseThrow(() -> new MuleRuntimeException(createStaticMessage("Could not load load a Configuration from the given resource")));
}
Also used : XmlApplicationParser(org.mule.runtime.config.api.dsl.processor.xml.XmlApplicationParser) XmlApplicationServiceRegistry(org.mule.runtime.config.api.dsl.processor.xml.XmlApplicationServiceRegistry) MuleRuntimeException(org.mule.runtime.api.exception.MuleRuntimeException) Document(org.w3c.dom.Document) SpiServiceRegistry(org.mule.runtime.core.api.registry.SpiServiceRegistry)

Example 2 with XmlApplicationServiceRegistry

use of org.mule.runtime.config.api.dsl.processor.xml.XmlApplicationServiceRegistry in project mule by mulesoft.

the class MuleArtifactContext method createApplicationParser.

private XmlApplicationParser createApplicationParser(List<ClassLoader> pluginsClassLoaders) {
    ExtensionManager extensionManager = muleContext.getExtensionManager();
    ServiceRegistry customRegistry = extensionManager != null ? new XmlApplicationServiceRegistry(serviceRegistry, DslResolvingContext.getDefault(extensionManager.getExtensions())) : serviceRegistry;
    return new XmlApplicationParser(customRegistry, pluginsClassLoaders);
}
Also used : XmlApplicationParser(org.mule.runtime.config.api.dsl.processor.xml.XmlApplicationParser) ExtensionManager(org.mule.runtime.core.api.extension.ExtensionManager) XmlApplicationServiceRegistry(org.mule.runtime.config.api.dsl.processor.xml.XmlApplicationServiceRegistry) SpiServiceRegistry(org.mule.runtime.core.api.registry.SpiServiceRegistry) ServiceRegistry(org.mule.runtime.core.api.registry.ServiceRegistry) XmlApplicationServiceRegistry(org.mule.runtime.config.api.dsl.processor.xml.XmlApplicationServiceRegistry)

Aggregations

XmlApplicationParser (org.mule.runtime.config.api.dsl.processor.xml.XmlApplicationParser)2 XmlApplicationServiceRegistry (org.mule.runtime.config.api.dsl.processor.xml.XmlApplicationServiceRegistry)2 SpiServiceRegistry (org.mule.runtime.core.api.registry.SpiServiceRegistry)2 MuleRuntimeException (org.mule.runtime.api.exception.MuleRuntimeException)1 ExtensionManager (org.mule.runtime.core.api.extension.ExtensionManager)1 ServiceRegistry (org.mule.runtime.core.api.registry.ServiceRegistry)1 Document (org.w3c.dom.Document)1