Search in sources :

Example 1 with ArtifactUrlClassification

use of org.mule.test.runner.api.ArtifactUrlClassification in project mule by mulesoft.

the class IsolatedClassLoaderFactory method createServiceClassLoaders.

/**
 * For each service defined in the classification it creates an {@link ArtifactClassLoader} wit the name defined in
 * classification.
 *
 * @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 service {@link URL}s
 * @return a list of {@link ArtifactClassLoader} for service class loaders
 */
protected List<ArtifactClassLoader> createServiceClassLoaders(ClassLoader parent, ClassLoaderLookupPolicy childClassLoaderLookupPolicy, ArtifactsUrlClassification artifactsUrlClassification) {
    List<ArtifactClassLoader> servicesArtifactClassLoaders = newArrayList();
    for (ArtifactUrlClassification serviceUrlClassification : artifactsUrlClassification.getServiceUrlClassifications()) {
        logClassLoaderUrls("SERVICE (" + serviceUrlClassification.getArtifactId() + ")", serviceUrlClassification.getUrls());
        MuleArtifactClassLoader artifactClassLoader = new MuleArtifactClassLoader(serviceUrlClassification.getName(), new ArtifactDescriptor(serviceUrlClassification.getName()), serviceUrlClassification.getUrls().toArray(new URL[0]), parent, childClassLoaderLookupPolicy);
        servicesArtifactClassLoaders.add(artifactClassLoader);
    }
    return servicesArtifactClassLoaders;
}
Also used : FilteringArtifactClassLoader(org.mule.runtime.module.artifact.api.classloader.FilteringArtifactClassLoader) ArtifactClassLoader(org.mule.runtime.module.artifact.api.classloader.ArtifactClassLoader) MuleArtifactClassLoader(org.mule.runtime.module.artifact.api.classloader.MuleArtifactClassLoader) ArtifactUrlClassification(org.mule.test.runner.api.ArtifactUrlClassification) ArtifactDescriptor(org.mule.runtime.module.artifact.api.descriptor.ArtifactDescriptor) MuleArtifactClassLoader(org.mule.runtime.module.artifact.api.classloader.MuleArtifactClassLoader) URL(java.net.URL)

Aggregations

URL (java.net.URL)1 ArtifactClassLoader (org.mule.runtime.module.artifact.api.classloader.ArtifactClassLoader)1 FilteringArtifactClassLoader (org.mule.runtime.module.artifact.api.classloader.FilteringArtifactClassLoader)1 MuleArtifactClassLoader (org.mule.runtime.module.artifact.api.classloader.MuleArtifactClassLoader)1 ArtifactDescriptor (org.mule.runtime.module.artifact.api.descriptor.ArtifactDescriptor)1 ArtifactUrlClassification (org.mule.test.runner.api.ArtifactUrlClassification)1