}
List<AnnotationInstance> applicationExceptionAnnotations = compositeIndex.getAnnotations(DotName.createSimple(ApplicationException.class.getName()));
if (applicationExceptionAnnotations == null || applicationExceptionAnnotations.isEmpty()) {
return;
}
ApplicationExceptionDescriptions descriptions = new ApplicationExceptionDescriptions();
deploymentUnit.putAttachment(EjbDeploymentAttachmentKeys.APPLICATION_EXCEPTION_DESCRIPTIONS, descriptions);
for (AnnotationInstance annotationInstance : applicationExceptionAnnotations) {
AnnotationTarget target = annotationInstance.target();
if (!(target instanceof ClassInfo)) {
throw EjbMessages.MESSAGES.annotationOnlyAllowedOnClass(ApplicationException.class.getName(), target);
}
String exceptionClassName = ((ClassInfo) target).name().toString();
boolean rollback = false;
AnnotationValue rollBackAnnValue = annotationInstance.value("rollback");
if (rollBackAnnValue != null) {
rollback = rollBackAnnValue.asBoolean();
}
// default "inherited" is true
boolean inherited = true;
AnnotationValue inheritedAnnValue = annotationInstance.value("inherited");
if (inheritedAnnValue != null) {
inherited = inheritedAnnValue.asBoolean();
}
descriptions.addApplicationException(exceptionClassName, rollback, inherited);
}
}