final Set<Class<?>> services = reflections.getTypesAnnotatedWithExcluding(Service.class, MetaDataScanner.CLIENT_PKG_REGEX);
for (Class<?> loadClass : services) {
Object svc = null;
Service svcAnnotation = loadClass.getAnnotation(Service.class);
if (null == svcAnnotation) {
// Diagnose Errai-111
StringBuffer sb = new StringBuffer();
sb.append("Service annotation cannot be loaded. (See https://jira.jboss.org/browse/ERRAI-111)\n");
sb.append(loadClass.getSimpleName()).append(" loader: ").append(loadClass.getClassLoader()).append("\n");
sb.append("@Service loader:").append(Service.class.getClassLoader()).append("\n");
log.warn(sb.toString());
continue;
}
boolean local = loadClass.isAnnotationPresent(Local.class);
String svcName = svcAnnotation.value();
// If no name is specified, just use the class name as the service by default.
if ("".equals(svcName)) {
svcName = loadClass.getSimpleName();
}