Search in sources :

Example 1 with RuntimeExtensionModelProvider

use of org.mule.runtime.core.api.extension.RuntimeExtensionModelProvider in project mule by mulesoft.

the class ExtensionModelDiscoverer method discoverRuntimeExtensionModels.

/**
 * Discover the extension models provided by the runtime.
 *
 * @return {@link Set} of the runtime provided {@link ExtensionModel}s.
 */
public Set<ExtensionModel> discoverRuntimeExtensionModels() {
    final Set<ExtensionModel> extensionModels = new HashSet<>();
    Collection<RuntimeExtensionModelProvider> runtimeExtensionModelProviders = new SpiServiceRegistry().lookupProviders(RuntimeExtensionModelProvider.class, Thread.currentThread().getContextClassLoader());
    for (RuntimeExtensionModelProvider runtimeExtensionModelProvider : runtimeExtensionModelProviders) {
        extensionModels.add(runtimeExtensionModelProvider.createExtensionModel());
    }
    return extensionModels;
}
Also used : RuntimeExtensionModelProvider(org.mule.runtime.core.api.extension.RuntimeExtensionModelProvider) ExtensionModel(org.mule.runtime.api.meta.model.ExtensionModel) SpiServiceRegistry(org.mule.runtime.core.api.registry.SpiServiceRegistry) HashSet(java.util.HashSet)

Aggregations

HashSet (java.util.HashSet)1 ExtensionModel (org.mule.runtime.api.meta.model.ExtensionModel)1 RuntimeExtensionModelProvider (org.mule.runtime.core.api.extension.RuntimeExtensionModelProvider)1 SpiServiceRegistry (org.mule.runtime.core.api.registry.SpiServiceRegistry)1