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;
}
Aggregations