Search in sources :

Example 11 with DomainDescriptor

use of org.mule.runtime.deployment.model.api.domain.DomainDescriptor in project mule by mulesoft.

the class DomainClassLoaderFactoryTestCase method getTestDescriptor.

private DomainDescriptor getTestDescriptor(String name) {
    DomainDescriptor descriptor = new DomainDescriptor(name);
    descriptor.setRedeploymentEnabled(false);
    return descriptor;
}
Also used : DomainDescriptor(org.mule.runtime.deployment.model.api.domain.DomainDescriptor)

Example 12 with DomainDescriptor

use of org.mule.runtime.deployment.model.api.domain.DomainDescriptor in project mule by mulesoft.

the class ApplicationClassLoaderBuilder method getParentLookupPolicy.

@Override
protected ClassLoaderLookupPolicy getParentLookupPolicy(ArtifactClassLoader parentClassLoader) {
    Map<String, LookupStrategy> lookupStrategies = new HashMap<>();
    DomainDescriptor descriptor = parentClassLoader.getArtifactDescriptor();
    descriptor.getClassLoaderModel().getExportedPackages().forEach(p -> lookupStrategies.put(p, PARENT_FIRST));
    for (ArtifactPluginDescriptor artifactPluginDescriptor : descriptor.getPlugins()) {
        artifactPluginDescriptor.getClassLoaderModel().getExportedPackages().forEach(p -> lookupStrategies.put(p, PARENT_FIRST));
    }
    return parentClassLoader.getClassLoaderLookupPolicy().extend(lookupStrategies);
}
Also used : HashMap(java.util.HashMap) ArtifactPluginDescriptor(org.mule.runtime.deployment.model.api.plugin.ArtifactPluginDescriptor) LookupStrategy(org.mule.runtime.module.artifact.api.classloader.LookupStrategy) DomainDescriptor(org.mule.runtime.deployment.model.api.domain.DomainDescriptor)

Aggregations

DomainDescriptor (org.mule.runtime.deployment.model.api.domain.DomainDescriptor)12 Test (org.junit.Test)5 Domain (org.mule.runtime.deployment.model.api.domain.Domain)4 ArtifactPluginDescriptor (org.mule.runtime.deployment.model.api.plugin.ArtifactPluginDescriptor)4 File (java.io.File)3 ArtifactClassLoader (org.mule.runtime.module.artifact.api.classloader.ArtifactClassLoader)3 HashMap (java.util.HashMap)2 ApplicationDescriptor (org.mule.runtime.deployment.model.api.application.ApplicationDescriptor)2 MuleApplicationClassLoader (org.mule.runtime.deployment.model.internal.application.MuleApplicationClassLoader)2 DomainClassLoaderBuilder (org.mule.runtime.deployment.model.internal.domain.DomainClassLoaderBuilder)2 LookupStrategy (org.mule.runtime.module.artifact.api.classloader.LookupStrategy)2 URL (java.net.URL)1 LinkedList (java.util.LinkedList)1 Before (org.junit.Before)1 Application (org.mule.runtime.deployment.model.api.application.Application)1 ArtifactPlugin (org.mule.runtime.deployment.model.api.plugin.ArtifactPlugin)1 MuleSharedDomainClassLoader (org.mule.runtime.deployment.model.internal.domain.MuleSharedDomainClassLoader)1 ClassLoaderLookupPolicy (org.mule.runtime.module.artifact.api.classloader.ClassLoaderLookupPolicy)1 MuleDeployableArtifactClassLoader (org.mule.runtime.module.artifact.api.classloader.MuleDeployableArtifactClassLoader)1 ClassLoaderModel (org.mule.runtime.module.artifact.api.descriptor.ClassLoaderModel)1