Search in sources :

Example 6 with MuleDeployableArtifactClassLoader

use of org.mule.runtime.module.artifact.api.classloader.MuleDeployableArtifactClassLoader in project mule by mulesoft.

the class PolicyTemplateClassLoaderFactory method create.

@Override
public ArtifactClassLoader create(String artifactId, ArtifactClassLoader parent, PolicyTemplateDescriptor descriptor, List<ArtifactClassLoader> artifactPluginClassLoaders) {
    File rootFolder = descriptor.getRootFolder();
    if (rootFolder == null || !rootFolder.exists()) {
        throw new IllegalArgumentException("Policy folder does not exists: " + (rootFolder != null ? rootFolder.getName() : null));
    }
    final ClassLoaderLookupPolicy classLoaderLookupPolicy = parent.getClassLoaderLookupPolicy();
    MuleDeployableArtifactClassLoader deployableArtifactClassLoader = new MuleDeployableArtifactClassLoader(artifactId, descriptor, descriptor.getClassLoaderModel().getUrls(), parent.getClassLoader(), classLoaderLookupPolicy, artifactPluginClassLoaders);
    return deployableArtifactClassLoader;
}
Also used : ClassLoaderLookupPolicy(org.mule.runtime.module.artifact.api.classloader.ClassLoaderLookupPolicy) MuleDeployableArtifactClassLoader(org.mule.runtime.module.artifact.api.classloader.MuleDeployableArtifactClassLoader) File(java.io.File)

Aggregations

MuleDeployableArtifactClassLoader (org.mule.runtime.module.artifact.api.classloader.MuleDeployableArtifactClassLoader)6 ArtifactPlugin (org.mule.runtime.deployment.model.api.plugin.ArtifactPlugin)3 ArtifactPluginDescriptor (org.mule.runtime.deployment.model.api.plugin.ArtifactPluginDescriptor)3 DefaultArtifactPlugin (org.mule.runtime.module.deployment.impl.internal.plugin.DefaultArtifactPlugin)3 Test (org.junit.Test)2 Domain (org.mule.runtime.deployment.model.api.domain.Domain)2 SmallTest (org.mule.tck.size.SmallTest)2 File (java.io.File)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 LinkedHashSet (java.util.LinkedHashSet)1 Set (java.util.Set)1 DomainDescriptor (org.mule.runtime.deployment.model.api.domain.DomainDescriptor)1 PolicyTemplate (org.mule.runtime.deployment.model.api.policy.PolicyTemplate)1 ApplicationClassLoaderBuilder (org.mule.runtime.deployment.model.internal.application.ApplicationClassLoaderBuilder)1 DomainClassLoaderBuilder (org.mule.runtime.deployment.model.internal.domain.DomainClassLoaderBuilder)1 PolicyTemplateClassLoaderBuilder (org.mule.runtime.deployment.model.internal.policy.PolicyTemplateClassLoaderBuilder)1 ArtifactClassLoader (org.mule.runtime.module.artifact.api.classloader.ArtifactClassLoader)1 ClassLoaderLookupPolicy (org.mule.runtime.module.artifact.api.classloader.ClassLoaderLookupPolicy)1