List<Method> methods = methodPermission.getMethod();
Iterator<Method> methodIter = methods.iterator();
while (methodIter.hasNext()) {
Method method = (Method) methodIter.next();
EnterpriseBean enterpriseBean = ejbJar.getEnterpriseBean(method.getEjbName());
try {
MethodParams methodParams = method.getMethodParams();
String[] params = methodParams.getMethodParam().toArray(new String[0]);
if ((!"*".equals(method.getMethodName())) && descriptor.getExcludeList().getMethod().contains(method)) { //$NON-NLS-1$
annotationHelper.addMethodAnnotation(enterpriseBean.getEjbClass(), method.getMethodName(), params, DenyAll.class, null);
continue;
}
if (methodPermission.getUnchecked()) {
if ("*".equals(method.getMethodName())) { //$NON-NLS-1$
annotationHelper.addClassAnnotation(enterpriseBean.getEjbClass(), PermitAll.class, null);
} else {
annotationHelper.addMethodAnnotation(enterpriseBean.getEjbClass(), method.getMethodName(), params, PermitAll.class, null);
}
} else {
if ("*".equals(method.getMethodName())) { //$NON-NLS-1$
annotationHelper.addClassAnnotation(enterpriseBean.getEjbClass(), RolesAllowed.class, roleProps);
} else {
annotationHelper.addMethodAnnotation(enterpriseBean.getEjbClass(), method.getMethodName(), params, RolesAllowed.class, roleProps);
}
}
} catch (Exception e) {
String warning = String.format(Messages.getString("org.apache.openejb.helper.annotation.warnings.12"), "@javax.persistence.RolesAllowed", enterpriseBean.getEjbClass());
annotationHelper.addWarning(warning);