use of org.mule.runtime.module.artifact.api.descriptor.DescriptorLoader in project mule by mulesoft.
the class ServiceRegistryDescriptorLoaderRepository method findBundleDescriptorLoaders.
private List<DescriptorLoader> findBundleDescriptorLoaders(Class<? extends DescriptorLoader> descriptorLoaderClass) {
List<DescriptorLoader> descriptorLoaders = new ArrayList<>();
Collection<? extends DescriptorLoader> providers = serviceRegistry.lookupProviders(descriptorLoaderClass, this.getClass().getClassLoader());
for (DescriptorLoader loader : providers) {
descriptorLoaders.add(loader);
}
return descriptorLoaders;
}
use of org.mule.runtime.module.artifact.api.descriptor.DescriptorLoader in project mule by mulesoft.
the class ServiceRegistryDescriptorLoaderRepository method get.
@Override
public synchronized <T extends DescriptorLoader> T get(String id, ArtifactType artifactType, Class<T> loaderClass) throws LoaderNotFoundException {
if (descriptorLoaders == null) {
initializeDescriptorLoaders();
}
DescriptorLoader descriptorLoader = null;
List<DescriptorLoader> registeredDescriptorLoaders = descriptorLoaders.get(loaderClass);
if (registeredDescriptorLoaders != null) {
for (DescriptorLoader loader : registeredDescriptorLoaders) {
if (loader.getId().equals(id) && loader.supportsArtifactType(artifactType)) {
descriptorLoader = loader;
}
}
}
if (descriptorLoader == null) {
throw new LoaderNotFoundException(noRegisteredLoaderError(id, loaderClass));
}
return (T) descriptorLoader;
}
Aggregations