Search in sources :

Example 1 with ResourceProvider

use of org.mule.runtime.config.api.dsl.model.ResourceProvider in project mule by mulesoft.

the class FileConfigurationPropertiesProviderTestCase method createResolver.

@Before
public void createResolver() {
    ResourceProvider externalResourceProvider = new ClassLoaderResourceProvider(Thread.currentThread().getContextClassLoader());
    resolver = new DefaultConfigurationPropertiesResolver(Optional.empty(), new FileConfigurationPropertiesProvider(externalResourceProvider, "External provider"));
}
Also used : FileConfigurationPropertiesProvider(org.mule.runtime.config.internal.dsl.model.config.FileConfigurationPropertiesProvider) ResourceProvider(org.mule.runtime.config.api.dsl.model.ResourceProvider) ClassLoaderResourceProvider(org.mule.runtime.config.internal.dsl.model.ClassLoaderResourceProvider) ClassLoaderResourceProvider(org.mule.runtime.config.internal.dsl.model.ClassLoaderResourceProvider) DefaultConfigurationPropertiesResolver(org.mule.runtime.config.internal.dsl.model.config.DefaultConfigurationPropertiesResolver) Before(org.junit.Before)

Example 2 with ResourceProvider

use of org.mule.runtime.config.api.dsl.model.ResourceProvider in project mule by mulesoft.

the class MuleArtifactContext method createApplicationModel.

private void createApplicationModel() {
    try {
        ArtifactConfig artifactConfig = resolveArtifactConfig();
        Set<ExtensionModel> extensions = muleContext.getExtensionManager() != null ? muleContext.getExtensionManager().getExtensions() : emptySet();
        ResourceProvider externalResourceProvider = new ClassLoaderResourceProvider(muleContext.getExecutionClassLoader());
        applicationModel = new ApplicationModel(artifactConfig, artifactDeclaration, extensions, artifactProperties, parentConfigurationProperties, of(componentBuildingDefinitionRegistry), true, externalResourceProvider);
    } catch (MuleRuntimeException e) {
        throw e;
    } catch (Exception e) {
        throw new MuleRuntimeException(e);
    }
}
Also used : ArtifactConfig(org.mule.runtime.config.api.dsl.processor.ArtifactConfig) ExtensionModel(org.mule.runtime.api.meta.model.ExtensionModel) ClassLoaderResourceProvider(org.mule.runtime.config.internal.dsl.model.ClassLoaderResourceProvider) ResourceProvider(org.mule.runtime.config.api.dsl.model.ResourceProvider) MuleRuntimeException(org.mule.runtime.api.exception.MuleRuntimeException) ApplicationModel(org.mule.runtime.config.internal.model.ApplicationModel) ClassLoaderResourceProvider(org.mule.runtime.config.internal.dsl.model.ClassLoaderResourceProvider) MuleRuntimeException(org.mule.runtime.api.exception.MuleRuntimeException) IOException(java.io.IOException) BeansException(org.springframework.beans.BeansException) RuntimeConfigurationException(org.mule.runtime.config.internal.dsl.model.config.RuntimeConfigurationException) NoSuchBeanDefinitionException(org.springframework.beans.factory.NoSuchBeanDefinitionException)

Aggregations

ResourceProvider (org.mule.runtime.config.api.dsl.model.ResourceProvider)2 ClassLoaderResourceProvider (org.mule.runtime.config.internal.dsl.model.ClassLoaderResourceProvider)2 IOException (java.io.IOException)1 Before (org.junit.Before)1 MuleRuntimeException (org.mule.runtime.api.exception.MuleRuntimeException)1 ExtensionModel (org.mule.runtime.api.meta.model.ExtensionModel)1 ArtifactConfig (org.mule.runtime.config.api.dsl.processor.ArtifactConfig)1 DefaultConfigurationPropertiesResolver (org.mule.runtime.config.internal.dsl.model.config.DefaultConfigurationPropertiesResolver)1 FileConfigurationPropertiesProvider (org.mule.runtime.config.internal.dsl.model.config.FileConfigurationPropertiesProvider)1 RuntimeConfigurationException (org.mule.runtime.config.internal.dsl.model.config.RuntimeConfigurationException)1 ApplicationModel (org.mule.runtime.config.internal.model.ApplicationModel)1 BeansException (org.springframework.beans.BeansException)1 NoSuchBeanDefinitionException (org.springframework.beans.factory.NoSuchBeanDefinitionException)1