//DO NOT USE componentConfiguration.getDescriptorData()
//It will return null if there is no <enterprise-beans/> declaration even if there is an assembly descriptor entry
EjbJarMetaData ejbJarMetadata = deploymentUnit.getAttachment(EjbDeploymentAttachmentKeys.EJB_JAR_METADATA);
if (ejbJarMetadata != null) {
final AssemblyDescriptorMetaData assemblyDescriptor = ejbJarMetadata.getAssemblyDescriptor();
if (assemblyDescriptor != null) {
//handle exclude-list
final ExcludeListMetaData excludeList = assemblyDescriptor.getExcludeListByEjbName(componentDescription.getEJBName());
if (excludeList != null && excludeList.getMethods() != null) {
for (final MethodMetaData method : excludeList.getMethods()) {
final String methodName = method.getMethodName();
final MethodIntf defaultMethodIntf = (componentDescription instanceof MessageDrivenComponentDescription) ? MethodIntf.MESSAGE_ENDPOINT : MethodIntf.BEAN;
final MethodIntf methodIntf = this.getMethodIntf(method.getMethodIntf(), defaultMethodIntf);
if (methodName.equals("*")) {
componentDescription.getDescriptorMethodPermissions().setAttribute(methodIntf, null, EJBMethodSecurityAttribute.denyAll());
} else {
final MethodParametersMetaData methodParams = method.getMethodParams();
// update the session bean description with the tx attribute info
if (methodParams == null) {
componentDescription.getDescriptorMethodPermissions().setAttribute(methodIntf, EJBMethodSecurityAttribute.denyAll(), methodName);
} else {
componentDescription.getDescriptorMethodPermissions().setAttribute(methodIntf, EJBMethodSecurityAttribute.denyAll(), null, methodName, this.getMethodParams(methodParams));
}
}
}
}
//now handle method permissions
final MethodPermissionsMetaData methodPermissions = assemblyDescriptor.getMethodPermissionsByEjbName(componentDescription.getEJBName());
if (methodPermissions != null) {
for (final MethodPermissionMetaData methodPermissionMetaData : methodPermissions) {
final MethodsMetaData methods = methodPermissionMetaData.getMethods();
for (final MethodMetaData method : methods) {