Process Annotation with given EjbContexts.
AnnotatedElement ae = (AnnotatedElement)ainfo.getAnnotatedElement();
Method annMethod = (Method) ainfo.getAnnotatedElement();
if (ae.isAnnotationPresent(PermitAll.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();
for (Object next : ejbDesc.getSecurityBusinessMethodDescriptors()) {
MethodDescriptor md = (MethodDescriptor)next;
// override by xml
if (!hasMethodPermissionsFromDD(md, ejbDesc)) {
Method m = md.getMethod(ejbDesc);
if (TypeUtil.sameMethodSignature(m, annMethod)) {
ejbDesc.addPermissionedMethod(
MethodPermission.getExcludedMethodPermission(), md);
}
}
}
}
return getDefaultProcessedResult();