ejbComponentDescription.setRolesAllowedForAllMethodsOfAllViews(securityRoles);
} else {
ejbComponentDescription.setRolesAllowedForAllMethodsOnViewType(methodIntf, securityRoles);
}
} else {
final MethodParametersMetaData methodParams = method.getMethodParams();
// style 2
// <method>
// <ejb-name>EJBNAME</ejb-name>
// <method-name>METHOD</method-name>
// </method>
if (methodParams == null || methodParams.isEmpty()) {
final Collection<Method> applicableMethods = ClassReflectionIndexUtil.findAllMethodsByName(deploymentReflectionIndex, classReflectionIndex, methodName);
// just log a WARN message and proceed, in case there was no method by that name
if (applicableMethods.isEmpty()) {
logger.warn("No method named: " + methodName + " found on EJB: " + ejbName + " while processing method-permission element in ejb-jar.xml");
continue;
}
// apply the @RolesAllowed/method-permission
this.setRolesAllowed(ejbComponentDescription, methodIntf, applicableMethods, securityRoles);
} else {
// style 3
// <method>
// <ejb-name>EJBNAME</ejb-name>
// <method-name>METHOD</method-name>
// <method-params>
// <method-param>PARAMETER_1</method-param>
// ...
// <method-param>PARAMETER_N</method-param>
// </method-params>
//
// </method>
final String[] paramTypes = methodParams.toArray(new String[methodParams.size()]);
final Collection<Method> applicableMethods = ClassReflectionIndexUtil.findMethods(deploymentReflectionIndex, classReflectionIndex, methodName, paramTypes);
// just log a WARN message and proceed, in case there was no method by that name and param types
if (applicableMethods.isEmpty()) {
logger.warn("No method named: " + methodName + " with param types: " + paramTypes + " found on EJB: " + ejbName + " while processing method-permission element in ejb-jar.xml");
continue;