use of org.jboss.metadata.ejb.spec.MethodPermissionsMetaData in project wildfly by wildfly.
the class MethodPermissionsMergingProcessor method handleDeploymentDescriptor.
@Override
protected void handleDeploymentDescriptor(final DeploymentUnit deploymentUnit, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final EJBComponentDescription componentDescription) throws DeploymentUnitProcessingException {
//Add the configurator that calculates JACC permissions
//TODO: should this be elsewhere?
componentDescription.getConfigurators().add(new EjbJaccConfigurator());
//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 wildcard exclude-list
final ExcludeListMetaData wildCardExcludeList = assemblyDescriptor.getExcludeListByEjbName("*");
if (wildCardExcludeList != null && wildCardExcludeList.getMethods() != null) {
handleExcludeMethods(componentDescription, wildCardExcludeList);
}
//handle ejb-specific exclude-list
final ExcludeListMetaData excludeList = assemblyDescriptor.getExcludeListByEjbName(componentDescription.getEJBName());
if (excludeList != null && excludeList.getMethods() != null) {
handleExcludeMethods(componentDescription, excludeList);
}
//handle wildcard method permissions
final MethodPermissionsMetaData wildCardMethodPermissions = assemblyDescriptor.getMethodPermissionsByEjbName("*");
if (wildCardMethodPermissions != null) {
handleMethodPermissions(componentDescription, wildCardMethodPermissions);
}
//handle ejb-specific method permissions
final MethodPermissionsMetaData methodPermissions = assemblyDescriptor.getMethodPermissionsByEjbName(componentDescription.getEJBName());
if (methodPermissions != null) {
handleMethodPermissions(componentDescription, methodPermissions);
}
}
}
}
Aggregations