use of org.jboss.as.server.deployment.annotation.CompositeIndex in project wildfly by wildfly.
the class ApplicationExceptionAnnotationProcessor method deploy.
@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
if (MetadataCompleteMarker.isMetadataComplete(deploymentUnit)) {
return;
}
final CompositeIndex compositeIndex = deploymentUnit.getAttachment(Attachments.COMPOSITE_ANNOTATION_INDEX);
if (compositeIndex == null) {
return;
}
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 EjbLogger.ROOT_LOGGER.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);
}
}
use of org.jboss.as.server.deployment.annotation.CompositeIndex in project wildfly by wildfly.
the class AroundTimeoutAnnotationParsingProcessor method deploy.
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
if (MetadataCompleteMarker.isMetadataComplete(deploymentUnit)) {
return;
}
final EEModuleDescription eeModuleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION);
final CompositeIndex index = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.COMPOSITE_ANNOTATION_INDEX);
final List<AnnotationInstance> aroundInvokes = index.getAnnotations(AROUND_TIMEOUT_ANNOTATION_NAME);
for (AnnotationInstance annotation : aroundInvokes) {
processAroundInvoke(annotation.target(), eeModuleDescription);
}
}
use of org.jboss.as.server.deployment.annotation.CompositeIndex in project wildfly by wildfly.
the class WebServiceAnnotationProcessor method deploy.
@SuppressWarnings({ "unchecked", "rawtypes" })
public final void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
final EEModuleDescription eeModuleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION);
final CompositeIndex index = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.COMPOSITE_ANNOTATION_INDEX);
if (index == null || eeModuleDescription == null) {
return;
}
for (final ClassAnnotationInformationFactory factory : factories) {
final Map<String, ClassAnnotationInformation<?, ?>> data = factory.createAnnotationInformation(index, PropertyReplacers.noop());
for (Map.Entry<String, ClassAnnotationInformation<?, ?>> entry : data.entrySet()) {
EEModuleClassDescription clazz = eeModuleDescription.addOrGetLocalClassDescription(entry.getKey());
clazz.addAnnotationInformation(entry.getValue());
}
}
}
use of org.jboss.as.server.deployment.annotation.CompositeIndex in project wildfly by wildfly.
the class AbstractIntegrationProcessorJAXWS method deploy.
@Override
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit unit = phaseContext.getDeploymentUnit();
if (DeploymentTypeMarker.isType(DeploymentType.EAR, unit)) {
return;
}
final CompositeIndex index = unit.getAttachment(Attachments.COMPOSITE_ANNOTATION_INDEX);
if (index == null) {
return;
}
final EEModuleDescription eeModuleDescription = unit.getAttachment(org.jboss.as.ee.component.Attachments.EE_MODULE_DESCRIPTION);
processAnnotation(unit, eeModuleDescription);
}
use of org.jboss.as.server.deployment.annotation.CompositeIndex in project wildfly by wildfly.
the class TransactionDependenciesProcessor method deploy.
@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit unit = phaseContext.getDeploymentUnit();
final ModuleLoader moduleLoader = Module.getBootModuleLoader();
final ModuleSpecification moduleSpec = unit.getAttachment(Attachments.MODULE_SPECIFICATION);
moduleSpec.addSystemDependency(new ModuleDependency(moduleLoader, TRANSACTION_API, false, false, true, false));
moduleSpec.addSystemDependency(new ModuleDependency(moduleLoader, ModuleIdentifier.fromString("org.wildfly.transaction.client"), false, false, true, false));
final CompositeIndex compositeIndex = unit.getAttachment(Attachments.COMPOSITE_ANNOTATION_INDEX);
if (compositeIndex == null) {
return;
}
final List<AnnotationInstance> transactionalAnnotations = compositeIndex.getAnnotations(DotName.createSimple(Transactional.class.getName()));
final List<AnnotationInstance> transactionScopedAnnotations = compositeIndex.getAnnotations(DotName.createSimple(TransactionScoped.class.getName()));
if (!transactionalAnnotations.isEmpty() || !transactionScopedAnnotations.isEmpty()) {
addJTSModuleDependencyToDeployment(unit);
}
}
Aggregations