@Override
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
final EjbJarMetaData metaData = deploymentUnit.getAttachment(EjbDeploymentAttachmentKeys.EJB_JAR_METADATA);
final EEModuleDescription eeModuleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION);
final Module module = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.MODULE);
final DeploymentReflectionIndex index = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.REFLECTION_INDEX);
if (metaData == null) {
return;
}
if (metaData.getAssemblyDescriptor() == null) {
return;
}
if (metaData.getAssemblyDescriptor().getInterceptorBindings() == null) {
return;
}
//default interceptors must be mentioned in the interceptors section
final Set<String> interceptorClasses = new HashSet<String>();
if (metaData.getInterceptors() != null) {
for (final InterceptorMetaData interceptor : metaData.getInterceptors()) {
interceptorClasses.add(interceptor.getInterceptorClass());
}
}
final Map<String, List<InterceptorBindingMetaData>> bindingsPerComponent = new HashMap<String, List<InterceptorBindingMetaData>>();
final List<InterceptorBindingMetaData> defaultInterceptorBindings = new ArrayList<InterceptorBindingMetaData>();
for (final InterceptorBindingMetaData binding : metaData.getAssemblyDescriptor().getInterceptorBindings()) {
if (binding.getEjbName().equals("*")) {
if (binding.getMethod() != null) {
throw MESSAGES.defaultInterceptorsNotBindToMethod();
}
if(binding.getInterceptorOrder() != null) {