if (!_loaded) {
if (!(descriptorProvider instanceof ClasspathScanDescriptorProvider)) {
throw new IllegalStateException(
"Can only load user extensions when descriptor provider is of classpath scanner type.");
}
ClasspathScanDescriptorProvider classpathScanner = (ClasspathScanDescriptorProvider) descriptorProvider;
ClassLoader classLoader = ResourceManager.getInstance().createClassLoader(_files);
int analyzersBefore = classpathScanner.getAnalyzerBeanDescriptors().size();
int transformersBefore = classpathScanner.getTransformerBeanDescriptors().size();
int filtersBefore = classpathScanner.getFilterBeanDescriptors().size();
classpathScanner.scanPackage(_scanPackage, _scanRecursive, classLoader);
_loadedAnalyzers = classpathScanner.getAnalyzerBeanDescriptors().size() - analyzersBefore;
_loadedTransformers = classpathScanner.getTransformerBeanDescriptors().size() - transformersBefore;
_loadedFilters = classpathScanner.getFilterBeanDescriptors().size() - filtersBefore;
_loaded = true;
logger.info("Succesfully loaded extension '{}' containing {} analyzers, {} transformers, {} filters",
new Object[] { getName(), getLoadedAnalyzers(), getLoadedTransformers(), getLoadedFilters() });