use of com.sun.faces.config.manager.spi.FilterClassesFromFacesInitializerAnnotationProvider in project mojarra by eclipse-ee4j.
the class FindAnnotatedConfigClasses method call.
// ----------------------------------------------- Methods from Callable
@Override
public Map<Class<? extends Annotation>, Set<Class<?>>> call() throws Exception {
Timer t = Timer.getInstance();
if (t != null) {
t.startTiming();
}
// We are executing on a different thread.
facesContext.addInitContextEntryForCurrentThread();
Set<URI> scanUris = null;
com.sun.faces.spi.AnnotationScanner annotationScanner = metadataGetter.getAnnotationScanner();
// This is where we discover what kind of InjectionProvider we have.
if (provider instanceof FilterClassesFromFacesInitializerAnnotationProvider && annotationScanner != null) {
// This InjectionProvider is capable of annotation scanning *and* injection.
// Note that DelegatingAnnotationProvider itself doesn't use the provided scanner, but just uses the classes
// that were already scanned by the ServletContainerInitializer and stored there.
((FilterClassesFromFacesInitializerAnnotationProvider) provider).setAnnotationScanner(annotationScanner, metadataGetter.getJarNames(annotatedSet));
scanUris = emptySet();
} else {
// This InjectionProvider is capable of annotation scanning only
scanUris = metadataGetter.getAnnotationScanURIs(annotatedSet);
}
// Note that DelegatingAnnotationProvider itself ignores the scanUris and directly gets the classes from the
// ServletContext where they were stored by the ServletContainerInitializer
Map<Class<? extends Annotation>, Set<Class<?>>> annotatedClasses = provider.getAnnotatedClasses(scanUris);
if (t != null) {
t.stopTiming();
t.logResult("Configuration annotation scan complete.");
}
return annotatedClasses;
}
Aggregations