// here for ears we need to skip classes in the parent classloader
final ClassLoader scl = ClassLoader.getSystemClassLoader();
final boolean filterByClassLoader = "true".equals(SystemInstance.get().getProperty(OPENEJB_CDI_FILTER_CLASSLOADER, "true"));
final BeanArchiveService beanArchiveService = webBeansContext.getBeanArchiveService();
final boolean openejb = OpenEJBBeanInfoService.class.isInstance(beanArchiveService);
for (final BeansInfo.BDAInfo next : beans.bdas) {
final BeanArchiveService.BeanArchiveInformation information;
if (openejb) {
final OpenEJBBeanInfoService beanInfoService = OpenEJBBeanInfoService.class.cast(beanArchiveService);
information = beanInfoService.createBeanArchiveInformation(beans, classLoader, next.discoveryMode == null? "ALL" : next.discoveryMode); // this fallback is 100% for tests, TODO: get rid of it (AppComposer)
// TODO: log a warn is discoveryModes.get(key) == null
try {
beanInfoService.getBeanArchiveInfo().put(next.uri == null ? null : next.uri.toURL(), information);
} catch (final MalformedURLException e) {
throw new IllegalStateException(e);
}
} else {
try {
information = beanArchiveService.getBeanArchiveInformation(next.uri.toURL());
} catch (MalformedURLException e) {
throw new IllegalStateException(e);
}
}