SecurityDomain sd = (SecurityDomain) container.resolveAnnotation(SecurityDomain.class);
PermitAll beanUnchecked = (PermitAll) container.resolveAnnotation(PermitAll.class);
RolesAllowed beanPermissions = (RolesAllowed) container.resolveAnnotation(RolesAllowed.class);
DeclareRoles beanDeclareRolesPerms = (DeclareRoles)container.resolveAnnotation(DeclareRoles.class);
if (beanUnchecked != null && beanPermissions != null)
{
throw new RuntimeException("Cannot annotate a bean with both @Unchecked and @MethodPermissions");
}
String ejbName = container.getEjbName();
//Add the security role references
if(beanDeclareRolesPerms != null)
{
String[] rolerefs = beanDeclareRolesPerms.value();
int len = rolerefs != null ? rolerefs.length : 0;
for(int i=0; i < len; i++)
{
try
{