use of org.mule.runtime.core.api.extension.ExtensionManager in project mule by mulesoft.
the class CompositeArtifactExtensionManagerFactory method create.
@Override
public ExtensionManager create(MuleContext muleContext) {
ExtensionManager parentExtensionManager = parentArtifact.getRegistry().<ExtensionManager>lookupByName(OBJECT_EXTENSION_MANAGER).get();
ExtensionManager extensionManager = super.create(muleContext, parentExtensionManager.getExtensions());
return new CompositeArtifactExtensionManager(parentExtensionManager, extensionManager);
}
use of org.mule.runtime.core.api.extension.ExtensionManager in project mule by mulesoft.
the class ArtifactExtensionManagerConfigurationBuilder method doConfigure.
@Override
protected void doConfigure(MuleContext muleContext) throws Exception {
ExtensionManager extensionManager = extensionManagerFactory.create(muleContext);
muleContext.setExtensionManager(extensionManager);
}
use of org.mule.runtime.core.api.extension.ExtensionManager in project mule by mulesoft.
the class ApplicationDeploymentTestCase method extensionManagerPresent.
@Test
public void extensionManagerPresent() throws Exception {
addPackedAppFromBuilder(emptyAppFileBuilder);
startDeployment();
assertApplicationDeploymentSuccess(applicationDeploymentListener, emptyAppFileBuilder.getId());
final Application app = findApp(emptyAppFileBuilder.getId(), 1);
assertThat(app.getRegistry().<ExtensionManager>lookupByName(MuleProperties.OBJECT_EXTENSION_MANAGER).get(), is(notNullValue()));
}
use of org.mule.runtime.core.api.extension.ExtensionManager in project mule by mulesoft.
the class ArtifactExtensionManagerFactory method create.
protected ExtensionManager create(MuleContext muleContext, Set<ExtensionModel> parentArtifactExtensions) {
final ExtensionManager extensionManager = extensionManagerFactory.create(muleContext);
final Set<ExtensionModel> extensions = new HashSet<>();
extensionModelDiscoverer.discoverRuntimeExtensionModels().forEach(extensionManager::registerExtension);
extensions.addAll(extensionModelDiscoverer.discoverPluginsExtensionModels(extensionModelLoaderRepository, artifactPlugins, parentArtifactExtensions).stream().map(Pair::getSecond).collect(toSet()));
extensions.forEach(extensionManager::registerExtension);
return extensionManager;
}
use of org.mule.runtime.core.api.extension.ExtensionManager in project mule by mulesoft.
the class AbstractXmlExtensionMuleArtifactFunctionalTestCase method addBuilders.
@Override
protected void addBuilders(List<ConfigurationBuilder> builders) {
super.addBuilders(builders);
builders.add(new AbstractConfigurationBuilder() {
@Override
protected void doConfigure(MuleContext muleContext) throws Exception {
ExtensionManager extensionManager;
if (muleContext.getExtensionManager() == null) {
extensionManager = createDefaultExtensionManager();
muleContext.setExtensionManager(extensionManager);
initialiseIfNeeded(extensionManager, muleContext);
}
extensionManager = muleContext.getExtensionManager();
registerXmlExtensions(extensionManager);
}
private void registerXmlExtensions(ExtensionManager extensionManager) {
// take all the plugins loaded by org.mule.test.runner.api.IsolatedClassLoaderExtensionsManagerConfigurationBuilder in the extension manager
final Set<ExtensionModel> extensions = new HashSet<>(extensionManager.getExtensions());
for (String modulePath : getModulePaths()) {
Map<String, Object> params = new HashMap<>();
params.put(XmlExtensionModelLoader.RESOURCE_XML, modulePath);
params.put(XmlExtensionModelLoader.VALIDATE_XML, shouldValidateXml());
operationsOutputPath().ifPresent(path -> params.put(XmlExtensionModelLoader.RESOURCE_DECLARATION, path));
final DslResolvingContext dslResolvingContext = getDefault(extensions);
final ExtensionModel extensionModel = new XmlExtensionModelLoader().loadExtensionModel(getClass().getClassLoader(), dslResolvingContext, params);
extensions.add(extensionModel);
}
for (ExtensionModel extension : extensions) {
extensionManager.registerExtension(extension);
}
}
});
}
Aggregations