Search in sources :

Example 56 with ExtensionModel

use of org.mule.runtime.api.meta.model.ExtensionModel in project mule by mulesoft.

the class ConfigurationProviderObjectFactory method createInnerInstance.

private ConfigurationProvider createInnerInstance() throws ConfigurationException {
    if (expirationPolicy == null) {
        expirationPolicy = muleContext.getConfiguration().getDynamicConfigExpiration().getExpirationPolicy();
    }
    ResolverSet resolverSet = getParametersResolver().getParametersAsHashedResolverSet(configurationModel, muleContext);
    final ConnectionProviderValueResolver connectionProviderResolver = getConnectionProviderResolver();
    return withContextClassLoader(getExtensionClassLoader(), () -> {
        connectionProviderResolver.getResolverSet().ifPresent((CheckedConsumer) resolver -> initialiseIfNeeded(resolver, true, muleContext));
        ConfigurationProvider configurationProvider;
        try {
            if (resolverSet.isDynamic() || connectionProviderResolver.isDynamic()) {
                configurationProvider = configurationProviderFactory.createDynamicConfigurationProvider(name, extensionModel, configurationModel, resolverSet, connectionProviderResolver, expirationPolicy, reflectionCache, muleContext);
            } else {
                configurationProvider = configurationProviderFactory.createStaticConfigurationProvider(name, extensionModel, configurationModel, resolverSet, connectionProviderResolver, reflectionCache, muleContext);
            }
        } catch (Exception e) {
            throw new MuleRuntimeException(createStaticMessage(format("Could not create an implicit configuration '%s' for the extension '%s'", configurationModel.getName(), extensionModel.getName())), e);
        }
        return configurationProvider;
    });
}
Also used : ResolverSet(org.mule.runtime.module.extension.internal.runtime.resolver.ResolverSet) Optional.empty(java.util.Optional.empty) Thread.currentThread(java.lang.Thread.currentThread) LifecycleUtils.initialiseIfNeeded(org.mule.runtime.core.api.lifecycle.LifecycleUtils.initialiseIfNeeded) ConnectionProviderValueResolver(org.mule.runtime.module.extension.internal.runtime.resolver.ConnectionProviderValueResolver) ResolverSet(org.mule.runtime.module.extension.internal.runtime.resolver.ResolverSet) ExpirationPolicy(org.mule.runtime.extension.api.runtime.ExpirationPolicy) MuleContext(org.mule.runtime.core.api.MuleContext) DefaultConfigurationProviderFactory(org.mule.runtime.module.extension.internal.runtime.config.DefaultConfigurationProviderFactory) ClassUtils.withContextClassLoader(org.mule.runtime.core.api.util.ClassUtils.withContextClassLoader) ObjectFactory(org.mule.runtime.dsl.api.component.ObjectFactory) CheckedConsumer(org.mule.runtime.core.api.util.func.CheckedConsumer) ConfigurationException(org.mule.runtime.core.api.config.ConfigurationException) ConfigurationProvider(org.mule.runtime.extension.api.runtime.config.ConfigurationProvider) Optional.ofNullable(java.util.Optional.ofNullable) I18nMessageFactory.createStaticMessage(org.mule.runtime.api.i18n.I18nMessageFactory.createStaticMessage) ImplicitConnectionProviderValueResolver(org.mule.runtime.module.extension.internal.runtime.resolver.ImplicitConnectionProviderValueResolver) MuleRuntimeException(org.mule.runtime.api.exception.MuleRuntimeException) ConfigurationModel(org.mule.runtime.api.meta.model.config.ConfigurationModel) ClassLoaderModelProperty(org.mule.runtime.extension.api.property.ClassLoaderModelProperty) StaticConnectionProviderResolver(org.mule.runtime.module.extension.internal.runtime.resolver.StaticConnectionProviderResolver) String.format(java.lang.String.format) ExtensionModel(org.mule.runtime.api.meta.model.ExtensionModel) ConnectionProviderResolver(org.mule.runtime.module.extension.internal.runtime.resolver.ConnectionProviderResolver) AbstractExtensionObjectFactory(org.mule.runtime.module.extension.internal.config.dsl.AbstractExtensionObjectFactory) ConfigurationProviderFactory(org.mule.runtime.module.extension.internal.runtime.config.ConfigurationProviderFactory) Optional(java.util.Optional) ConfigurationProvider(org.mule.runtime.extension.api.runtime.config.ConfigurationProvider) ConnectionProviderValueResolver(org.mule.runtime.module.extension.internal.runtime.resolver.ConnectionProviderValueResolver) ImplicitConnectionProviderValueResolver(org.mule.runtime.module.extension.internal.runtime.resolver.ImplicitConnectionProviderValueResolver) MuleRuntimeException(org.mule.runtime.api.exception.MuleRuntimeException) ConfigurationException(org.mule.runtime.core.api.config.ConfigurationException) MuleRuntimeException(org.mule.runtime.api.exception.MuleRuntimeException)

Example 57 with ExtensionModel

use of org.mule.runtime.api.meta.model.ExtensionModel in project mule by mulesoft.

the class ExtensionModelJsonGeneratorTestCase method data.

@Parameterized.Parameters(name = "{1}")
public static Collection<Object[]> data() {
    final ClassLoader classLoader = ExtensionModelJsonGeneratorTestCase.class.getClassLoader();
    final ServiceRegistry serviceRegistry = mock(ServiceRegistry.class);
    when(serviceRegistry.lookupProviders(DeclarationEnricher.class, classLoader)).thenReturn(asList(new JavaXmlDeclarationEnricher()));
    List<ExtensionJsonGeneratorTestUnit> extensions;
    extensions = asList(newTestUnit(javaLoader, VeganExtension.class, "vegan.json"), newTestUnit(javaLoader, PetStoreConnector.class, "petstore.json"), newTestUnit(javaLoader, MetadataExtension.class, "metadata.json"), newTestUnit(javaLoader, HeisenbergExtension.class, "heisenberg.json"), newTestUnit(javaLoader, SubstitutionGroupExtension.class, "substitutiongroup.json"), newTestUnit(javaLoader, TransactionalExtension.class, "tx-ext.json"), newTestUnit(javaLoader, SubTypesMappingConnector.class, "subtypes.json"), newTestUnit(javaLoader, MarvelExtension.class, "marvel.json"), newTestUnit(soapLoader, RickAndMortyExtension.class, "ram.json"), newTestUnit(javaLoader, TypedValueExtension.class, "typed-value.json"), newTestUnit(javaLoader, TestOAuthExtension.class, "test-oauth.json"), newTestUnit(javaLoader, WeaveFunctionExtension.class, "test-fn.json"), newTestUnit(javaLoader, ValuesExtension.class, "values.json"), newTestUnit(javaLoader, ReconnectionExtension.class, "reconnection-extension.json"));
    BiFunction<Class<?>, ExtensionModelLoader, ExtensionModel> createExtensionModel = (extension, loader) -> {
        ExtensionModel model = loadExtension(extension, loader);
        if (extensionModels.put(model.getName(), model) != null) {
            throw new IllegalArgumentException(format("Extension names must be unique. Name [%s] for extension [%s] was already used", model.getName(), extension.getName()));
        }
        return model;
    };
    return extensions.stream().map(e -> new Object[] { createExtensionModel.apply(e.getExtensionClass(), e.getLoader()), e.getFileName() }).collect(toList());
}
Also used : CoreMatchers.is(org.hamcrest.CoreMatchers.is) IOUtils.getResourceAsUrl(org.mule.runtime.core.api.util.IOUtils.getResourceAsUrl) TestOAuthExtension(org.mule.test.oauth.TestOAuthExtension) URISyntaxException(java.net.URISyntaxException) BiFunction(java.util.function.BiFunction) MetadataExtension(org.mule.test.metadata.extension.MetadataExtension) SmallTest(org.mule.tck.size.SmallTest) Arrays.asList(java.util.Arrays.asList) Map(java.util.Map) DslResolvingContext(org.mule.runtime.api.dsl.DslResolvingContext) ServiceRegistry(org.mule.runtime.core.api.registry.ServiceRegistry) DeclarationEnricher(org.mule.runtime.extension.api.loader.DeclarationEnricher) Parameterized(org.junit.runners.Parameterized) ExtensionJsonGeneratorTestUnit.newTestUnit(org.mule.runtime.module.extension.internal.resources.ExtensionModelJsonGeneratorTestCase.ExtensionJsonGeneratorTestUnit.newTestUnit) DefaultJavaExtensionModelLoader(org.mule.runtime.module.extension.api.loader.java.DefaultJavaExtensionModelLoader) Collection(java.util.Collection) ExtensionModelJsonSerializer(org.mule.runtime.extension.api.persistence.ExtensionModelJsonSerializer) String.format(java.lang.String.format) List(java.util.List) IOUtils.getResourceAsString(org.mule.runtime.core.api.util.IOUtils.getResourceAsString) DslResolvingContext.getDefault(org.mule.runtime.api.dsl.DslResolvingContext.getDefault) FileUtils.stringToFile(org.mule.runtime.core.api.util.FileUtils.stringToFile) MarvelExtension(org.mule.test.marvel.MarvelExtension) Mockito.mock(org.mockito.Mockito.mock) RickAndMortyExtension(org.mule.test.ram.RickAndMortyExtension) RunWith(org.junit.runner.RunWith) HashMap(java.util.HashMap) WeaveFunctionExtension(org.mule.test.function.extension.WeaveFunctionExtension) JSONAssert(org.skyscreamer.jsonassert.JSONAssert) SoapExtensionModelLoader(org.mule.runtime.module.extension.soap.api.loader.SoapExtensionModelLoader) AbstractMuleTestCase(org.mule.tck.junit4.AbstractMuleTestCase) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) ExtensionModelLoader(org.mule.runtime.extension.api.loader.ExtensionModelLoader) HeisenbergExtension(org.mule.test.heisenberg.extension.HeisenbergExtension) TransactionalExtension(org.mule.test.transactional.TransactionalExtension) TypedValueExtension(org.mule.test.typed.value.extension.extension.TypedValueExtension) Before(org.junit.Before) ValuesExtension(org.mule.test.values.extension.ValuesExtension) Collections.emptySet(java.util.Collections.emptySet) PetStoreConnector(org.mule.test.petstore.extension.PetStoreConnector) SubstitutionGroupExtension(org.mule.test.substitutiongroup.extension.SubstitutionGroupExtension) IOException(java.io.IOException) Test(org.junit.Test) Mockito.when(org.mockito.Mockito.when) VERSION(org.mule.runtime.module.extension.api.loader.AbstractJavaExtensionModelLoader.VERSION) VeganExtension(org.mule.test.vegan.extension.VeganExtension) File(java.io.File) ExtensionModel(org.mule.runtime.api.meta.model.ExtensionModel) Collectors.toList(java.util.stream.Collectors.toList) ReconnectionExtension(org.mule.extension.test.extension.reconnection.ReconnectionExtension) TYPE_PROPERTY_NAME(org.mule.runtime.module.extension.api.loader.AbstractJavaExtensionModelLoader.TYPE_PROPERTY_NAME) SubTypesMappingConnector(org.mule.test.subtypes.extension.SubTypesMappingConnector) JavaXmlDeclarationEnricher(org.mule.runtime.module.extension.internal.loader.enricher.JavaXmlDeclarationEnricher) JavaXmlDeclarationEnricher(org.mule.runtime.module.extension.internal.loader.enricher.JavaXmlDeclarationEnricher) ExtensionModel(org.mule.runtime.api.meta.model.ExtensionModel) DefaultJavaExtensionModelLoader(org.mule.runtime.module.extension.api.loader.java.DefaultJavaExtensionModelLoader) SoapExtensionModelLoader(org.mule.runtime.module.extension.soap.api.loader.SoapExtensionModelLoader) ExtensionModelLoader(org.mule.runtime.extension.api.loader.ExtensionModelLoader) ServiceRegistry(org.mule.runtime.core.api.registry.ServiceRegistry)

Example 58 with ExtensionModel

use of org.mule.runtime.api.meta.model.ExtensionModel in project mule by mulesoft.

the class DefaultConnectionProviderObjectBuilder method applyExtensionClassLoaderProxy.

/**
 * Wraps the {@link ConnectionProvider} inside of a dynamic proxy which changes the current {@link ClassLoader} to the the
 * extension's {@link ClassLoader} when executing any method of this wrapped {@link ConnectionProvider}
 * <p>
 * This ensures that every time that the {@link ConnectionProvider} is used, it will work in the correct classloader.
 * <p>
 * Although if the {@link ConnectionProvider} is created with the correct classloader and then used with an incorrect one this
 * may work, due that static class references were loaded correctly, logic loading class in a dynamic way will fail.
 *
 * @param provider The {@link ConnectionProvider} to wrap
 * @return The wrapped {@link ConnectionProvider}
 */
private ConnectionProvider<C> applyExtensionClassLoaderProxy(ConnectionProvider provider) {
    Enhancer enhancer = new Enhancer();
    ClassLoader classLoader = getClassLoader(extensionModel);
    Class[] proxyInterfaces = getProxyInterfaces(provider);
    enhancer.setInterfaces(proxyInterfaces);
    MethodInterceptor returnProviderInterceptor = (obj, method, args, proxy) -> provider;
    MethodInterceptor invokerInterceptor = (obj, method, args, proxy) -> {
        Reference<Object> resultReference = new Reference<>();
        Reference<Throwable> errorReference = new Reference<>();
        withContextClassLoader(classLoader, () -> {
            try {
                resultReference.set(method.invoke(provider, args));
            } catch (InvocationTargetException e) {
                errorReference.set(e.getTargetException());
            } catch (Throwable t) {
                errorReference.set(t);
            }
        });
        if (errorReference.get() != null) {
            throw errorReference.get();
        } else {
            return resultReference.get();
        }
    };
    CallbackHelper callbackHelper = new CallbackHelper(Object.class, proxyInterfaces) {

        @Override
        protected Object getCallback(Method method) {
            if (method.getDeclaringClass().equals(HasDelegate.class) && method.getName().equals("getDelegate")) {
                return returnProviderInterceptor;
            } else {
                return invokerInterceptor;
            }
        }
    };
    enhancer.setCallbackTypes(callbackHelper.getCallbackTypes());
    enhancer.setCallbackFilter(callbackHelper);
    if (Enhancer.class.getClassLoader() != classLoader) {
        enhancer.setClassLoader(new CompositeClassLoader(DefaultConnectionProviderObjectBuilder.class.getClassLoader(), classLoader));
        enhancer.setUseCache(false);
    }
    Class<ConnectionProvider<C>> proxyClass = enhancer.createClass();
    registerStaticCallbacks(proxyClass, callbackHelper.getCallbacks());
    try {
        return proxyClass.newInstance();
    } catch (InstantiationException | IllegalAccessException e) {
        throw new MuleRuntimeException(e);
    }
}
Also used : ErrorTypeHandlerConnectionProviderWrapper(org.mule.runtime.core.internal.connection.ErrorTypeHandlerConnectionProviderWrapper) ConnectionProviderModel(org.mule.runtime.api.meta.model.connection.ConnectionProviderModel) MuleExtensionUtils.getClassLoader(org.mule.runtime.module.extension.internal.util.MuleExtensionUtils.getClassLoader) ResolverSet(org.mule.runtime.module.extension.internal.runtime.resolver.ResolverSet) POOLING(org.mule.runtime.api.meta.model.connection.ConnectionManagementType.POOLING) ClassUtils(org.apache.commons.lang3.ClassUtils) MuleContext(org.mule.runtime.core.api.MuleContext) MuleException(org.mule.runtime.api.exception.MuleException) ReconnectableConnectionProviderWrapper(org.mule.runtime.core.internal.connection.ReconnectableConnectionProviderWrapper) PoolingProfile(org.mule.runtime.api.config.PoolingProfile) ClassUtils.withContextClassLoader(org.mule.runtime.core.api.util.ClassUtils.withContextClassLoader) Pair(org.mule.runtime.api.util.Pair) Enhancer(net.sf.cglib.proxy.Enhancer) Method(java.lang.reflect.Method) PoolingConnectionProviderWrapper(org.mule.runtime.core.internal.connection.PoolingConnectionProviderWrapper) IntrospectionUtils.injectFields(org.mule.runtime.module.extension.internal.util.IntrospectionUtils.injectFields) Enhancer.registerStaticCallbacks(net.sf.cglib.proxy.Enhancer.registerStaticCallbacks) CallbackHelper(net.sf.cglib.proxy.CallbackHelper) ConnectionProvider(org.mule.runtime.api.connection.ConnectionProvider) ResolverSetBasedObjectBuilder(org.mule.runtime.module.extension.internal.runtime.objectbuilder.ResolverSetBasedObjectBuilder) MethodInterceptor(net.sf.cglib.proxy.MethodInterceptor) CompositeClassLoader(org.mule.runtime.core.internal.util.CompositeClassLoader) MuleRuntimeException(org.mule.runtime.api.exception.MuleRuntimeException) Initialisable(org.mule.runtime.api.lifecycle.Initialisable) ConnectionManagementType(org.mule.runtime.api.meta.model.connection.ConnectionManagementType) ExtensionModel(org.mule.runtime.api.meta.model.ExtensionModel) InvocationTargetException(java.lang.reflect.InvocationTargetException) List(java.util.List) HasDelegate(org.mule.runtime.core.internal.connection.HasDelegate) ReconnectionConfig(org.mule.runtime.core.internal.retry.ReconnectionConfig) Reference(org.mule.runtime.api.util.Reference) ResolverSetResult(org.mule.runtime.module.extension.internal.runtime.resolver.ResolverSetResult) Enhancer(net.sf.cglib.proxy.Enhancer) CallbackHelper(net.sf.cglib.proxy.CallbackHelper) Reference(org.mule.runtime.api.util.Reference) Method(java.lang.reflect.Method) HasDelegate(org.mule.runtime.core.internal.connection.HasDelegate) InvocationTargetException(java.lang.reflect.InvocationTargetException) ConnectionProvider(org.mule.runtime.api.connection.ConnectionProvider) MethodInterceptor(net.sf.cglib.proxy.MethodInterceptor) MuleRuntimeException(org.mule.runtime.api.exception.MuleRuntimeException) MuleExtensionUtils.getClassLoader(org.mule.runtime.module.extension.internal.util.MuleExtensionUtils.getClassLoader) ClassUtils.withContextClassLoader(org.mule.runtime.core.api.util.ClassUtils.withContextClassLoader) CompositeClassLoader(org.mule.runtime.core.internal.util.CompositeClassLoader) CompositeClassLoader(org.mule.runtime.core.internal.util.CompositeClassLoader)

Example 59 with ExtensionModel

use of org.mule.runtime.api.meta.model.ExtensionModel in project mule by mulesoft.

the class ExtensionConnectionSupplier method getTransactedConnectionHandler.

private <T extends TransactionalConnection> ConnectionHandler<T> getTransactedConnectionHandler(ExecutionContextAdapter<? extends ComponentModel> executionContext, TransactionConfig transactionConfig) throws ConnectionException, TransactionException {
    if (!transactionConfig.isTransacted()) {
        return getTransactionlessConnectionHandler(executionContext);
    }
    ExtensionModel extensionModel = executionContext.getExtensionModel();
    ComponentModel componentModel = executionContext.getComponentModel();
    ConfigurationInstance configuration = executionContext.getConfiguration().orElseThrow(() -> new IllegalStateException(format("%s '%s' of extension '%s' cannot participate in a transaction because it doesn't have a config", getComponentModelTypeName(componentModel), componentModel.getName(), extensionModel.getName())));
    final ExtensionTransactionKey txKey = new ExtensionTransactionKey(configuration);
    TransactionBindingDelegate transactionBindingDelegate = new TransactionBindingDelegate(extensionModel, componentModel);
    return transactionBindingDelegate.getBoundResource(transactionConfig, txKey, () -> getTransactionlessConnectionHandler(executionContext));
}
Also used : ExtensionModel(org.mule.runtime.api.meta.model.ExtensionModel) ComponentModel(org.mule.runtime.api.meta.model.ComponentModel) TransactionBindingDelegate(org.mule.runtime.module.extension.internal.runtime.transaction.TransactionBindingDelegate) ExtensionTransactionKey(org.mule.runtime.module.extension.internal.runtime.transaction.ExtensionTransactionKey) ConfigurationInstance(org.mule.runtime.extension.api.runtime.config.ConfigurationInstance)

Example 60 with ExtensionModel

use of org.mule.runtime.api.meta.model.ExtensionModel in project mule by mulesoft.

the class ApplicationModel method convertArtifactDeclarationToComponentModel.

private void convertArtifactDeclarationToComponentModel(Set<ExtensionModel> extensionModels, ArtifactDeclaration artifactDeclaration) {
    if (artifactDeclaration != null && !extensionModels.isEmpty()) {
        ExtensionModel muleModel = MuleExtensionModelProvider.getExtensionModel();
        if (!extensionModels.contains(muleModel)) {
            extensionModels = new HashSet<>(extensionModels);
            extensionModels.add(muleModel);
        }
        DslElementModelFactory elementFactory = DslElementModelFactory.getDefault(DslResolvingContext.getDefault(extensionModels));
        ComponentModel rootComponent = new ComponentModel.Builder().setIdentifier(ComponentIdentifier.builder().namespace(CORE_PREFIX).name(CORE_PREFIX).build()).build();
        AtomicBoolean atLeastOneComponentAdded = new AtomicBoolean(false);
        artifactDeclaration.getGlobalElements().stream().map(e -> elementFactory.create((ElementDeclaration) e)).filter(Optional::isPresent).map(e -> e.get().getConfiguration()).forEach(config -> config.ifPresent(c -> {
            atLeastOneComponentAdded.set(true);
            ComponentModel componentModel = convertComponentConfiguration(c, true);
            componentModel.setParent(rootComponent);
            rootComponent.getInnerComponents().add(componentModel);
        }));
        if (atLeastOneComponentAdded.get()) {
            this.muleComponentModels.add(rootComponent);
        }
    }
}
Also used : ResourceProvider(org.mule.runtime.config.api.dsl.model.ResourceProvider) MacroExpansionModulesModel(org.mule.runtime.config.internal.dsl.model.extension.xml.MacroExpansionModulesModel) CORE_PREFIX(org.mule.runtime.internal.dsl.DslConstants.CORE_PREFIX) MULE_ROOT_ELEMENT(org.mule.runtime.config.api.dsl.CoreDslConstants.MULE_ROOT_ELEMENT) Optional.of(java.util.Optional.of) InitialisationException(org.mule.runtime.api.lifecycle.InitialisationException) ConfigurationProperty(org.mule.runtime.config.api.dsl.model.properties.ConfigurationProperty) Collections.singletonList(java.util.Collections.singletonList) ClassUtils(org.apache.commons.lang3.ClassUtils) DefaultConfigurationParameters(org.mule.runtime.config.internal.dsl.model.DefaultConfigurationParameters) Arrays.asList(java.util.Arrays.asList) Map(java.util.Map) MULE_EE_DOMAIN_IDENTIFIER(org.mule.runtime.config.api.dsl.CoreDslConstants.MULE_EE_DOMAIN_IDENTIFIER) DslResolvingContext(org.mule.runtime.api.dsl.DslResolvingContext) DslElementModelFactory(org.mule.runtime.config.api.dsl.model.DslElementModelFactory) ERROR_HANDLER_IDENTIFIER(org.mule.runtime.config.api.dsl.CoreDslConstants.ERROR_HANDLER_IDENTIFIER) ComponentModelReader(org.mule.runtime.config.internal.dsl.model.ComponentModelReader) CompositeConfigurationPropertiesProvider(org.mule.runtime.config.internal.dsl.model.config.CompositeConfigurationPropertiesProvider) PropertiesResolverConfigurationProperties(org.mule.runtime.config.internal.dsl.model.config.PropertiesResolverConfigurationProperties) EnvironmentPropertiesConfigurationProvider(org.mule.runtime.config.internal.dsl.model.config.EnvironmentPropertiesConfigurationProvider) MULE_DOMAIN_IDENTIFIER(org.mule.runtime.config.api.dsl.CoreDslConstants.MULE_DOMAIN_IDENTIFIER) DEFAULT_EXPRESSION_PREFIX(org.mule.runtime.core.api.el.ExpressionManager.DEFAULT_EXPRESSION_PREFIX) ImmutableSet(com.google.common.collect.ImmutableSet) ComponentModelHelper.resolveComponentType(org.mule.runtime.config.internal.dsl.spring.ComponentModelHelper.resolveComponentType) MapConfigurationPropertiesProvider(org.mule.runtime.config.internal.dsl.model.config.MapConfigurationPropertiesProvider) TypedComponentIdentifier(org.mule.runtime.api.component.TypedComponentIdentifier) ImmutableMap(com.google.common.collect.ImmutableMap) Set(java.util.Set) UNKNOWN(org.mule.runtime.api.component.TypedComponentIdentifier.ComponentType.UNKNOWN) MuleRuntimeException(org.mule.runtime.api.exception.MuleRuntimeException) ServiceLoader(java.util.ServiceLoader) SOURCE_TYPE(org.mule.runtime.config.internal.dsl.spring.BeanDefinitionFactory.SOURCE_TYPE) NameValidationUtil.verifyStringDoesNotContainsReservedCharacters(org.mule.runtime.internal.util.NameValidationUtil.verifyStringDoesNotContainsReservedCharacters) String.format(java.lang.String.format) FileConfigurationPropertiesProvider(org.mule.runtime.config.internal.dsl.model.config.FileConfigurationPropertiesProvider) ERROR_HANDLER(org.mule.runtime.config.api.dsl.CoreDslConstants.ERROR_HANDLER) I18nMessageFactory(org.mule.runtime.api.i18n.I18nMessageFactory) XmlCustomAttributeHandler(org.mule.runtime.config.internal.dsl.processor.xml.XmlCustomAttributeHandler) ComponentBuildingDefinition(org.mule.runtime.dsl.api.component.ComponentBuildingDefinition) List(java.util.List) ElementDeclaration(org.mule.runtime.app.declaration.api.ElementDeclaration) GlobalPropertyConfigurationPropertiesProvider(org.mule.runtime.config.internal.dsl.model.config.GlobalPropertyConfigurationPropertiesProvider) Optional(java.util.Optional) QName(javax.xml.namespace.QName) MuleExtensionModelProvider(org.mule.runtime.core.api.extension.MuleExtensionModelProvider) ComponentIdentifier.builder(org.mule.runtime.api.component.ComponentIdentifier.builder) Optional.empty(java.util.Optional.empty) ComponentBuildingDefinitionRegistry(org.mule.runtime.config.api.dsl.model.ComponentBuildingDefinitionRegistry) DefaultComponentLocation(org.mule.runtime.dsl.api.component.config.DefaultComponentLocation) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) HashMap(java.util.HashMap) LifecycleUtils.initialiseIfNeeded(org.mule.runtime.core.api.lifecycle.LifecycleUtils.initialiseIfNeeded) ConfigurationProperties(org.mule.runtime.api.component.ConfigurationProperties) ComponentConfiguration(org.mule.runtime.dsl.api.component.config.ComponentConfiguration) ComponentLocationVisitor(org.mule.runtime.config.internal.dsl.model.ComponentLocationVisitor) NameUtils.pluralize(org.mule.runtime.extension.api.util.NameUtils.pluralize) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) MULE_IDENTIFIER(org.mule.runtime.config.api.dsl.CoreDslConstants.MULE_IDENTIFIER) ConfigurationPropertiesProvider(org.mule.runtime.config.api.dsl.model.properties.ConfigurationPropertiesProvider) ArtifactDeclaration(org.mule.runtime.app.declaration.api.ArtifactDeclaration) Component(org.mule.runtime.api.component.Component) Node(org.w3c.dom.Node) BiConsumer(java.util.function.BiConsumer) FLOW_IDENTIFIER(org.mule.runtime.config.api.dsl.CoreDslConstants.FLOW_IDENTIFIER) RuntimeConfigurationException(org.mule.runtime.config.internal.dsl.model.config.RuntimeConfigurationException) ConfigLine(org.mule.runtime.config.api.dsl.processor.ConfigLine) ConfigFile(org.mule.runtime.config.api.dsl.processor.ConfigFile) DefaultConfigurationProperty(org.mule.runtime.config.internal.dsl.model.config.DefaultConfigurationProperty) LinkedList(java.util.LinkedList) Collections.emptyMap(java.util.Collections.emptyMap) Collections.emptySet(java.util.Collections.emptySet) ConfigurationException(org.mule.runtime.core.api.config.ConfigurationException) Optional.ofNullable(java.util.Optional.ofNullable) I18nMessageFactory.createStaticMessage(org.mule.runtime.api.i18n.I18nMessageFactory.createStaticMessage) NameUtils.hyphenize(org.mule.runtime.extension.api.util.NameUtils.hyphenize) ConfigurationParameters(org.mule.runtime.config.api.dsl.model.ConfigurationParameters) ExtensionModelHelper(org.mule.runtime.config.internal.dsl.model.ExtensionModelHelper) ArtifactConfig(org.mule.runtime.config.api.dsl.processor.ArtifactConfig) DefaultConfigurationPropertiesResolver(org.mule.runtime.config.internal.dsl.model.config.DefaultConfigurationPropertiesResolver) Joiner.on(com.google.common.base.Joiner.on) ObjectTypeVisitor(org.mule.runtime.config.internal.dsl.processor.ObjectTypeVisitor) AbstractComponent(org.mule.runtime.api.component.AbstractComponent) ExtensionModel(org.mule.runtime.api.meta.model.ExtensionModel) ConfigurationPropertiesResolver(org.mule.runtime.config.internal.dsl.model.config.ConfigurationPropertiesResolver) FLOW_REF_IDENTIFIER(org.mule.runtime.config.api.dsl.CoreDslConstants.FLOW_REF_IDENTIFIER) Consumer(java.util.function.Consumer) Collectors.toList(java.util.stream.Collectors.toList) ConfigurationPropertiesProviderFactory(org.mule.runtime.config.api.dsl.model.properties.ConfigurationPropertiesProviderFactory) StringUtils.isBlank(org.apache.commons.lang3.StringUtils.isBlank) CollectionUtils.disjunction(org.apache.commons.collections.CollectionUtils.disjunction) ComponentIdentifier(org.mule.runtime.api.component.ComponentIdentifier) ANY_IDENTIFIER(org.mule.runtime.core.api.exception.Errors.Identifiers.ANY_IDENTIFIER) DslElementModelFactory(org.mule.runtime.config.api.dsl.model.DslElementModelFactory) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) Optional(java.util.Optional) ExtensionModel(org.mule.runtime.api.meta.model.ExtensionModel)

Aggregations

ExtensionModel (org.mule.runtime.api.meta.model.ExtensionModel)94 Test (org.junit.Test)50 SmallTest (org.mule.tck.size.SmallTest)34 OperationModel (org.mule.runtime.api.meta.model.operation.OperationModel)31 Optional (java.util.Optional)26 ConfigurationModel (org.mule.runtime.api.meta.model.config.ConfigurationModel)24 List (java.util.List)22 Set (java.util.Set)19 MuleRuntimeException (org.mule.runtime.api.exception.MuleRuntimeException)19 ParameterModel (org.mule.runtime.api.meta.model.parameter.ParameterModel)19 ConnectionProviderModel (org.mule.runtime.api.meta.model.connection.ConnectionProviderModel)16 HashMap (java.util.HashMap)15 SourceModel (org.mule.runtime.api.meta.model.source.SourceModel)15 String.format (java.lang.String.format)13 Collectors.toList (java.util.stream.Collectors.toList)13 HashSet (java.util.HashSet)12 Map (java.util.Map)12 Reference (org.mule.runtime.api.util.Reference)12 Optional.empty (java.util.Optional.empty)11 ObjectType (org.mule.metadata.api.model.ObjectType)11