else if (ejbClass.isAnnotationPresent(Stateless.class))
_sessionType = "Stateless";
else if (ejbClass.isAnnotationPresent(Stateful.class))
_sessionType = "Stateful";
else
throw new ConfigException(L.l("'{0}' needs a configured session-type",
ejbClass.getName()));
}
if ("Stateless".equals(_sessionType)) {
Stateless stateless = new StatelessLiteral(name, mappedName, description);
annType.addAnnotation(stateless);
return new EjbStatelessBean<T>(getConfig(), rawAnnType, annType, moduleName);
}
else if ("Stateful".equals(_sessionType)) {
Stateful stateful = new StatefulLiteral(name, mappedName, description);
annType.addAnnotation(stateful);
return new EjbStatefulBean<T>(getConfig(), rawAnnType, annType, moduleName);
}
else if ("Singleton".equals(_sessionType)) {
Singleton singleton = new SingletonLiteral(name, mappedName, description);
annType.addAnnotation(singleton);
return new EjbSingletonBean<T>(getConfig(), rawAnnType, annType, moduleName);
}
throw new ConfigException(L.l("'{0}' is an unknown <session-type>",
_sessionType));
}