}
private void addSecurityAnnotations(EJBContainer container, JBossEnterpriseBeanMetaData enterpriseBean, String ejbName)
throws ClassNotFoundException, NoSuchMethodException, NoSuchFieldException
{
JBossAssemblyDescriptorMetaData assembly = dd.getAssemblyDescriptor();
if (assembly != null)
{
SecurityRolesMetaData securityRoles = assembly.getSecurityRoles();
if (securityRoles != null && securityRoles.size() > 0)
{
List<String> roleList = new ArrayList<String>();
for (SecurityRoleMetaData securityRole : securityRoles)
{
roleList.add(securityRole.getRoleName());
}
DeclareRolesImpl annotation = new DeclareRolesImpl(roleList.toArray(new String[roleList.size()]));
addClassAnnotation(container, DeclareRoles.class, annotation);
}
MethodPermissionsMetaData methodPermissions = assembly.getMethodPermissions();
if(methodPermissions != null)
{
for (MethodPermissionMetaData permission : methodPermissions)
{
for (MethodMetaData method : permission.getMethods())