Process Annotation with given EjbContexts.
AnnotatedElement ae = (AnnotatedElement)ainfo.getAnnotatedElement();
if (ae.isAnnotationPresent(DenyAll.class) ||
ae.isAnnotationPresent(RolesAllowed.class)) {
log(Level.SEVERE, ainfo,
localStrings.getLocalString(
"enterprise.deployment.annotation.handlers.inconsistentsecannotation",
"This annotation is not consistent with other annotations. One cannot have more than one of @RolesAllowed, @PermitAll, @DenyAll in the same AnnotatedElement."));
return getDefaultFailedResult();
}
for (EjbContext ejbContext : ejbContexts) {
EjbDescriptor ejbDesc = ejbContext.getDescriptor();
if (ElementType.TYPE.equals(ainfo.getElementType())) {
// postpone the processing at the end
ejbContext.addPostProcessInfo(ainfo, this);
} else { // METHOD
Method annMethod = (Method)ainfo.getAnnotatedElement();
for (Object next : ejbDesc.getSecurityBusinessMethodDescriptors()) {
MethodDescriptor md = (MethodDescriptor)next;
Method m = md.getMethod(ejbDesc);
if (TypeUtil.sameMethodSignature(m, annMethod)) {
// override by xml
if (!hasMethodPermissionsFromDD(md, ejbDesc)) {
ejbDesc.addPermissionedMethod(
MethodPermission.getUncheckedMethodPermission(),
md);
}
}
}
}
}
return getDefaultProcessedResult();