in extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/annotation/GenericAnnotationScanner.java [112:163]
public void scanPaths() {
//https://issues.apache.org/jira/browse/EXTSCRIPT-33
//check if the faces config is already available otherwise we cannot scan yet
final FacesContext facesContext = FacesContext.getCurrentInstance();
//runtime config not started
//for now we only can reach the runtime config in the referenced BaseAnnotatonScanListener
//if we have a facesContext reachable.
if (facesContext == null) {
//TODO (1.1) decouple the scan in the BaseAnnotationScanListener from the facesConfig
//to get the runtime config
return;
}
if(!_weaver.isPostInit() || _weaver.getLastAnnotationScan() >= _weaver.getLastTaint()) return;
_weaver.markLastAnnotationScan();
for (String className : _weaver.loadPossibleDynamicClasses()) {
try {
if(!_weaver.isTainted(className)) continue;
//TODO replace this with a direct call to our weavingContext
//<>ScannerClassloader loader = new ScannerClassloader(Thread.currentThread().getContextClassLoader(),
// -1, null, _weaver.getConfiguration().getCompileTarget());
ThrowAwayClassloader loader = new ThrowAwayClassloader(ClassUtils.getContextClassLoader(), false);
Class clazz;
//in case the class does not exist we have to load it from our weavingcontext
//otherwise we do just a scan on the class to avoid side behavior
//if (WeavingContext.getFileChangedDaemon().getClassMap().get(className) == null) {
// clazz = _weaver.loadScriptingClassFromName(className);
//} else {
clazz = loader.loadClass(className);
//}
if (clazz != null) {
java.lang.annotation.Annotation[] anns = clazz.getAnnotations();
if (anns != null && anns.length > 0) {
addOrMoveAnnotations(clazz);
} else {
removeAnnotations(clazz);
}
}
} catch (ClassNotFoundException e) {
Logger _logger = Logger.getLogger(this.getClass().getName());
_logger.log(Level.WARNING, "", e);
}
}
}