/* 19.2: ejb-name: Default is the unqualified name of the bean class */
EjbJar ejbJar = ejbModule.getEjbJar();
for (Class<?> beanClass : finder.findAnnotatedClasses(Singleton.class)) {
Singleton singleton = beanClass.getAnnotation(Singleton.class);
String ejbName = getEjbName(singleton, beanClass);
if (!isValidEjbAnnotationUsage(Singleton.class, beanClass, ejbName, ejbModule)) continue;
EnterpriseBean enterpriseBean = ejbJar.getEnterpriseBean(ejbName);
if (enterpriseBean == null) {
enterpriseBean = new SingletonBean(ejbName, beanClass.getName());
ejbJar.addEnterpriseBean(enterpriseBean);
}
if (enterpriseBean.getEjbClass() == null) {
enterpriseBean.setEjbClass(beanClass.getName());
}
if (enterpriseBean instanceof SessionBean) {
SessionBean sessionBean = (SessionBean) enterpriseBean;
sessionBean.setSessionType(SessionType.SINGLETON);
if (singleton.mappedName() != null) {
sessionBean.setMappedName(singleton.mappedName());
}
}
}
for (Class<?> beanClass : finder.findAnnotatedClasses(Stateless.class)) {