Search in sources :

Example 6 with DefaultNativeLibraryFinderFactory

use of org.mule.runtime.deployment.model.internal.nativelib.DefaultNativeLibraryFinderFactory in project mule by mulesoft.

the class IsolatedClassLoaderFactory method createApplicationArtifactClassLoader.

/**
 * Creates an {@link ArtifactClassLoader} for the application.
 *
 * @param parent the parent class loader to be assigned to the new one created here
 * @param childClassLoaderLookupPolicy look policy to be used
 * @param artifactsUrlClassification the url classifications to get plugins urls
 * @param pluginsArtifactClassLoaders the classloaders of the plugins used by the application
 * @return the {@link ArtifactClassLoader} to be used for running the test
 */
protected ArtifactClassLoader createApplicationArtifactClassLoader(ClassLoader parent, ClassLoaderLookupPolicy childClassLoaderLookupPolicy, ArtifactsUrlClassification artifactsUrlClassification, List<ArtifactClassLoader> pluginsArtifactClassLoaders) {
    List<URL> applicationUrls = new ArrayList<>();
    applicationUrls.addAll(artifactsUrlClassification.getApplicationLibUrls());
    applicationUrls.addAll(artifactsUrlClassification.getApplicationSharedLibUrls());
    logClassLoaderUrls("APP", applicationUrls);
    return new MuleApplicationClassLoader(APP_NAME, new ArtifactDescriptor(APP_NAME), parent, new DefaultNativeLibraryFinderFactory().create(APP_NAME, applicationUrls.toArray(new URL[applicationUrls.size()])), applicationUrls, childClassLoaderLookupPolicy, pluginsArtifactClassLoaders);
}
Also used : ArtifactDescriptor(org.mule.runtime.module.artifact.api.descriptor.ArtifactDescriptor) Lists.newArrayList(com.google.common.collect.Lists.newArrayList) ArrayList(java.util.ArrayList) DefaultNativeLibraryFinderFactory(org.mule.runtime.deployment.model.internal.nativelib.DefaultNativeLibraryFinderFactory) MuleApplicationClassLoader(org.mule.runtime.deployment.model.internal.application.MuleApplicationClassLoader) URL(java.net.URL)

Aggregations

DefaultNativeLibraryFinderFactory (org.mule.runtime.deployment.model.internal.nativelib.DefaultNativeLibraryFinderFactory)6 Test (org.junit.Test)5 MuleApplicationClassLoaderFactory (org.mule.runtime.deployment.model.internal.application.MuleApplicationClassLoaderFactory)5 DefaultDomainManager (org.mule.runtime.module.deployment.impl.internal.domain.DefaultDomainManager)5 TestApplicationFactory.createTestApplicationFactory (org.mule.runtime.module.deployment.internal.TestApplicationFactory.createTestApplicationFactory)5 ApplicationFileBuilder (org.mule.runtime.module.deployment.impl.internal.builder.ApplicationFileBuilder)3 Application (org.mule.runtime.deployment.model.api.application.Application)2 Lists.newArrayList (com.google.common.collect.Lists.newArrayList)1 URL (java.net.URL)1 ArrayList (java.util.ArrayList)1 Matchers.containsString (org.hamcrest.Matchers.containsString)1 MuleArtifactLoaderDescriptorBuilder (org.mule.runtime.api.deployment.meta.MuleArtifactLoaderDescriptorBuilder)1 MulePluginModel (org.mule.runtime.api.deployment.meta.MulePluginModel)1 MuleApplicationClassLoader (org.mule.runtime.deployment.model.internal.application.MuleApplicationClassLoader)1 ArtifactDescriptor (org.mule.runtime.module.artifact.api.descriptor.ArtifactDescriptor)1 ArtifactPluginFileBuilder (org.mule.runtime.module.deployment.impl.internal.builder.ArtifactPluginFileBuilder)1 JarFileBuilder (org.mule.runtime.module.deployment.impl.internal.builder.JarFileBuilder)1